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

[PATCH v2 0/2] Fix for git checkout @{u} (non-local) then git status

From
JTJonathan Tan <jonathantanmy@google.com>
Date
Aug 29, 2020, 01:02 UTC
Message-ID
<cover.1598662525.git.jonathantanmy@google.com>
In-Reply-To
<20200513004058.34456-1-jonathantanmy@google.com>
As Jonathan Nieder wrote [1]:
Show 6 quoted lines
>  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.

Here are some patches that do this. As discussed, this is not the complete solution, but at least now we can handle unresolvable marks.

I've also switched the commit messages and test from mentioning "git branch" to mentioning "git status".

[1] https://lore.kernel.org/git/20200827014723.GA750502@google.com/
Jonathan Tan (2):
  sha1-name: replace unsigned int with option struct
  wt-status: tolerate dangling marks
 cache.h           | 27 +++++++++++++++++++--------
 refs.c            | 17 +++++++++++------
 refs.h            |  3 ++-
 revision.c        |  3 ++-
 sha1-name.c       | 45 +++++++++++++++++++++++++++++----------------
 t/t7508-status.sh | 12 ++++++++++++
 wt-status.c       |  2 +-
 7 files changed, 76 insertions(+), 33 deletions(-)
-- 
2.28.0.402.g5ffc5be6b7-goog
Previous: Junio C HamanoNext: Jonathan Tan
Message 7 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.