[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git
Subject:    Re: [PATCH] add GIT_FAST_STAT mode for Cygwin
From:       "Alex Riesen" <raa.lkml () gmail ! com>
Date:       2008-09-23 14:37:14
Message-ID: 81b0412b0809230737s7498e214w4c58991e79f76507 () mail ! gmail ! com
[Download RAW message or body]

2008/9/23 Dmitry Potapov <dpotapov@gmail.com>:
> 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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic