From 8030e44215fe8f34edd57d711a35f2f0f97a0423 Mon Sep 17 00:00:00 2001 From: "Lars R. Damerow" Date: Wed, 17 Mar 2010 12:55:53 -0700 Subject: Add support for GIT_ONE_FILESYSTEM This patch makes git pay attention to the GIT_ONE_FILESYSTEM environment variable. When that variable is set, git will stop searching for a GIT_DIR when it attempts to cross a filesystem boundary. When working in an environment with too many automount points to make maintaining a GIT_CEILING_DIRECTORIES list enjoyable, GIT_ONE_FILESYSTEM gives the option of turning all such attempts off with one setting. Signed-off-by: Lars R. Damerow Signed-off-by: Junio C Hamano --- Documentation/git.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Documentation/git.txt') diff --git a/Documentation/git.txt b/Documentation/git.txt index 4e00b315ff..bf1b45eef1 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -530,6 +530,12 @@ git so take care if using Cogito etc. a GIT_DIR set on the command line or in the environment. (Useful for excluding slow-loading network directories.) +'GIT_ONE_FILESYSTEM':: + If set to a true value ("true" or a non-zero integer), stop at + filesystem boundaries when looking for a repository directory. + Like 'GIT_CEILING_DIRECTORIES', it will not affect an explicit + respository directory set via 'GIT_DIR' or on the command line. + git Commits ~~~~~~~~~~~ 'GIT_AUTHOR_NAME':: -- cgit v1.2.3 From e640551773c9730a47779dfc93155feb092c8e3c Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 4 Apr 2010 10:33:53 -0700 Subject: GIT_ONE_FILESYSTEM: flip the default to stop at filesystem boundaries Regarding the new environment variable, Linus Torvalds writes on Tue, 30 Mar 2010 in : I suspect that it is _very_ unusual to have a source repo that crosses multiple filesystems, and the original reason for this patch-series seems to me to be likely to be more common than that multi-fs case. So having the logic go the other way would seem to match the common case, no? The "crossing filesystem boundary" condition is checked by comparing st_dev field in the result from stat(2). This is slightly worrysome if non-POSIX ports return different values in the field even for directories in the same work tree extracted to the same "filesystem". Erik Faye-Lund confirms that in the msysgit port st_dev is 0, so this should be safe, as "even Windows is safe" ;-) This will affect those who use /.git to cram /etc and /home/me in the same repostiory, /home is mounted from non-root filesystem, and a git operation is done from inside /home/me/src. But that is such a corner case we don't want to give preference over helping people who will benefit from having this default so that they do not have to suffer from slow automounters. Signed-off-by: Junio C Hamano --- Documentation/git.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'Documentation/git.txt') diff --git a/Documentation/git.txt b/Documentation/git.txt index bf1b45eef1..aa62083209 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -531,10 +531,14 @@ git so take care if using Cogito etc. (Useful for excluding slow-loading network directories.) 'GIT_ONE_FILESYSTEM':: - If set to a true value ("true" or a non-zero integer), stop at - filesystem boundaries when looking for a repository directory. - Like 'GIT_CEILING_DIRECTORIES', it will not affect an explicit - respository directory set via 'GIT_DIR' or on the command line. + When run in a directory that does not have ".git" repository + directory, git tries to find such a directory in the parent + directories to find the top of the working tree, but by default it + does not cross filesystem boundaries. This environment variable + can be set to false value ("false" or zero) to tell git not to + stop at filesystem boundaries. Like 'GIT_CEILING_DIRECTORIES', + this will not affect an explicit respository directory set via + 'GIT_DIR' or on the command line. git Commits ~~~~~~~~~~~ -- cgit v1.2.3 From cf87463e79a3018f666bfc9af113d3eea58a3d82 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 4 Apr 2010 14:49:31 -0700 Subject: Rename ONE_FILESYSTEM to DISCOVERY_ACROSS_FILESYSTEM If a missing ONE_FILESYSTEM defaults to true, the only users who set this variable set it to false to tell git not to limit the discovery to one filesystem; there are too many negations in one sentence to make a simple panda brain dizzy. Use the variable GIT_DISCOVERY_ACROSS_FILESYSTEM that changes the behaviour from the default "limit to one filesystem" to "cross the boundary as I ask you to"; makes the semantics much more straight forward. Signed-off-by: Junio C Hamano --- Documentation/git.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Documentation/git.txt') diff --git a/Documentation/git.txt b/Documentation/git.txt index aa62083209..991aaec599 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -530,15 +530,15 @@ git so take care if using Cogito etc. a GIT_DIR set on the command line or in the environment. (Useful for excluding slow-loading network directories.) -'GIT_ONE_FILESYSTEM':: +'GIT_DISCOVERY_ACROSS_FILESYSTEM':: When run in a directory that does not have ".git" repository directory, git tries to find such a directory in the parent directories to find the top of the working tree, but by default it does not cross filesystem boundaries. This environment variable - can be set to false value ("false" or zero) to tell git not to - stop at filesystem boundaries. Like 'GIT_CEILING_DIRECTORIES', - this will not affect an explicit respository directory set via - 'GIT_DIR' or on the command line. + can be set to true to tell git not to stop at filesystem + boundaries. Like 'GIT_CEILING_DIRECTORIES', this will not affect + an explicit repository directory set via 'GIT_DIR' or on the + command line. git Commits ~~~~~~~~~~~ -- cgit v1.2.3