From: Junio C Hamano <gitster@pobox.com>
To: Nanako Shiraishi <nanako3@bluebottle.com>
Cc: "Stephen Cuppett" <cuppett@gmail.com>,
Git mailing list <git@vger.kernel.org>
Subject: Re: [RFC] Change handling of RelNotes
Date: Fri, 31 Aug 2007 00:09:18 -0700 [thread overview]
Message-ID: <7vveaw2na9.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <200708310645.l7V6jKJk009287@mi0.bluebottle.com> (Nanako Shiraishi's message of "Fri, 31 Aug 2007 15:44:58 +0900")
Nanako Shiraishi <nanako3@bluebottle.com> writes:
> I sometimes have a checkout on a filesystem that does not support
> symbolic links, but I set core.symlink configuration variable to false
> in such a case. Would it make sense to update "git init" to autodetect
> lack of symbolic link support in the filesystem?
Hmph. Something along this line, perhaps?
builtin-init-db.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/builtin-init-db.c b/builtin-init-db.c
index af15cb2..c411008 100644
--- a/builtin-init-db.c
+++ b/builtin-init-db.c
@@ -264,6 +264,22 @@ static int create_default_files(const char *git_dir, const char *template_path)
if (work_tree != git_work_tree_cfg)
git_config_set("core.worktree", work_tree);
}
+
+ /* Check if symlink is supported in the work tree */
+ if (!reinit) {
+ path[len] = 0;
+ strcpy(path + len, "tXXXXXX");
+
+ if (!close(xmkstemp(path)) &&
+ !unlink(path) &&
+ !symlink("testing", path) &&
+ !lstat(path, &st1) &&
+ S_ISLNK(st1.st_mode))
+ ; /* good */
+ else
+ git_config_set("core.symlinks", "false");
+ }
+
return reinit;
}
next prev parent reply other threads:[~2007-08-31 7:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-31 1:35 [RFC] Change handling of RelNotes Stephen Cuppett
2007-08-31 1:39 ` Petr Baudis
2007-08-31 6:04 ` Junio C Hamano
2007-08-31 2:21 ` Junio C Hamano
2007-08-31 6:08 ` Marius Storm-Olsen
2007-08-31 6:44 ` Nanako Shiraishi
2007-08-31 7:09 ` Junio C Hamano [this message]
2007-08-31 7:22 ` [PATCH] autodetect core.symlinks in git-init Junio C Hamano
2007-08-31 8:00 ` Nanako Shiraishi
2007-08-31 8:23 ` Marius Storm-Olsen
[not found] ` <316a20a40708310539w1d20c391w8566a042c7a8679a@mail.gmail.com>
2007-08-31 12:52 ` [RFC] Change handling of RelNotes Stephen Cuppett
2007-08-31 20:25 ` Junio C Hamano
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vveaw2na9.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=cuppett@gmail.com \
--cc=git@vger.kernel.org \
--cc=nanako3@bluebottle.com \
/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.
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 NNTP newsgroup(s).