From: Neil Macneale <mac4-git@theory.org>
To: git@vger.kernel.org
Subject: [PATCH] Support ref logs for refs/*
Date: Thu, 8 Jan 2009 00:28:27 -0800 [thread overview]
Message-ID: <20090108082827.GA6177@tesla.theory.org> (raw)
The documentation for git update-ref seems to imply that logging of ref
updates should be done for anything in refs/, though the code looks like it
restricts changes to heads and remotes. Any reason not so support arbitrary
refs?
I don't see much point in logging for tags, so the patch ignores refs/tags.
Thanks,
Neil
Signed-off-by: Neil Macneale <mac4-git@theory.org>
---
refs.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/refs.c b/refs.c
index 33ced65..cfff22b 100644
--- a/refs.c
+++ b/refs.c
@@ -1154,9 +1154,9 @@ static int log_ref_write(const char *ref_name, const
unsigned char *old_sha1,
git_snpath(log_file, sizeof(log_file), "logs/%s", ref_name);
if (log_all_ref_updates &&
- (!prefixcmp(ref_name, "refs/heads/") ||
- !prefixcmp(ref_name, "refs/remotes/") ||
- !strcmp(ref_name, "HEAD"))) {
+ (!prefixcmp(ref_name, "refs/") ||
+ !strcmp(ref_name, "HEAD")) &&
+ prefixcmp(ref_name, "refs/tags/")) {
if (safe_create_leading_directories(log_file) < 0)
return error("unable to create directory for %s",
log_file);
--
1.6.1.141.gfe98e.dirty
next reply other threads:[~2009-01-08 8:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-08 8:28 Neil Macneale [this message]
2009-01-08 9:08 ` [PATCH] Support ref logs for refs/* Nanako Shiraishi
2009-01-08 16:52 ` mac4-git
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=20090108082827.GA6177@tesla.theory.org \
--to=mac4-git@theory.org \
--cc=git@vger.kernel.org \
/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).