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

Re: Three-way merge with the index as one way

From
Petr Baudis <pasky@suse.cz>
Date
Nov 3, 2005, 20:21 UTC
Message-ID
<20051103202125.GK1431@pasky.or.cz>
In-Reply-To
<7vy846ma65.fsf@assigned-by-dhcp.cox.net>

Dear diary, on Thu, Nov 03, 2005 at 09:02:10AM CET, I got a letter where Junio C Hamano <junkio@cox.net> told me that...

> git-am 3-way fallback logic constructs a sparse
> temporary tree and uses it for running regular 3-way, and you
> may be able to do something similar.

I'm confused now - if the tree is sparse, how does git-read-tree -m know that the missing files from the other tree are not deletes?

Show 6 quoted lines
> Right now git-am takes an
> e-mail patch and when it runs all the way it creates a commit,
> but the core logic that applies patch and falls back to 3-way
> could be separated out for your application.  Then you could:
> (1) 'git diff HEAD' before tree-warp to preserve the user
> changes, (2) clean up the working tree to match HEAD,

At this point I get nervous since there is a potential for data loss when something goes wrong at this point (e.g. system crash). I'm not saying there are no places like that in Cogito now, but I generally try to avoid them whenever possible.

Show 11 quoted lines
> (3) warp to the other tree, and (4) fed the user change perserved
> to git-am core logic.  That might give you something near optimum.
> 
> About "nonsensical" objects, I am not so sure how nonsensical
> those objects you would record from the working tree
> (intermediate state) are.  If you find two trees match on a path
> that has changed in the working tree, there won't be any
> conflict on that paths so it is like the user did an extra
> git-update-index on that path when no merge or warp is involved,
> from object database pollution POV; I do not personally think
> that is such a bad thing.

But if they don't match, you'll get superfluous blobs for the original index versions which are almost certain to go away.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
VI has two modes: the one in which it beeps and the one in which
it doesn't.
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 9 in “getting rid of extra directories”
  1. Zack BrownOct 15, 2005
  2. Junio C HamanoOct 15, 2005
  3. Zack BrownOct 15, 2005
  4. Junio C HamanoOct 15, 2005
  5. Three-way merge with the index as one wayPetr Baudis, Nov 3, 2005
  6. Junio C HamanoNov 3, 2005
  7. Petr BaudisNov 3, 2005
  8. Junio C HamanoNov 3, 2005
  9. Junio C HamanoNov 4, 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.