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

Re: [RFC PATCH 5/5] stash: change built-in ref to 'stash' instead of 'refs/stash'

From
Jeff King <peff@peff.net>
Date
Oct 14, 2009, 05:06 UTC
Message-ID
<20091014050645.GD31810@coredump.intra.peff.net>
In-Reply-To
<548bc3a41c03a049e782d5d04a34c3b26c0897d2.1255380039.git.trast@student.ethz.ch>
On Mon, Oct 12, 2009 at 11:06:07PM +0200, Thomas Rast wrote:
Show 8 quoted lines
> 'git stash list' now always shows 'refs/stash@{...}' instead of
> 'stash@{...}', because that's what we specify for the ref.
> 
> Since git checks .git/$ref, .git/refs/$ref and only then
> .git/refs/{branches,tags,remotes}, we can drop the prefix.  This only
> affects people who have .git/stash, who were never able to refer to
> their stashes by stash@{...}.  (Sadly, now they won't be able to use
> git-stash anymore at all.)

Maybe a better solution would be a "short name" variant for pretty format specifiers. We already have %(refname) and %(refname:short) in for-each-ref, where the latter cuts off "refs/heads/", "refs/tags", or "refs/remotes/" from the beginning. I'm not sure if it does just "refs/", but probably it should. It may even check for ambiguity, but I'd have to double-check the code.

The tricky part would be deciding on a syntax. This seems to come up a fair bit. I think there is room for somebody to suggest a more expansive --format syntax that can handle arbitrary arguments being given to expansions (I think there was some discussion recently in a related thread about body indentation, but I haven't been following it too closely).

-Peff
Previous: Thomas RastNext: Jeff King
Message 12 of 14 in “Pretty formats for reflog data”
  1. 0/5 Pretty formats for reflog dataThomas Rast, Oct 12, 2009
  2. 1/5 reflog-walk: refactor the branch@{num} formattingThomas Rast, Oct 12, 2009
  3. 2/5 Introduce new pretty formats %g and %G for reflog informationThomas Rast, Oct 12, 2009
  4. Jeff KingOct 14, 2009
  5. Thomas RastOct 14, 2009
  6. Junio C HamanoOct 14, 2009
  7. 3/5 stash: Use new %g/%G formats instead of sedThomas Rast, Oct 12, 2009
  8. Jeff KingOct 14, 2009
  9. 4/5 stash list: drop the default limit of 10 stashesThomas Rast, Oct 12, 2009
  10. Jeff KingOct 14, 2009
  11. 5/5 stash: change built-in ref to 'stash' instead of 'refs/stash'Thomas Rast, Oct 12, 2009
  12. Jeff KingOct 14, 2009
  13. Jeff KingOct 12, 2009
  14. Thomas RastOct 12, 2009

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.