[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:       "Shawn O. Pearce" <spearce () spearce ! org>
Date:       2008-09-23 15:31:48
Message-ID: 20080923153148.GI3669 () spearce ! org
[Download RAW message or body]

Dmitry Potapov <dpotapov@gmail.com> wrote:
> 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.
...
> +/*
> + * This are startup stubs, which choose what implementation of lstat/stat
> + * should be used. If GIT_FAST_STAT is not set then the standard functions
> + * included in the cygwin library are used. If it is set then our fast and
> + * dirty implementation is invoked, which should be 2-3 times faster than
> + * cygwin functions.
> + */
> +static int cygwin_stat_choice(const char *file_name, struct stat *buf)
> +{
> +	cygwin_stat_fn = getenv("GIT_FAST_STAT") ?
> +		cygwin_stat : stat;
> +	return (*cygwin_stat_fn)(file_name, buf);
> +}
> +
> +static int cygwin_lstat_choice(const char *file_name, struct stat *buf)
> +{
> +	cygwin_lstat_fn = getenv("GIT_FAST_STAT") ?
> +		cygwin_lstat : lstat;
> +	return (*cygwin_lstat_fn)(file_name, buf);
> +}

I wonder, should this be controlled by an environment variable?

Given your description of the feature it seems to be more a property
of the specific repository, as it is based upon where the repository
lives within the Cygwin namespace.  Should this be controlled instead
by say a "core.cygwinnativestat = true" configuration property?

-- 
Shawn.
--
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