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

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

From
Thomas Rast <trast@student.ethz.ch>
Date
Oct 12, 2009, 21:06 UTC
Message-ID
<cover.1255380039.git.trast@student.ethz.ch>
In-Reply-To
<20091012175201.GA10263@coredump.intra.peff.net>
[I forgot to address the list on the first batch, sorry for the spam.]
Jeff King wrote:
Show 9 quoted lines
> On Mon, Oct 12, 2009 at 05:47:34PM +0200, Jef Driesen wrote:
> 
> > Is it possible to make "git stash list" show more than 10 items?
> 
> Try "git stash list -30".
> 
> 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.

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

Sadly
  git log -g --format="%h %g: %G"

still fails to exactly replicate the reflog format: if the reflog was cut off during garbage collection, the last entry refers to a no longer existing commit causing a stray ':' on that line. Oh, well.

It's also still RFC because:
* I don't like the massive code churn in 2/5, maybe someone sees a
  better option.
* 5/5 has a pretty lame excuse.  I could also just change it in 'git
  stash list' to limit the backwards-incompatibility damage, but
  that's also a maintenance headache.
Thomas Rast (5):
  reflog-walk: refactor the branch@{num} formatting
  Introduce new pretty formats %g and %G for reflog information
  stash: Use new %g/%G formats instead of sed
  stash list: drop the default limit of 10 stashes
  stash: change built-in ref to 'stash' instead of 'refs/stash'
 archive.c             |    2 +-
 builtin-branch.c      |    3 +-
 builtin-checkout.c    |    2 +-
 builtin-commit.c      |    4 +-
 builtin-log.c         |    2 +-
 builtin-merge.c       |    2 +-
 builtin-rev-list.c    |    2 +-
 builtin-shortlog.c    |    2 +-
 builtin-show-branch.c |    2 +-
 commit.h              |    7 +++-
 git-stash.sh          |   10 +-----
 log-tree.c            |    4 +-
 pretty.c              |   20 +++++++++++--
 reflog-walk.c         |   72 ++++++++++++++++++++++++++++++++++---------------
 reflog-walk.h         |    7 +++++
 15 files changed, 94 insertions(+), 47 deletions(-)
Next: Thomas Rast
Message 1 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.