path: root/setup.c
diff options
authorJunio C Hamano <>2010-04-04 17:33:53 (GMT)
committerJunio C Hamano <>2010-04-04 17:33:53 (GMT)
commite640551773c9730a47779dfc93155feb092c8e3c (patch)
tree798c74407f1e4247dcce2a59c6fad7dd0bc5b171 /setup.c
parent8030e44215fe8f34edd57d711a35f2f0f97a0423 (diff)
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 <>
Diffstat (limited to 'setup.c')
1 files changed, 2 insertions, 2 deletions
diff --git a/setup.c b/setup.c
index 8b911b1..d290633 100644
--- a/setup.c
+++ b/setup.c
@@ -323,7 +323,7 @@ const char *setup_git_directory_gently(int *nongit_ok)
const char *gitdirenv;
const char *gitfile_dir;
int len, offset, ceil_offset, root_len;
- int current_device = 0, one_filesystem = 0;
+ int current_device = 0, one_filesystem = 1;
struct stat buf;
@@ -444,7 +444,7 @@ const char *setup_git_directory_gently(int *nongit_ok)
cwd[offset] = '\0';
die("Not a git repository (or any parent up to mount parent %s)\n"
- "Stopping at filesystem boundary since GIT_ONE_FILESYSTEM is set.", cwd);
+ "Stopping at filesystem boundary since GIT_ONE_FILESYSTEM is true.", cwd);
if (chdir("..")) {