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, 06:32 UTC
Message-ID
<7v7ix8rx19.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<505428.75434.qm@web31808.mail.mud.yahoo.com>
Luben Tuikov <ltuikov@yahoo.com> writes:
Show 11 quoted lines
> 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.
That's _exactly_ my point.  It "merely allows to".
> If you think this breaks the ideology, ok.

It's not about the ideology. It's in the part you quoted but did not respond to (by the way, please don't quote the the bulk of the message if you are not responding to it).

You stopped at only adding "ours" as synonym for "2" and did not do anything else in the patch; it is a very sensible thing to do, because "checkout-index" is a plumbing command that is about checking out files from the index to the working tree.

But that means you HAVE TO stop at that because you are working at the plumbing layer. You said yourself that what you really wanted to do was "scm resolve accept ours". And from an end user's point of view, "checkout --stage=ours" is NOT it.

A user who wants to see "accept ours" wants the scm to perform:
	git checkout-index --stage=2 paths...
        git update-index paths... ;# or Nico's "git add"

for him. That is why I suggested to hoist the place you implement this usability improvement up one level and make the Porcelain level command:

	git checkout --ours paths...

to do the above two plumbing command sequence internally for the end user.

Previous: Luben TuikovNext: Luben Tuikov
Message 3 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.