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

Re: [RFC PATCH 0/5] Pretty formats for reflog data

From
Jeff King <peff@peff.net>
Date
Oct 12, 2009, 21:37 UTC
Message-ID
<20091012213756.GA12166@coredump.intra.peff.net>
In-Reply-To
<cover.1255380039.git.trast@student.ethz.ch>
On Mon, Oct 12, 2009 at 11:02:29PM +0200, Thomas Rast wrote:
Show 7 quoted lines
> > Stash listing is internally just "git log -g refs/stash", so you can
> > pass any formatting or limiting arguments you want there (see the git
> > log documentation for ideas). If no arguments are given, we pass "-10".
> 
> This seems fairly arbitrary, doesn't it?  My own working theory is
> that Nanako put it in because the git-log|sed construct inherently
> bars any way to a pager, so it needs to be cut short.

Yes, it's arbitrary, though it is probably a reasonable estimate for the intended use of stash. It's a stack, so you generally are only interested in the last couple of entries.

What's much worse though is that the logic is not "if you told me how many to show, show that; otherwise, show 10". Instead it is "if you gave me no options, default the size of the list. But if you gave me any options, even if they have nothing whatsoever to do with limiting the size of the list, then show all".

So something like "git stash list --date=relative" suddenly shows many more stashes than just "git stash list". It would be nice to fix that.

> So suppose we could somehow get rid of the |sed... like if we had
> --pretty specifiers for the reflog information.

I'm not sure if people will like having a longer list in a pager than a shorter list without one (I personally can't remember ever using "git stash list", so I have no strong opinion).

But certainly the idea of adding pretty format specifiers to access reflog data seems like a good idea on its own.

-Peff
Previous: Jeff KingNext: Thomas Rast
Message 13 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.