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

Re: Yet another set of merge test cases from the kernel tree.

From
Junio C Hamano <junkio@cox.net>
Date
Sep 20, 2005, 01:53 UTC
Message-ID
<7vek7kfqs2.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20050919161312.GB1782@c165.ib.student.liu.se>
Fredrik Kuivinen <freku045@student.liu.se> writes:
Show 6 quoted lines
> ... The support for
> renames is currently interleaved with other unrelated changes and
> this patch should not yet be considered for inclusion. With the rename
> patch we get clean merges that matches the actual commit for all of
> those except for 46f5.... git-merge-recursive.py do not merge
> 46f5... cleanly with the rename patch applied.
That is very interesting.
Show 10 quoted lines
> +getFilesRE = re.compile('([0-9]+) ([a-z0-9]+) ([0-9a-f]{40})\t(.*)')
> +def mergeTrees(head, merge, common, branch1Name, branch2Name,
> +               cleanCache):
> ...
> +    if cleanCache:
> +        updateArg = '-i'
> +    else:
> +        updateArg = '-u'
> +
> +    runProgram(['git-read-tree', updateArg, '-m', common, head, merge])

It _might_ make sense if we make '-i' and '-u' imply instead of require '-m' in read-tree, but that will be an independent patch.

Show 7 quoted lines
> +def mergeFile(path, oSha, oMode, aSha, aMode, bSha, bMode,
> +              branch1Name, branch2Name):
>...
> +    if aMode == oMode:
> +        mode = bMode
> +    else:
> +        mode = aMode
Note: preferring "our" mode if there is a conflict instead of
barfing.  I do not know which is more useful in practice.
Show 27 quoted lines
> +
> +    return [sha, mode, clean, merge]
> +
> +def updateFile(clean, sha, mode, path, cleanCache, onlyWd=False):
> +    updateCache = not onlyWd and (cleanCache or (not cleanCache and clean))
> +    updateWd = onlyWd or (not cleanCache and clean)
> +
> +    if updateWd:
> +        prog = ['git-cat-file', 'blob', sha]
> +        if stat.S_ISREG(mode):
> +            try:
> +                os.unlink(path)
> +            except OSError:
> +                pass
> +            if mode & 0100:
> +                mode = 0777
> +            else:
> +                mode = 0666
> +            fd = os.open(path, os.O_WRONLY | os.O_TRUNC | os.O_CREAT, mode)
> +            proc = subprocess.Popen(prog, stdout=fd)
> +            proc.wait()
> +            os.close(fd)
> +        elif stat.S_ISLNK(mode):
> +            linkTarget = runProgram(prog)
> +            os.symlink(linkTarget, path)
> +        else:
> +            assert(False)

Could it happen trying to update a file 'foo' when the working tree has 'foo/bar' file (i.e. D/F conflict)?

> +def getRenames(treeOrig, tree):
>...
> +def processRenames(entries, renamesA,...
>...
These are indeed very interesting.
Previous: Fredrik KuivinenNext: Fredrik Kuivinen
Message 13 of 40 in “A new merge algorithm, take 3”
  1. 0/2 A new merge algorithm, take 3Fredrik Kuivinen, Sep 7, 2005
  2. 1/2 Add '-i' flag to read-tree to make it ignore whats in the working directory.Fredrik Kuivinen, Sep 7, 2005
  3. Unified merge driver pushed out to "master" branchJunio C Hamano, Sep 11, 2005
  4. Fredrik KuivinenSep 11, 2005
  5. Junio C HamanoSep 12, 2005
  6. Another merge test case from the kernel tree.Junio C Hamano, Sep 14, 2005
  7. Daniel BarkalowSep 14, 2005
  8. Junio C HamanoSep 14, 2005
  9. Fredrik KuivinenSep 14, 2005
  10. Junio C HamanoSep 14, 2005
  11. Yet another set of merge test cases from the kernel tree.Junio C Hamano, Sep 15, 2005
  12. Fredrik KuivinenSep 19, 2005
  13. Junio C HamanoSep 20, 2005
  14. Fredrik KuivinenSep 20, 2005
  15. 2/2 A new merge algorithmFredrik Kuivinen, Sep 7, 2005
  16. Daniel BarkalowSep 7, 2005
  17. Fredrik KuivinenSep 8, 2005
  18. Daniel BarkalowSep 8, 2005
  19. Fredrik KuivinenSep 8, 2005
  20. Daniel BarkalowSep 8, 2005
  21. Junio C HamanoSep 7, 2005
  22. Junio C HamanoSep 8, 2005
  23. A Large Angry SCMSep 8, 2005
  24. Chuck LeverSep 8, 2005
  25. Junio C HamanoSep 8, 2005
  26. Linus TorvaldsSep 8, 2005
  27. Junio C HamanoSep 8, 2005
  28. Chuck LeverSep 8, 2005
  29. Linus TorvaldsSep 8, 2005
  30. Chuck LeverSep 8, 2005
  31. Linus TorvaldsSep 8, 2005
  32. [RFH] Merge driverJunio C Hamano, Sep 9, 2005
  33. Daniel BarkalowSep 9, 2005
  34. Junio C HamanoSep 9, 2005
  35. Daniel BarkalowSep 9, 2005
  36. [RFH] Merge driverJunio C Hamano, Sep 11, 2005
  37. Fredrik KuivinenSep 12, 2005
  38. Junio C HamanoSep 12, 2005
  39. Fredrik KuivinenSep 13, 2005
  40. Junio C HamanoSep 13, 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.