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

Subsystems: the rest

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:14

Junio C Hamano [off-list ref] writes:
Fredrik Kuivinen [off-list ref] writes:
quoted
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.
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 <redacted>

---

 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

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

From: Fredrik Kuivinen <hidden>
Date: 2016-06-15 22:42:14

On Thu, Dec 01, 2005 at 09:46:12PM -0800, Junio C Hamano wrote:
Junio C Hamano [off-list ref] writes:
quoted
Fredrik Kuivinen [off-list ref] writes:
quoted
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.
With the patch tt works properly again. Thanks :)
quoted
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).
Yes, the code is correct. You can apply the following patch to make it
a bit simpler.

- Fredrik

--
merge-recursive: Clean up index updates

Signed-off-by: Fredrik Kuivinen <redacted>


---

 git-merge-recursive.py |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

66b1a0157f25629b35ecf300450618a230741218
diff --git a/git-merge-recursive.py b/git-merge-recursive.py
index b7fb096..4f061da 100755
--- a/git-merge-recursive.py
+++ b/git-merge-recursive.py
@@ -825,10 +825,7 @@ def processEntry(entry, branch1Name, bra
             cleanMerge = False
             output('CONFLICT (content): Merge conflict in', path)
 
-            if cacheOnly:
-                updateFile(False, sha, mode, path)
-            else:
-                updateFileExt(sha, mode, path, updateCache=False, updateWd=True)
+            updateFile(False, sha, mode, path)
     else:
         die("ERROR: Fatal merge failure, shouldn't happen.")
 
-- 
0.99.9.GIT
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help