summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7ebdba6)
raw | patch | inline | side by side (parent: 7ebdba6)
author | Junio C Hamano <junkio@cox.net> | |
Tue, 2 May 2006 07:40:24 +0000 (00:40 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 5 May 2006 21:37:08 +0000 (14:37 -0700) |
When inspecting a project whose build infrastructure used to
assume that .git/HEAD is a symlink ref, core.prefersymlinkrefs
in the config file of such a project would help to bisect its
history.
Signed-off-by: Junio C Hamano <junkio@cox.net>
(cherry picked from 9f0bb90d161edf8c43f5261d12bf83f14eb02ff4 commit)
assume that .git/HEAD is a symlink ref, core.prefersymlinkrefs
in the config file of such a project would help to bisect its
history.
Signed-off-by: Junio C Hamano <junkio@cox.net>
(cherry picked from 9f0bb90d161edf8c43f5261d12bf83f14eb02ff4 commit)
Documentation/config.txt | patch | blob | history | |
Makefile | patch | blob | history | |
cache.h | patch | blob | history | |
config.c | patch | blob | history | |
environment.c | patch | blob | history | |
refs.c | patch | blob | history |
index b27b0d5c068f5e60faaf684397c605a188a241ac..d1a4bec0d472231abdf026cc0743effa3ae72b27 100644 (file)
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
slow, such as Microsoft Windows. See gitlink:git-update-index[1].
False by default.
-core.onlyUseSymrefs::
- Always use the "symref" format instead of symbolic links for HEAD
- and other symbolic reference files. True by default.
+core.preferSymlinkRefs::
+ Instead of the default "symref" format for HEAD
+ and other symbolic reference files, use symbolic links.
+ This is sometimes needed to work with old scripts that
+ expect HEAD to be a symbolic link.
core.repositoryFormatVersion::
Internal variable identifying the repository format and layout
diff --git a/Makefile b/Makefile
index 8aed3af0165fe764d71184ffe0f35748d368e5a1..3972d10886f649eea298191f24a76591de4a705c 100644 (file)
--- a/Makefile
+++ b/Makefile
#
# Define NO_SETENV if you don't have setenv in the C library.
#
-# Define USE_SYMLINK_HEAD if you want .git/HEAD to be a symbolic link.
-# Don't enable it on Windows.
+# Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link.
+# Enable it on Windows. By default, symrefs are still used.
#
# Define PPC_SHA1 environment variable when running make to make use of
# a bundled SHA1 routine optimized for PowerPC.
NO_D_TYPE_IN_DIRENT = YesPlease
NO_D_INO_IN_DIRENT = YesPlease
NO_STRCASESTR = YesPlease
+ NO_SYMLINK_HEAD = YesPlease
NEEDS_LIBICONV = YesPlease
# There are conflicting reports about this.
# On some boxes NO_MMAP is needed, and not so elsewhere.
ifdef NO_D_INO_IN_DIRENT
ALL_CFLAGS += -DNO_D_INO_IN_DIRENT
endif
+ifdef NO_SYMLINK_HEAD
+ ALL_CFLAGS += -DNO_SYMLINK_HEAD
+endif
ifdef NO_STRCASESTR
COMPAT_CFLAGS += -DNO_STRCASESTR
COMPAT_OBJS += compat/strcasestr.o
index 4d8fabc6d8f3059d12640b66e6cf124c77022d07..ae69fdea95b16d4e42ca96970ec1dea3f2d776a1 100644 (file)
--- a/cache.h
+++ b/cache.h
/* Environment bits from configuration mechanism */
extern int trust_executable_bit;
extern int assume_unchanged;
-extern int only_use_symrefs;
+extern int prefer_symlink_refs;
extern int warn_ambiguous_refs;
extern int diff_rename_limit_default;
extern int shared_repository;
diff --git a/config.c b/config.c
index 2cdf5fcab4da22bed4ed19e9f55b8759ccdcd3fb..87fb22041ec4b068cf1072689bc8309d8804ae1e 100644 (file)
--- a/config.c
+++ b/config.c
return 0;
}
- if (!strcmp(var, "core.symrefsonly")) {
- only_use_symrefs = git_config_bool(var, value);
+ if (!strcmp(var, "core.prefersymlinkrefs")) {
+ prefer_symlink_refs = git_config_bool(var, value);
return 0;
}
diff --git a/environment.c b/environment.c
index 6df647862c60c5b76540f3038ce37f8a5dcc37c9..444c99ed6efc8e9e1661427e08b44bb8b0e5fbf2 100644 (file)
--- a/environment.c
+++ b/environment.c
char git_default_name[MAX_GITNAME];
int trust_executable_bit = 1;
int assume_unchanged = 0;
-int only_use_symrefs = 0;
+int prefer_symlink_refs = 0;
int warn_ambiguous_refs = 1;
int repository_format_version = 0;
char git_commit_encoding[MAX_ENCODING_LENGTH] = "utf-8";
index 03398ccc531c15e549b66c43a176fd7b2bde4aca..275b914b2b4cd17f26e85ab1ca5b32ea573acab4 100644 (file)
--- a/refs.c
+++ b/refs.c
char ref[1000];
int fd, len, written;
-#ifdef USE_SYMLINK_HEAD
- if (!only_use_symrefs) {
+#ifndef NO_SYMLINK_HEAD
+ if (prefer_symlink_refs) {
unlink(git_HEAD);
if (!symlink(refs_heads_master, git_HEAD))
return 0;