All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Sixt <j.sixt@viscovery.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jeff King <peff@peff.net>, Git Mailing List <git@vger.kernel.org>
Subject: Re: git-push: forced update of tag shows unabbreviated SHA1
Date: Thu, 31 Jan 2008 11:01:35 +0100	[thread overview]
Message-ID: <47A19C7F.1060204@viscovery.net> (raw)
In-Reply-To: <7vsl0ecp3i.fsf@gitster.siamese.dyndns.org>

Junio C Hamano schrieb:
> Johannes Sixt <j.sixt@viscovery.net> writes:
> 
>> This is just a cosmetical flaw:
>> ...
>> To file:///home/jsixt/tmp/foo/B/../A
>>  + 639669ce44f84417f30842c622064827dda01461...475e55f T -> T (forced update)
>>
>> Notice that the original SHA1 is not abbreviated.
> 
> I suspect that is because you do not _have_ the original object,
> so there is no uniquely usable abbreviation to name the object
> in your repository.

Yes, you are right. This also happens for a commit.

> This obviously is not tested at all (not even compile tested),
> but I think it would show you what is going on.
> 
> ---
>  builtin-send-pack.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/builtin-send-pack.c b/builtin-send-pack.c
> index 8afb1d0..9c558ee 100644
> --- a/builtin-send-pack.c
> +++ b/builtin-send-pack.c
> @@ -265,7 +265,7 @@ static const char *status_abbrev(unsigned char sha1[20])
>  {
>  	const char *abbrev;
>  	abbrev = find_unique_abbrev(sha1, DEFAULT_ABBREV);
> -	return abbrev ? abbrev : sha1_to_hex(sha1);
> +	return abbrev ? abbrev : "<you do not have it>";
>  }

No, that would be information hiding. I prefer an unabbreviated name.
Nevertheless, if we know the name, we could be able to find a suitable
abbreviation. But it's really not *that* important...

-- Hannes

  reply	other threads:[~2008-01-31 10:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-31  9:27 git-push: forced update of tag shows unabbreviated SHA1 Johannes Sixt
2008-01-31  9:37 ` Junio C Hamano
2008-01-31 10:01   ` Johannes Sixt [this message]
2008-01-31 10:06 ` Jeff King
2008-01-31 10:21   ` Junio C Hamano
2008-01-31 10:39     ` Jeff King
2008-01-31 10:27   ` Jeff King
2008-01-31 10:38     ` Junio C Hamano
2008-01-31 10:41       ` 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47A19C7F.1060204@viscovery.net \
    --to=j.sixt@viscovery.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.