Re: Bug? Files are losing history after subtree merge

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

Re: Bug? Files are losing history after subtree merge

From: Matthieu Moy <hidden>
Date: 2016-06-15 22:58:56

Ralf Thielow [off-list ref] writes:
Hi,

recently I did a merge where a complete repo shall be
merged into a specific directory of another repo. I
tried both the "subtree" merge strategy and the option
"-Xsubtree=<dir>" of "recursive". I noticed that in both
cases somehow the history of single files were lost
during these merges (with history I mean 'git log <file>'
and 'git log --follow <file>').
This is a known bug of "git log --follow": it does not follow accross
subtree merge. But your history is still there (try gitk on your project
for example).

Technically, a subtree merge is a merge commit in which files are
renamed compared to the second parent. --follow does not manage this
case.
quoted hunk
diff --git a/t/t6029-merge-subtree.sh b/t/t6029-merge-subtree.sh
index 73fc240..e9a97d7 100755
--- a/t/t6029-merge-subtree.sh
+++ b/t/t6029-merge-subtree.sh
@@ -61,6 +61,14 @@ test_expect_success 'initial merge' '
 	test_cmp expected actual
 '
 
+test_expect_failure 'file keeps history after subtree merge' '
+	cd ../git-gui &&
+	git log --follow git-gui.sh >../git/expected &&
+	cd ../git &&
+	git log --follow git-gui/git-gui.sh >actual &&
+	test_cmp expected actual
+'
+
That would actually be good to add a failing test to "document" the
failure.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

Re: Bug? Files are losing history after subtree merge

From: Ralf Thielow <hidden>
Date: 2016-06-15 22:58:56

On Wed, Oct 2, 2013 at 9:42 PM, Matthieu Moy
[off-list ref] wrote:
Ralf Thielow [off-list ref] writes:
quoted
Hi,

recently I did a merge where a complete repo shall be
merged into a specific directory of another repo. I
tried both the "subtree" merge strategy and the option
"-Xsubtree=<dir>" of "recursive". I noticed that in both
cases somehow the history of single files were lost
during these merges (with history I mean 'git log <file>'
and 'git log --follow <file>').
This is a known bug of "git log --follow": it does not follow accross
subtree merge. But your history is still there (try gitk on your project
for example).

Technically, a subtree merge is a merge commit in which files are
renamed compared to the second parent. --follow does not manage this
case.
Thanks for explanation.
I knew the history of the repo is there, but the history of single files
(and the ability to look at it) is so important that subtree-merges aren't
an option for us. Such merges are rarely, luckily, but it would be nice
to get it work.

Thanks
quoted
diff --git a/t/t6029-merge-subtree.sh b/t/t6029-merge-subtree.sh
index 73fc240..e9a97d7 100755
--- a/t/t6029-merge-subtree.sh
+++ b/t/t6029-merge-subtree.sh
@@ -61,6 +61,14 @@ test_expect_success 'initial merge' '
      test_cmp expected actual
 '

+test_expect_failure 'file keeps history after subtree merge' '
+     cd ../git-gui &&
+     git log --follow git-gui.sh >../git/expected &&
+     cd ../git &&
+     git log --follow git-gui/git-gui.sh >actual &&
+     test_cmp expected actual
+'
+
That would actually be good to add a failing test to "document" the
failure.

--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help