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

Re: [PATCH] merge_blobs: use strbuf instead of manually-sized mmfile_t

From
SFStefan Frühwirth <stefan.fruehwirth@uni-graz.at>
Date
Feb 19, 2016, 12:43 UTC
Message-ID
<56C70E05.8020508@uni-graz.at>
In-Reply-To
<20160216203526.GA27484@sigill.intra.peff.net>
On 2016-02-16 at 21:35 Jeff King wrote:
Show 17 quoted lines
> Yeah, I agree there isn't a great solution in git here. Using "git
> merge" is definitely wrong if you don't want to touch HEAD or have a
> working directory.  If you _just_ care about doing the tree-level merge
> without content-level merging inside blobs, you can do it in the index
> like:
>
>    export GIT_INDEX_FILE=temp.index
>    base=$(git merge-base $ours $theirs)
>    git read-tree -i -m --aggressive $base $ours $theirs
>
> If you want to do content-level resolving on top of that, you can do it
> with:
>
>    git merge-index git-merge-one-file -a
>
> though it will need a temp directory to write out conflicts and
> resolved content.
That's an interesting alternative, I'll give it a try!
Show 8 quoted lines
> I don't think merge-tree is at all the wrong tool, in the sense that it
> is being used as designed. But it is using merge code that is different
> from literally the rest of git. That means you're going to run into
> weird bugs (like this one), and places where it does not behave the
> same.  This add/add case, for instance, is usually a conflict in a
> normal git merge (try your test case with "git merge"), but merge-tree
> tries to do a partial content merge with a base that never actually
> existed[1].
Thank you for clarifying, I understand.
> So I worry that merge-tree's existence is a disservice to people like
> Chris, because there is no disclaimer that it is effectively
> unmaintained.

I agree, I don't want to advocate continuing development under these conditions.

> So merge-blobs.c:generate_common_file() is definitely buggy, but I think
> the bug gets unintentionally canceled out by the follow-on three-way
> merge. Which is...good, I guess?

Well I don't know how to handle all this with respect to my original problem, but that's completely off topic. Anyway: Thanks!

Stefan
Previous: Jeff KingNext: Junio C Hamano
Message 8 of 10 in “malloc memory corruption on merge-tree with leading newline”
  1. Stefan FrühwirthFeb 15, 2016
  2. Stefan FrühwirthFeb 15, 2016
  3. merge_blobs: use strbuf instead of manually-sized mmfile_tJeff King, Feb 16, 2016
  4. Eric SunshineFeb 16, 2016
  5. Jeff KingFeb 16, 2016
  6. Stefan FrühwirthFeb 16, 2016
  7. Jeff KingFeb 16, 2016
  8. Stefan FrühwirthFeb 19, 2016
  9. Junio C HamanoFeb 16, 2016
  10. Stefan FrühwirthFeb 19, 2016

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.