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

[PATCH 3/3 v2] git-svn: Fix discarding of extra parents from svn:mergeinfo

From
Tuomas Suutari <tuomas.suutari@gmail.com>
Date
Feb 22, 2010, 18:12 UTC
Message-ID
<1266862373-28365-1-git-send-email-tuomas.suutari@gmail.com>
In-Reply-To
<1266825442-32107-4-git-send-email-tuomas.suutari@gmail.com>

If parent J is an ancestor of parent I, then parent J should be discarded, not I.

Note that J is an ancestor of I if and only if rev-list I..J is emtpy, which is what we are testing here.

Signed-off-by: Tuomas Suutari <tuomas.suutari@gmail.com>
---
Thanks to Thomas Rast for pointing out that this can be made with a
smaller change and there is no need swap rev-list to merge-base after
all.
 git-svn.perl             |    2 +-
 t/t9151-svn-mergeinfo.sh |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index 265852f..ed96a03 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3273,7 +3273,7 @@ sub find_extra_svn_parents {
 					"$new_parents[$i]..$new_parents[$j]",
 				       );
 				if ( !$revs ) {
-					undef($new_parents[$i]);
+					undef($new_parents[$j]);
 				}
 			}
 		}
diff --git a/t/t9151-svn-mergeinfo.sh b/t/t9151-svn-mergeinfo.sh
index 353f543..1640824 100755
--- a/t/t9151-svn-mergeinfo.sh
+++ b/t/t9151-svn-mergeinfo.sh
@@ -33,7 +33,7 @@ test_expect_success 'svn non-merge merge commits did not become git merge commit
 	[ -z "$bad_non_merges" ]
 	'
 
-test_expect_failure 'commit made to merged branch is reachable from the merge' '
+test_expect_success 'commit made to merged branch is reachable from the merge' '
 	before_commit=$(git rev-list --all --grep="trunk commit before merging trunk to b2")
 	merge_commit=$(git rev-list --all --grep="Merge trunk to b2")
 	not_reachable=$(git rev-list -1 $before_commit --not $merge_commit)
-- 
1.7.0.87.g6166f6d.dirty
Previous: Tuomas SuutariNext: Thomas Rast
Message 8 of 10 in “git-svn detects some merges incorrectly from svn:mergeinfo”
  1. Tuomas SuutariFeb 22, 2010
  2. 1/3 t9151: Fix a few commits in the SVN dumpTuomas Suutari, Feb 22, 2010
  3. Sam VilainFeb 24, 2010
  4. 2/3 t9151: Add two new svn:mergeinfo test casesTuomas Suutari, Feb 22, 2010
  5. 3/3 git-svn: Fix discarding of extra parents from svn:mergeinfoTuomas Suutari, Feb 22, 2010
  6. Thomas RastFeb 22, 2010
  7. Tuomas SuutariFeb 22, 2010
  8. 3/3 git-svn: Fix discarding of extra parents from svn:mergeinfoTuomas Suutari, Feb 22, 2010
  9. Thomas RastFeb 23, 2010
  10. Eric WongFeb 26, 2010

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.