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

Re: [PATCH] "checkout-cache -m" writes unmerged contents for each stage.

From
Junio C Hamano <junkio@cox.net>
Date
Apr 18, 2005, 02:44 UTC
Message-ID
<7vfyxovm6j.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.58.0504171833450.7211@ppc970.osdl.org>
>>>>> "LT" == Linus Torvalds <torvalds@osdl.org> writes:

LT> I'm actually thinking that maybe the _right_ interface is to do something LT> like this:

LT> 	merge-cache <program> <filename>

LT> and what that does is to look up the <filename> in the cache, and if it LT> has any merge entries, unpack all of them (which may be just one file, of LT> course) into up to three separate files (mkstemp()), and then execve the LT> supplied program name with those three files as arguments 1,2,3 (empty LT> argument if no file), and "filename" as argument 4.

LT> What do you think? I can whip up a "merge-cache" program like that in five LT> minutes, and it _seems_ like the right interface..

One small detail.  What about the "-x" bit?

In case 2 and 3 in your sample merge script, the "merge script" needs to know what the preferred mode bits are before running "update-cache --add".

Yes, it can figure that out by running "show-files --unmerged" and grepping for "$4" by itself, but then it can figure out the information in "$1" through "$3" by itself as well, so that makes having merge-cache wrapper less useful to begin with.

I do not think it is realistic for these three related trees to have files that differ in -x bit, so it would not be that useful to give the "merge script" the flexibility to pick -x bit value among three parents --- it would be fine for the merge-cache wrapper to dictate the value of the -x bit for the resulting file. So I'd suggest to add an extra parameter to the "merge script" when merge-cache wrapper calls it.

Previous: Linus TorvaldsNext: Linus Torvalds
Message 5 of 6 in “"checkout-cache -m" writes unmerged contents for each stage.”
  1. "checkout-cache -m" writes unmerged contents for each stage.Junio C Hamano, Apr 17, 2005
  2. Linus TorvaldsApr 18, 2005
  3. Junio C HamanoApr 18, 2005
  4. Linus TorvaldsApr 18, 2005
  5. Junio C HamanoApr 18, 2005
  6. Linus TorvaldsApr 18, 2005

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.