Interdiff between amended commits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]