Re: Command-line interface thoughts

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

 



On Thu, Jun 09, 2011 at 08:03:06PM +0200, Michael Haggerty wrote:

> Thanks for the correction.  So one interesting pseudo-tree would be
> 
> OURS -- The NEXT version of any file that has been resolved; and the
> stage 2 version of any file that has not yet been resolved.  The name
> seems consistent with what is meant by, e.g., "git checkout --ours".

Yeah, that makes sense to me as a definition.

> > So the index is not quite simply a set of four trees. The presence of
> > various stages for each entry tells us the progress of resolution.
> 
> Wouldn't the four trees described above contain information equivalent
> to the contents of the index?

Taken together, yes, I think you could represent the whole index. But
each taken alone is missing some information that might be useful in a
diff.

For example, if I do "git diff THEIRS WTREE" during a merge conflict,
that is a 2-way diff that is going to show things in THEIRS going away,
and both things brought by OURS and things that are part of a resolution
being added. That's less information than "git diff INDEX WTREE" (i.e.,
what is currently spelled as "git diff") provides, because when looking
at the whole index we can do a combined diff showing which part came
from which parent.

> For example, the resolution work that remains to be done that can be
> inquired using old-fashioned "git diff" (3-way diff) could also be
> accessed via
> 
>     git diff NEXT OURS
>     git diff NEXT THEIRS

But you don't get to see it together. You have to do two separate diffs,
which means you will see conflicted regions twice. Try:

  git log --merges -p --cc

on a repo of your choice, and compare with:

  git log --merges -p -m

The former is what "git diff" would show just before marking paths as
resolved, and the latter is what your two diffs above would show.

> or even
> 
>     git diff NEXT WTREE
> 
> if you want to see the remaining conflicts in <<<<<======>>>>>> format.

As I mentioned in an earlier email, this doesn't show which parts are
part of the resolution process (including conflict markers), and which
came from either side of the merge.

-Peff
--
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]