git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Engestrom <eric@engestrom.ch>
To: git@vger.kernel.org
Cc: Eric Engestrom <eric@engestrom.ch>
Subject: [PATCH] fetch: show reference pointed by new tags
Date: Sun,  6 Mar 2016 22:34:54 +0000	[thread overview]
Message-ID: <1457303694-16153-1-git-send-email-eric@engestrom.ch> (raw)

Before, new tags had their names shown twice:
 * [new tag]         v4.5-rc6   -> v4.5-rc6

Instead, show the hash of the commit pointed to:
 * [new tag]         v4.5-rc6   -> fc77dbd

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
---

This is my first dive into git's code, so it's likely I'm not doing things
right. The first candidate for that is the literal `7`, which should probably
be a variable, but I couldn't find what I should use instead.

I'd be happy to fix this for a v2 :]

Cheers,
  Eric


 builtin/fetch.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/builtin/fetch.c b/builtin/fetch.c
index e4639d8..93b2145 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -515,6 +515,7 @@ static int update_local_ref(struct ref *ref,
 		if (starts_with(name, "refs/tags/")) {
 			msg = "storing tag";
 			what = _("[new tag]");
+			pretty_ref = find_unique_abbrev(ref->new_oid.hash, 7);
 		} else if (starts_with(name, "refs/heads/")) {
 			msg = "storing head";
 			what = _("[new branch]");
-- 
2.7.2

             reply	other threads:[~2016-03-06 22:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-06 22:34 Eric Engestrom [this message]
2016-03-07  0:18 ` [PATCH] fetch: show reference pointed by new tags Junio C Hamano
2016-03-07  1:05   ` Junio C Hamano
2016-03-08  4:28     ` Junio C Hamano
2016-03-13 15:38       ` Eric Engestrom

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=1457303694-16153-1-git-send-email-eric@engestrom.ch \
    --to=eric@engestrom.ch \
    --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).