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

Re: What's new in git.git master branch

From
Junio C Hamano <junkio@cox.net>
Date
Dec 2, 2005, 05:46 UTC
Message-ID
<7v7jao9hln.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<7vmzjljgwo.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
Show 10 quoted lines
> Fredrik Kuivinen <freku045@student.liu.se> writes:
>
>> It turns out that this change breaks the directory/file conflict
>> handling in git-merge-recursive.
>>
>>    git-ls-tree -r -z <tree SHA1>
>>
>> Should we do it that way or should ls-tree be changed?
>
> Ouch.  Sorry, I should have been more careful.

So we updated ls-tree to take -t flag which shows tree entries under -r flag. I'd appreciate if you test the attached patch.

Show 6 quoted lines
> Also I think I broke the case where base trees need to be merged
> in 58cce8a8 commit (I changed processEntry not to collapse the
> index entry when file content changes cannot be automerged, but
> that change has to be done only for the final merge, and merges
> between base trees must collapse to be able to write the index
> file out as a tree).

I think that the above worry was unfounded, because the updateFileExt call I removed to prevent it from collapsing the unmerged entries was in effect only in !cacheOnly case (i.e. callDepth == 0).

-- >8 -- [PATCH] merge-recursive: adjust git-ls-tree use for the latest.

You need to pass -t flag if you want to see tree objects in "git-ls-tree -r" output these days. This change broke the tree structure reading code in git-merge-recursive used to detect D/F conflicts.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 git-merge-recursive.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
a6b51f11ab7f7f838a9b17f81059eebfc36e4c84
diff --git a/git-merge-recursive.py b/git-merge-recursive.py
index e599b11..b7fb096 100755
--- a/git-merge-recursive.py
+++ b/git-merge-recursive.py
@@ -98,7 +98,7 @@ getFilesRE = re.compile(r'^([0-7]+) (\S+
 def getFilesAndDirs(tree):
     files = Set()
     dirs = Set()
-    out = runProgram(['git-ls-tree', '-r', '-z', tree])
+    out = runProgram(['git-ls-tree', '-r', '-z', '-t', tree])
     for l in out.split('\0'):
         m = getFilesRE.match(l)
         if m:
-- 
0.99.9.GIT
Previous: Junio C HamanoNext: Fredrik Kuivinen
Message 5 of 15 in “What's new in git.git master branch”
  1. Junio C HamanoNov 30, 2005
  2. Fredrik KuivinenDec 1, 2005
  3. Junio C HamanoDec 1, 2005
  4. Junio C HamanoDec 2, 2005
  5. Junio C HamanoDec 2, 2005
  6. Fredrik KuivinenDec 2, 2005
  7. Fredrik KuivinenDec 2, 2005
  8. 3/3 update-index: allow --index-info to add higher stages.Junio C Hamano, Dec 7, 2005
  9. git-ls-tree: add "-t" option to always show the tree entriesLinus Torvalds, Dec 1, 2005
  10. Junio C HamanoDec 1, 2005
  11. Linus TorvaldsDec 1, 2005
  12. Junio C HamanoDec 1, 2005
  13. ls-tree: --name-onlyJunio C Hamano, Dec 1, 2005
  14. Junio C HamanoDec 2, 2005
  15. Linus TorvaldsDec 2, 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.