git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <junkio@cox.net>
Date
Dec 4, 2006, 02:00 UTC
Message-ID
<7v1wngv2rc.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<651451.91694.qm@web31813.mail.mud.yahoo.com>
Luben Tuikov <ltuikov@yahoo.com> 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.

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.

Next: Luben Tuikov
Message 1 of 7 in “Re: [PATCH] [checkout-index] Give names to stages”
  1. Junio C HamanoDec 4, 2006
  2. Luben TuikovDec 4, 2006
  3. Junio C HamanoDec 4, 2006
  4. Luben TuikovDec 4, 2006
  5. Johannes SchindelinDec 4, 2006
  6. Jakub NarebskiDec 4, 2006
  7. Johannes SchindelinDec 4, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.