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

Re: git-svn: handling merge-base failures

From
EWEric Wong <normalperson@yhbt.net>
Date
Jan 4, 2010, 03:45 UTC
Message-ID
<20100104034540.GA4548@dcvr.yhbt.net>
In-Reply-To
<7878A426-9D87-43B5-A10A-38F3C9369165@apple.com>
Andrew Myrick <amyrick@apple.com> wrote:
Show 26 quoted lines
> On Dec 23, 2009, at 11:54 AM, Andrew Myrick wrote:
> > One of my projects is failing to clone because merge-base is failing
> > on one of the revisions; the branch is a partial branch, so
> > merge-base can't find a common ancestor with trunk.  I'd like to
> > catch the exception that command_oneline should throw when
> > merge-base fails,
> 
> Instead of using the Error.pm module, I was able to handle the
> exception with the more basic eval block.  However, there are some
> details here I would like to discuss with the community.
> 
> When git-svn fetches a partial branch, it appears to refetch all of
> the history of the subdirectory from which the branch was created.
> This creates new commits for the old revisions, and these new commits
> exist as a separate history for the partial branch.   When git-svn
> fetches the revision at which this partial branch is merged back to
> trunk, git-svn attempts to run merge-base to find a common ancestor.
> However, because the partial branch has its own history, the
> merge-base fails, and git-svn dies.
> 
> Naively handling the exception with an eval block and skipping the
> merge ticket works fine in that it brings us back to parity with git
> 1.6.5.7, but it means that the merge parent relationship between trunk
> and the partial branch is lost.  Is there any way to preserve this
> information, or does the separate commit history of the partial branch
> make it fundamentally impossible?
Hi Andrew,

A method of preserving the $SVN_PATH <=> $PARENT@$REV mapping for reusing follow_parent-created branches is definitely desired.

I've just been lacking time and motivation these days with other projects taking priority. Help (even if it's just to refactor/cleanup existing code) would definitely be appreciated here.

> I've created a small svn repository that demonstrates this failure
> with git v1.6.6.  Its dump is attached.

Thanks. This (and a similar dump a few weeks back) will definitely come in handy for writing test cases and fixing this long-standing issue.

-- 
Eric Wong
Previous: Andrew MyrickNext: Andrew Myrick
Message 6 of 7 in “git-svn: handling merge-base failures”
  1. Andrew MyrickDec 23, 2009
  2. Eric WongDec 23, 2009
  3. Andrew MyrickDec 23, 2009
  4. Eric WongDec 23, 2009
  5. Andrew MyrickJan 4, 2010
  6. Eric WongJan 4, 2010
  7. Andrew MyrickJan 4, 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.