2008/9/23 Dmitry Potapov <dpotapov@xxxxxxxxx>: > This patch introduces the GIT_FAST_STAT environment variable. If this > variable is not set then Git will work as before. However, if it is set > then the Cygwin version of Git will try to use a Win32 API function if > it is possible to speed up stat/lstat. > > This fast mode works only for relative paths. It is assumed that the > whole repository is located inside one directory without using Cygwin > mount to bind external paths inside of the current tree. Why runtime conditional? Why conditional at all? Why not fallback to cygwin's slow stat on absolute pathnames like you do for symlinks? > +/* > + * This are startup stubs, which choose what implementation of lstat/stat why do you need two of them? Isn't one not enough? > +stat_fn_t cygwin_stat_fn = cygwin_stat_choice; > +stat_fn_t cygwin_lstat_fn = cygwin_lstat_choice; ... > +typedef int (*stat_fn_t)(const char*, struct stat*); > +extern stat_fn_t cygwin_stat_fn; > +extern stat_fn_t cygwin_lstat_fn; extern int (*cygwin_stat_fn)(const char *, struct stat *); Is shorter, easier to read and easier to understand (for a C person). You don't even use the type anywhere else, it is just for the declaration sake! -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html