git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Interdiff between amended commits
@ 2011-04-13 11:54 Stefan Haller
  2011-04-14  7:08 ` Michael J Gruber
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Haller @ 2011-04-13 11:54 UTC (permalink / raw)
  To: git

I'd like to show an interdiff between two commits, e.g. when a commit
was amended.

I'm aware of the "intercommit" alias in the git wiki:

  $ git show commit1 > .git/commit1 && git show commit2 > .git/commit2 && interdiff .git/commit[12]

It only works for simple cases though, and I'd also like to avoid the
dependency to an external tool if possible.

So one thing I came up with is this:

  git checkout commit1^
  git cherry-pick --no-commit commit2
  git diff --cached

Two problems:

1) It requires a non-bare clone. At the place where I need it (on a
   server that sends commit emails) I only have a bare clone, so ideally
   I'd like something that doesn't need a working directory at all.

2) I'm not sure what to do if the cherry-pick doesn't apply cleanly.
   (The interdiff command has the same problem, of course).
   I don't even know what information I want to see in that case;
   anybody have an idea?

Any other thoughts about this are appreciated.


-- 
Stefan Haller
Berlin, Germany
http://www.haller-berlin.de/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-04-14  8:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-13 11:54 Interdiff between amended commits Stefan Haller
2011-04-14  7:08 ` Michael J Gruber
2011-04-14  8:09   ` Stefan Haller
2011-04-14  8:47     ` Michael J Gruber

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).