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

Re: [PATCH] Fall back to three-way merge when applying a patch.

From
Eric W. Biederman <ebiederm@xmission.com>
Date
Oct 6, 2005, 01:59 UTC
Message-ID
<m1mzln9zi1.fsf@ebiederm.dsl.xmission.com>
In-Reply-To
<7vslvfcy0g.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
Show 15 quoted lines
> Linus Torvalds <torvalds@osdl.org> writes:
>
>> ... Although I would actually prefer to be able to try against
>> a specific named release (not "all named tags" first).
>
> That makes sense, given that you know better than the tool can
> possibly guess, especially from the performance point of view.
>
> What's interesting is that from the correctness point of view,
> it should not make that much of a difference which base tree
> happens to be picked -- if the base tree is wildly different
> from your current HEAD, most of that wild difference will be
> carried over intact to the result of patch application for paths
> and parts of the files the patch does not touch.  Three-way
> merge notices that and your "changes" from the base tree win.

There is another workable strategy. Modify git-diff-xxx to report the sha1 of the tree, or the sha1's of the files the patch applies to. And make that information available to git-apply. I don't how often it would help but it has the possibility of letting the tools know exactly what the patch applied against.

A rational for why this would work is that is that a kernel repository is large, and unless objects/alternatives can be made to work across servers there will be people who can use git for development but can't host a repository that can be pulled from. Especially for a small patch.

Using sha1's for context before merging should be able to give you a whole lot more machine verifiable context with just a little bit of work.

Eric
Previous: Junio C HamanoNext: Linus Torvalds
Message 6 of 17 in “Fall back to three-way merge when applying a patch.”
  1. Fall back to three-way merge when applying a patch.Junio C Hamano, Oct 5, 2005
  2. Linus TorvaldsOct 5, 2005
  3. Junio C HamanoOct 5, 2005
  4. Linus TorvaldsOct 5, 2005
  5. Junio C HamanoOct 6, 2005
  6. Eric W. BiedermanOct 6, 2005
  7. Linus TorvaldsOct 6, 2005
  8. Junio C HamanoOct 6, 2005
  9. Eric W. BiedermanOct 6, 2005
  10. Linus TorvaldsOct 6, 2005
  11. Eric W. BiedermanOct 6, 2005
  12. Linus TorvaldsOct 6, 2005
  13. Eric W. BiedermanOct 6, 2005
  14. Show original and resulting blob object info in diff output.Junio C Hamano, Oct 7, 2005
  15. Linus TorvaldsOct 7, 2005
  16. Junio C HamanoOct 7, 2005
  17. Junio C HamanoOct 6, 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.