git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: `git status` output is very misleading after a merge on a "detached HEAD"

From
Philip Oakley <philipoakley@iee.org>
Date
Apr 14, 2017, 16:25 UTC
Message-ID
<D20C812A0278459095443B62002359A7@PhilipOakley>
In-Reply-To
<61ef36d9-7f25-80d6-5216-554684bd54dd@grubix.eu>
- a bit late in providing a comment..
From: "Michael J Gruber" <git@grubix.eu>
Show 59 quoted lines
> Ævar Arnfjörð Bjarmason venit, vidit, dixit 12.04.2017 14:18:
>> On Wed, Apr 12, 2017 at 7:43 AM, Michael J Gruber <git@grubix.eu> wrote:
>>> Am 11. April 2017 22:40:14 MESZ schrieb "Ævar Arnfjörð Bjarmason"
>>> <avarab@gmail.com>:
>>>> On Tue, Apr 11, 2017 at 5:13 PM, Enis Bayramoğlu
>>>>> HEAD detached from origin/master 1 commit ago,
>>>>
>>>> In lieu of that, which would need some of the rev-list machinery to be
>>>> invoked on every git-status, I wonder if just saying "HEAD detached &
>>>> diverged from origin/master" wouldn't be clearer:
>>>>
>>>> diff --git a/wt-status.c b/wt-status.c
>>>> index 308cf3779e..79c8cfd1cf 100644
>>>> --- a/wt-status.c
>>>> +++ b/wt-status.c
>>>> @@ -1542,7 +1542,7 @@ static void wt_longstatus_print(struct wt_status
>>>> *s)
>>>>                                if (state.detached_at)
>>>>                                      on_what = _("HEAD detached at ");
>>>>                                else
>>>> -                                       on_what = _("HEAD detached from
>>>> ");
>>>> +                                       on_what = _("HEAD detached &
>>>> diverged from ");
>>>>                        } else {
>>>>                                branch_name = "";
>>>>                           on_what = _("Not currently on any branch.");
>>>>
>>>>
>>>>
>>>
>>> No way. That would reduce the information that we give.
>>
>> How does it reduce the information we give? Maybe I've missed
>> something about what "from" means here, as opposed to "at", but it
>> seems to me to mean the same thing as "diverged" by definition, i.e.
>> we detached from the branch but we diverged from it.
>
> No, "at" means we're still at that commit - detached but not diverged.
> "from" means we only started from that commit, but are not at it any more.
>
>> Saying "diverged"
>> just makes it clearer, how does it reduce the information we give?
>
> I misread your patch on my mobile phone, sorry. I thought you meant to
> replace both "at" and "from" by "diverged from" because you considered
> them synonymous.
>
> But your patch touches just the" from" case and emphasizes the "diverge"
> aspect, which is fine, of course.
>
>>> Note that the difference between from and at is also: are there commits
>>> that we could lose when we switch away, that is: that git checkout would
>>> warn us about?
>>
>> Right, but I don't see how that's in any way conflicting or mutually
>> exclusive with saying before hand that we've diverged from the branch.
>>
>>> Maybe improve the doc instead?

I think that the doc should highlight the subtelty implied by the at/from distinction. Especially as users may reasonably think that they are detached from a branch, and not see the distinction.

Show 12 quoted lines
>>
>> Aside from whether my patch makes any sense, the solution to a UX
>> issue really can't be "oh this just needs to be documented". For every
>> user who's confused by some interface we provide a *tiny* minority of
>> them go and exhaustively read the docs for an explanation, will just
>> remain confused.
>>
>> I think saying from v.s. at is way too subtle, I for one have been
>> missing it for years until this thread, that's bad UX, git's also used
>> by a lot of non-native English speakers who may not at all get the
>> subtle difference between at and from in this context, or if they do
>> think the UI is using that subtlety to tell them something.

As a native UK English speaker (living in Scotland), I focus on the verb 'detached' rather than the at/from distinction. There are many local dialects and variants so that is only who are taught English as she is wrote who tend to notice the fine distinctions. (There are many fine Scottish words which are outwith RP English).

At least if the man page indicated the distinction folks would notice sooner - they rarely get to see the distinction side by side in the terminal window.

Show 11 quoted lines
>
> Well, we have to find the right balance between clarity and brevity - an
> interface that is too chatty is a nightmare. That's why I suggested both
> doc changes and additional information.
>
> What do you think about the ahead/behind info as suggested? That should
> be more informative both qualitatively (something diverged) and
> quantitatively (by how much).
>
> Michael
>

-- Philip

Previous: Ævar Arnfjörð Bjarmason
Message 11 of 11 in “`git status` output is very misleading after a merge on a "detached HEAD"”
  1. Enis BayramoğluApr 11, 2017
  2. Michael J GruberApr 11, 2017
  3. Enis BayramoğluApr 11, 2017
  4. Ævar Arnfjörð BjarmasonApr 11, 2017
  5. Michael J GruberApr 12, 2017
  6. Enis BayramoğluApr 12, 2017
  7. Michael J GruberApr 12, 2017
  8. Ævar Arnfjörð BjarmasonApr 12, 2017
  9. Michael J GruberApr 12, 2017
  10. Ævar Arnfjörð BjarmasonApr 12, 2017
  11. Philip OakleyApr 14, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.