Thread (40 messages) flat view 40 messages, 7 authors, 2016-06-15

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

From: Jeff King <hidden>
Date: 2016-06-15 22:47:32

On Mon, Oct 12, 2009 at 11:02:29PM +0200, Thomas Rast wrote:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help