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

Re: [PATCH] wt-status: expand, not dwim, a "detached from" ref

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 27, 2020, 02:10 UTC
Message-ID
<xmqqtuwosusc.fsf@gitster.c.googlers.com>
In-Reply-To
<20200827014723.GA750502@google.com>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 18 quoted lines
> Given the context above, two possibilities seem appealing:
>
>  A. Like you're hinting, could dwim_ref get a variant that returns -1
>     instead of die()ing on failure?  That way, we could fulfill the
>     intent described in b397ea48:
>
> 	When it cannot figure out the original ref, it shows an abbreviated
> 	SHA-1.
>
>  B. Alternatively, in the @{u} case could we switch together the <old>
>     and <new> pieces of the context from the
>
> 	checkout: moving from master to @{upstream}
>
>     reflog line to make "master@{upstream}"?  It's still possible for
>     the upstream to have changed since then, but at least in the
>     common case this would match the lookup that happened at checkout
>     time.
Ah, blast from the past.  Thanks for resurrecting.

If we are allowed to change what goes to reflog, can we do even better than recording master@{upstream} at the time "checkout" records the HEAD movement? "checkout: moving from next to master" would be far better than "moving from next to next@{upstream}" or "moving from next to @{upstream}".

Can we even change the phrasing altogether, like "checkout: moving from next to detached e9b77c..."? That would produce even more precise report.

Previous: Jonathan NiederNext: Jonathan Tan
Message 6 of 17 in “wt-status: expand, not dwim, a "detached from" ref”
  1. wt-status: expand, not dwim, a "detached from" refJonathan Tan, May 13, 2020
  2. Junio C HamanoMay 13, 2020
  3. Junio C HamanoMay 13, 2020
  4. Jonathan TanMay 18, 2020
  5. Jonathan NiederAug 27, 2020
  6. Junio C HamanoAug 27, 2020
  7. 0/2 Fix for git checkout @{u} (non-local) then git statusJonathan Tan, Aug 29, 2020
  8. 1/2 sha1-name: replace unsigned int with option structJonathan Tan, Aug 29, 2020
  9. Junio C HamanoAug 29, 2020
  10. 2/2 wt-status: tolerate dangling marksJonathan Tan, Aug 29, 2020
  11. Junio C HamanoAug 29, 2020
  12. Jonathan TanAug 31, 2020
  13. Junio C HamanoAug 31, 2020
  14. 0/3 Fix for git checkout @{u} (non-local) then git statusJonathan Tan, Sep 1, 2020
  15. 1/3 sha1-name: replace unsigned int with option structJonathan Tan, Sep 1, 2020
  16. 2/3 refs: move dwim_ref() to header fileJonathan Tan, Sep 1, 2020
  17. 3/3 wt-status: tolerate dangling marksJonathan Tan, Sep 1, 2020

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.