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
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Apr 12, 2017, 12:18 UTC
Message-ID
<CACBZZX4W1kk2cnncWz1EVjA-WtFryYzNoiiDHR9+9VC4AKJhKg@mail.gmail.com>
In-Reply-To
<5704E476-BD11-47D1-A15E-C1E29A1398AD@grubix.eu>
On Wed, Apr 12, 2017 at 7:43 AM, Michael J Gruber <git@grubix.eu> wrote:
Show 29 quoted lines
> 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. Saying "diverged" just makes it clearer, how does it reduce the information we give?

> 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?

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.

Previous: Michael J GruberNext: Michael J Gruber
Message 8 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.