Re: git cherry-pick feature request

From: Junio C Hamano <>
Date: 2006-08-24 17:36:19
Paul Mackerras <> writes:

> While I'm asking for features, another one that would be really useful
> for another tool I'm writing is a 3-way diff for a file between the
> working directory, the index, and the current head commit, something
> like what git diff-tree -c does for merges.  That is, it would have
> two columns of +/-/space characters, one for the current head and one
> for the index.  A '-' would indicate that the line appears in the
> current head or the index but not in the version of the file in the
> working directory.  A '+' would indicate that the line appears in the
> working directory version.

The combined diff (-c and --cc) comparison works by comparing a
single post-image (merge result) with multiple pre-images, so I
think it is reasonable to compare the working tree files as the
post-image and cached and HEAD-tree versions as the preimages.

I am not sure how useful this would be though -- I am guessing
that in most people's workflow the index and the HEAD would
exactly match most of the time, since that is the way Linus
encourages (and I follow that myself).  So for that extreme use
case, the difference between "diff-index HEAD" and the proposed
command (I am thinking about calling it git-diff-status) would
be that the latter always has two plus or minus signs instead of
one, and lines with a single plus or minus would be an
indication that HEAD and index have drifted.  In other words,
the largest benefit of "combined diff" which is to simplify
trivial "The result took this one not that one wholesale"
differences would not be felt.

I have to visualize the result a bit before coding this.

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at
Received on Thu Aug 24 17:37:04 2006

This archive was generated by hypermail 2.1.8 : 2006-08-24 17:37:41 EST