git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Deskin Miller <deskinm@umich.edu>
To: git@vger.kernel.org
Cc: trast@student.ethz.ch, Deskin Miller <deskinm@umich.edu>
Subject: [RFC PATCH 0/4] git log -g --pretty=format: learns about reflog
Date: Wed, 25 Feb 2009 23:44:03 -0500	[thread overview]
Message-ID: <cover.1235622145.git.deskinm@umich.edu> (raw)

This series exposes reflog information to the pretty-printer when using
--pretty=format: to git log -g and git rev-list --walk-reflogs, through
similar format codes as are used currently.

Thomas Rast mentioned almost as an aside that this would be useful in 

http://article.gmane.org/gmane.comp.version-control.git/108009

and I've wanted to hack this series for a long time, even before that
comment, but my first attempts broke stash horribly.  Hopefully this
version fares better.

I'm a little leery of using commit->util to carry the reflog info, but I
didn't see a much better way, without altering the signature of
pretty_print_commit to take an optional reflog parameter.  The code
checks that util is not being used before assigning the reflog to it, so
it shouldn't break any existing uses of util of which I am unaware.  I
confess to having not done an appropriate amount of research into
whether my use of util will actually break anything.  For what it's
worth this patch series doesn't break any existing tests.

One of the things I was hoping to do in the unsuccessful version was to
allow the revision walker to use the reflog, but let the commit
structures retain their real parents.  That way, one could still obtain
meaningful information from %p even when walking reflogs, which would be
distinct from %rp.  It is primarily with this in mind that %rp exists at
all.  However, as I mentioned, my attempt to change the revision walker
broke existing tests, and I didn't have the wherewithal to discover how
to correct it.  It's possible with the current series that one could
simply try to re-parse the commit, but I haven't investigated the
feasibility of doing that.

I strongly suspect that there's a cleaner way to do this, but don't
really know what that would be, so any comments regarding alternate
approaches would be very appreciated.  Also, I'm more than happy to
write testcases and documentation once there is some agreement about
what the preferred implementation is.

Deskin Miller (4):
  Expose reflog_info struct in header
  Add attach_reflog_info
  Attach reflog to commit prior to pretty-printing
  Teach pretty-printer new reflog format codes

 list-objects.c |    3 +++
 log-tree.c     |    3 +++
 pretty.c       |   38 ++++++++++++++++++++++++++++++++++++++
 reflog-walk.c  |   26 +++++++++++++++++++-------
 reflog-walk.h  |   12 ++++++++++++
 5 files changed, 75 insertions(+), 7 deletions(-)

             reply	other threads:[~2009-02-26  4:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-26  4:44 Deskin Miller [this message]
2009-02-26  4:44 ` [RFC PATCH 1/4] Expose reflog_info struct in header Deskin Miller
2009-02-26  4:44 ` [RFC PATCH 2/4] Add attach_reflog_info Deskin Miller
2009-02-26  4:44 ` [RFC PATCH 3/4] Attach reflog to commit prior to pretty-printing Deskin Miller
2009-02-26  4:44 ` [RFC PATCH 4/4] Teach pretty-printer new reflog format codes Deskin Miller
2009-02-26 10:30 ` [RFC PATCH 0/4] git log -g --pretty=format: learns about reflog Johannes Schindelin
2009-02-26 10:55 ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1235622145.git.deskinm@umich.edu \
    --to=deskinm@umich.edu \
    --cc=git@vger.kernel.org \
    --cc=trast@student.ethz.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).