Re: [PATCH] add GIT_FAST_STAT mode for Cygwin

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dmitry Potapov <dpotapov@xxxxxxxxx> 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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux