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

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

From
Thomas Rast <trast@student.ethz.ch>
Date
Feb 22, 2010, 09:57 UTC
Message-ID
<201002221057.35088.trast@student.ethz.ch>
In-Reply-To
<1266825442-32107-4-git-send-email-tuomas.suutari@gmail.com>
On Monday 22 February 2010 08:57:22 Tuomas Suutari wrote:
> Use merge-base rather than rev-list for detecting if a parent is an
> ancestor of another, because rev-list gives incorrect results
> sometimes.
[...]
Show 10 quoted lines
> -				my $revs = command_oneline(
> -					"rev-list", "-1",
> -					"$new_parents[$i]..$new_parents[$j]",
> +				my $mergebase = command_oneline(
> +					"merge-base",
> +					"$new_parents[$i]", "$new_parents[$j]",
>  				       );
> -				if ( !$revs ) {
> +				if ( $mergebase eq $new_parents[$i] ) {
>  					undef($new_parents[$i]);

I think you swapped the test (or I got confused, which is entirely possible). Let I = $new_parents[$i] and J = $new_parents[$j]. The old one was

  test -z "$(git rev-list -1 I..J)"

which reads "unless there are any commits on J which are not on I", i.e., it fails unless J is an ancestor of I.

But the new one is
  "$(git merge-base I J)" == I.
so suddenly I must be an ancestor of J.

Is that what you were fixing? Because I don't think the 'rev-list -1' test is any worse than the merge-base test. If it's not, please tell us what you are fixing. Either way, please change the commit message appropriately.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Previous: Tuomas SuutariNext: Tuomas Suutari
Message 6 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.