From: Pieter de Bie <pdebie@ai.rug.nl>
To: Junio C Hamano <gitster@pobox.com>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Git Mailinglist <git@vger.kernel.org>
Cc: Pieter de Bie <pdebie@ai.rug.nl>
Subject: [PATCH] builtin-reflog: Allow reflog expire to name partial ref
Date: Sun, 10 Aug 2008 22:22:21 +0200 [thread overview]
Message-ID: <1218399741-37049-1-git-send-email-pdebie@ai.rug.nl> (raw)
In-Reply-To: <9746FE5D-816C-4818-B32F-EE0028918F72@ai.rug.nl>
This allows you to specify 'git reflog expire master' without needing
to give the full refname like 'git reflog expire refs/heads/master'
Signed-off-by: Pieter de Bie <pdebie@ai.rug.nl>
---
builtin-reflog.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/builtin-reflog.c b/builtin-reflog.c
index 5af3f28..f4d1f32 100644
--- a/builtin-reflog.c
+++ b/builtin-reflog.c
@@ -540,11 +540,11 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
free(collected.e);
}
- while (i < argc) {
- const char *ref = argv[i++];
+ for (; i < argc; i++) {
+ char *ref;
unsigned char sha1[20];
- if (!resolve_ref(ref, sha1, 1, NULL)) {
- status |= error("%s points nowhere!", ref);
+ if (!dwim_log(argv[i], strlen(argv[i]), sha1, &ref)) {
+ status |= error("%s points nowhere!", argv[i]);
continue;
}
set_reflog_expiry_param(&cb, explicit_expiry, ref);
--
1.6.0.rc0.320.g49281
prev parent reply other threads:[~2008-08-10 20:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-09 23:33 [PATCH 1/2] reflog test: add more tests for 'reflog delete' Pieter de Bie
2008-08-09 23:33 ` [PATCH 2/2] builtin-reflog: fix deletion of HEAD entries Pieter de Bie
2008-08-10 0:44 ` Junio C Hamano
2008-08-10 1:01 ` Junio C Hamano
2008-08-10 9:35 ` Pieter de Bie
2008-08-10 11:12 ` Johannes Sixt
2008-08-10 18:52 ` Junio C Hamano
2008-08-10 19:04 ` Pieter de Bie
2008-08-10 20:22 ` Pieter de Bie [this message]
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=1218399741-37049-1-git-send-email-pdebie@ai.rug.nl \
--to=pdebie@ai.rug.nl \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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).