All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>,
	Stefan Beller <sbeller@google.com>
Cc: Jacob Keller <jacob.keller@gmail.com>, git <git@vger.kernel.org>
Subject: Re: [BUG?] HEAD detached at HEAD
Date: Mon, 21 Sep 2015 09:39:39 +0200	[thread overview]
Message-ID: <55FFB43B.5080002@drmicha.warpmail.net> (raw)
In-Reply-To: <55FFB267.3040106@drmicha.warpmail.net>

... in addition to my previous reply, looking at more context:

>> --- a/wt-status.c
>> +++ b/wt-status.c
>> @@ -1319,6 +1319,13 @@ static int grab_1st_switch(unsigned char *osha1, unsigned char *nsha1,
>>         hashcpy(cb->nsha1, nsha1);
>>         for (end = target; *end && *end != '\n'; end++)
>>                 ;
>> +       if (!memcmp(target, "HEAD", end - target)) {
>> +               /* Don't say "HEAD detached at HEAD" */
>> +               unsigned char head[GIT_SHA1_RAWSZ];
>> +               get_sha1("HEAD", head);
>> +               strbuf_addstr(&cb->buf, find_unique_abbrev(head, DEFAULT_ABBREV));
>> +               return 1;
>> +       }
>>         strbuf_add(&cb->buf, target, end - target);
>>         return 1;
>>  }
>>
>> What do you think?

I think we should return (the hex repr. of) nsha1 instead of resolving
HEAD at its current state. That should solve the present problem (and
leave the more difficult reflog issue for the future).

Michael

  reply	other threads:[~2015-09-21  7:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-18 16:59 [BUG?] HEAD detached at HEAD Matthieu Moy
2015-09-18 17:08 ` Jacob Keller
2015-09-18 17:23   ` Matthieu Moy
2015-09-18 17:32     ` Stefan Beller
2015-09-18 19:09       ` Matthieu Moy
2015-09-21  7:31         ` Michael J Gruber
2015-09-21  7:39           ` Michael J Gruber [this message]
2015-09-21  7:42             ` Matthieu Moy
2015-09-21 17:20         ` 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=55FFB43B.5080002@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=jacob.keller@gmail.com \
    --cc=sbeller@google.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 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.