From: Jeff King <peff@peff.net>
To: git@vger.kernel.org
Cc: Michael Haggerty <mhagger@alum.mit.edu>,
Junio C Hamano <gitster@pobox.com>
Subject: Re: [RFC/PATCH 4/3] create_symref: drop support for writing symbolic links
Date: Tue, 29 Dec 2015 01:03:58 -0500 [thread overview]
Message-ID: <20151229060358.GB12848@sigill.intra.peff.net> (raw)
In-Reply-To: <20151229060055.GA17047@sigill.intra.peff.net>
On Tue, Dec 29, 2015 at 01:00:55AM -0500, Jeff King wrote:
> --- a/refs/files-backend.c
> +++ b/refs/files-backend.c
> @@ -2811,21 +2811,6 @@ static int commit_ref_update(struct ref_lock *lock,
> return 0;
> }
>
> -static int create_ref_symlink(struct ref_lock *lock, const char *target)
> -{
> - int ret = -1;
> -#ifndef NO_SYMLINK_HEAD
> - char *ref_path = get_locked_file_path(lock->lk);
> - unlink(ref_path);
> - ret = symlink(target, ref_path);
> - free(ref_path);
> -
> - if (ret)
> - fprintf(stderr, "no symlink - falling back to symbolic ref\n");
> -#endif
I forgot the build-time knob, which becomes a noop after this patch. If
we choose to apply this patch, we'd want to squash this in, too:
diff --git a/Makefile b/Makefile
index fd19b54..05ffd60 100644
--- a/Makefile
+++ b/Makefile
@@ -113,9 +113,6 @@ all::
#
# Define NO_SYS_SELECT_H if you don't have sys/select.h.
#
-# 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 NO_SVN_TESTS if you want to skip time-consuming SVN interoperability
# tests. These tests take up a significant amount of the total test time
# but are not needed unless you plan to talk to SVN repos.
@@ -1200,9 +1197,6 @@ ifdef FREAD_READS_DIRECTORIES
COMPAT_CFLAGS += -DFREAD_READS_DIRECTORIES
COMPAT_OBJS += compat/fopen.o
endif
-ifdef NO_SYMLINK_HEAD
- BASIC_CFLAGS += -DNO_SYMLINK_HEAD
-endif
ifdef GETTEXT_POISON
BASIC_CFLAGS += -DGETTEXT_POISON
endif
diff --git a/config.mak.uname b/config.mak.uname
index f34dcaa..9b77e2c 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -169,7 +169,6 @@ ifeq ($(uname_O),Cygwin)
NO_STRCASESTR = YesPlease
NO_MEMMEM = YesPlease
NO_MKSTEMPS = YesPlease
- NO_SYMLINK_HEAD = YesPlease
NO_IPV6 = YesPlease
OLD_ICONV = UnfortunatelyYes
# There are conflicting reports about this.
@@ -338,7 +337,6 @@ ifeq ($(uname_S),Windows)
NEEDS_CRYPTO_WITH_SSL = YesPlease
NO_LIBGEN_H = YesPlease
NO_POLL = YesPlease
- NO_SYMLINK_HEAD = YesPlease
NO_IPV6 = YesPlease
NO_UNIX_SOCKETS = YesPlease
NO_SETENV = YesPlease
@@ -491,7 +489,6 @@ ifneq (,$(findstring MINGW,$(uname_S)))
NEEDS_CRYPTO_WITH_SSL = YesPlease
NO_LIBGEN_H = YesPlease
NO_POLL = YesPlease
- NO_SYMLINK_HEAD = YesPlease
NO_UNIX_SOCKETS = YesPlease
NO_SETENV = YesPlease
NO_STRCASESTR = YesPlease
diff --git a/configure.ac b/configure.ac
index 89e2590..cad5418 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1096,9 +1096,6 @@ GIT_CONF_SUBST([HAVE_BSD_SYSCTL])
# Define USE_PIC if you need the main git objects to be built with -fPIC
# in order to build and link perl/Git.so. x86-64 seems to need this.
#
-# 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 NO_PTHREADS if we do not have pthreads.
#
# Define PTHREAD_LIBS to the linker flag used for Pthread support.
next prev parent reply other threads:[~2015-12-29 6:04 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-20 7:26 [PATCH 0/4] improve symbolic-ref robustness Jeff King
2015-12-20 7:27 ` [PATCH 1/4] symbolic-ref: propagate error code from create_symref() Jeff King
2015-12-20 7:27 ` [PATCH 2/4] t1401: test reflog creation for git-symbolic-ref Jeff King
2015-12-20 7:29 ` [PATCH 3/4] create_symref: modernize variable names Jeff King
2015-12-28 8:20 ` Michael Haggerty
2015-12-29 5:02 ` Jeff King
2015-12-20 7:34 ` [PATCH 4/4] create_symref: use existing ref-lock code Jeff King
2015-12-21 20:50 ` Junio C Hamano
2015-12-22 0:58 ` Jeff King
2015-12-28 9:45 ` Michael Haggerty
2015-12-29 5:02 ` Jeff King
2015-12-29 5:41 ` Jeff King
2015-12-29 5:55 ` [PATCH v2 0/3] improve symbolic-ref robustness Jeff King
2015-12-29 5:56 ` [PATCH 1/3] create_symref: modernize variable names Jeff King
2015-12-29 5:57 ` [PATCH 2/3] create_symref: use existing ref-lock code Jeff King
2015-12-29 5:57 ` [PATCH 3/3] create_symref: write reflog while holding lock Jeff King
2015-12-29 6:00 ` [RFC/PATCH 4/3] create_symref: drop support for writing symbolic links Jeff King
2015-12-29 6:03 ` Jeff King [this message]
2015-12-29 18:32 ` Junio C Hamano
2015-12-30 6:53 ` Jeff King
2015-12-30 6:56 ` Jeff King
2015-12-29 8:25 ` [PATCH v2 0/3] improve symbolic-ref robustness Michael Haggerty
2015-12-29 18:35 ` Junio C Hamano
2015-12-29 21:24 ` Junio C Hamano
2015-12-30 6:57 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151229060358.GB12848@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=mhagger@alum.mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).