Subject: [PATCH v2 0/5] Pretty formats for reflog data

From: Thomas Rast <[email-masked]>
Date: Fri, 16 Oct 2009 00:41:43 +0200

Jeff King wrote:
> Maybe a better solution would be a "short name" variant for pretty
> format specifiers. We already have %(refname) and %(refname:short) [...]
> The tricky part would be deciding on a syntax. This seems to come up a
> fair bit.

Ok, I settled for %g[dDs] for now to save on letters.  I'm saving the
syntax question for a later series while we discuss this one ;-)

I think going for %(...) wouldn't be too bad since we already have
that in for-each-ref, and it can be backwards compatible.  So we would
have different sets of short and long specifiers, e.g.

  %ae = %(authoremail)
  %aE = %(authoremail:mailmap)

We can then pass arguments via some yet-to-be decided syntax, say,
%(body:indent(10)).

Other changes in this version include:

* I followed your struct suggestion, which is the new 1/5.

* Since the shortening can be handled by %gd, the old 5/5 (change from
  refs/stash to only stash) is no longer needed.

* I fixed the warning that Junio found (and finally found the right
  combination of -W flags, though I cannot compile with -Werror myself
  because of *other* warnings...)

I also added tests and docs to the main patch (now 3/5).

Thomas Rast (5):
  Refactor pretty_print_commit arguments into a struct
  reflog-walk: refactor the branch@{num} formatting
  Introduce new pretty formats %g[sdD] for reflog information
  stash list: use new %g formats instead of sed
  stash list: drop the default limit of 10 stashes

 Documentation/pretty-formats.txt |    3 +
 builtin-branch.c                 |    3 +-
 builtin-checkout.c               |    3 +-
 builtin-log.c                    |    3 +-
 builtin-merge.c                  |    7 ++-
 builtin-rev-list.c               |    7 ++-
 builtin-shortlog.c               |    9 +++-
 builtin-show-branch.c            |    4 +-
 commit.h                         |   20 ++++++---
 git-stash.sh                     |    8 +---
 log-tree.c                       |   21 +++++----
 pretty.c                         |   44 ++++++++++++++------
 reflog-walk.c                    |   85 ++++++++++++++++++++++++++++----------
 reflog-walk.h                    |    8 ++++
 t/t1411-reflog-show.sh           |   12 +++++
 15 files changed, 166 insertions(+), 71 deletions(-)