Re: [PATCH] [checkout-index] Give names to stages

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

 



--- Junio C Hamano <junkio@xxxxxxx> wrote:
> Luben Tuikov <ltuikov@xxxxxxxxx> writes:
> 
> > One can now say "git-checkout-index --stage=ours ..."  or
> > "git-checkout-index --stage=theirs ...", instead of having
> > to remember the corresponding number assigned to each stage.
> 
> I really do not like to have this in checkout-index; I would
> rather keep checkout-index a purely plumbing thing.  If there
> are valid and frequently appearing use cases that currently
> requires "checkout-index --stage=$n", I think that need should
> be addressed as a missing feature in the UI layer.

Sometimes when I pull things from a bunch of places and do
a resolve, I'm presented with the standard resolve format of
a source file, "<<<< ==== >>>>" thingie, and all I'd really
like to do is "accept ours".  I.e. something similar to what I've
seen in other (commercial) SCMs, a la "scm resolve accept ours".

This patch merely allows the user to say
   git-checkout-index --stage=ours their_broken_file.c
instead of
   git-checkout-index --stage=2 their_broken_file.c
and similarly for "theirs", etc.

If you think this breaks the ideology, ok.

    Luben

> During a conflicted merge, you may run "diff --cc" in order to
> decide that you would want to take yours (or theirs), and that
> would be a good reason to wanting to checkout "your" version (or
> "their" version; but I do not think of a valid reason to want to
> say "checkout-index --stage=1").  From the UI point of view, it
> would make more sense to be able to say:
> 
> 	$ git checkout --ours hello.c
> 	$ git checkout --theirs Makefile
> 
> If the user is interested in looking at raw copies of our and
> their version for comparison (not just "diff --theirs" kind of
> usage), it _might_ even make sense to be able to do:
> 
> 	$ git checkout --stdout --ours hello.c >hello.c-ours
> 	$ git checkout --stdout --theirs hello.c >hello.c-theirs
>         $ diff -u hello.c-ours hello.c-theirs
> 
> I do not particularly like the above overloaded meaning of
> "checkout" myself, but that would be something people who are
> used to "cvs up -p" might expect to be able to do.
> 
> If we were to do both of the above, then it might even make
> sense to make the first form (sans --stdout) to also mark the
> index entry after checking out the specified higher stage.
> 
> And the UI layer (Porcelain-ish) should be where we should add
> the "usability" and "human readability" bits.


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