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

Re: [RFC] git pull and importers

From
EWEric Wong <normalperson@yhbt.net>
Date
Apr 7, 2007, 20:24 UTC
Message-ID
<20070407202409.GA5107@muzzle>
In-Reply-To
<Pine.LNX.4.64.0704062239420.27922@iabervon.org>
Daniel Barkalow <barkalow@iabervon.org> wrote:
> There's an SVN project I'm trying to track with git-svn. "git svn fetch" 
> fetches and imports the commits perfectly, but I can't figure out a way to 
> merge upstream commits into my branch automatically.

I don't suggest using merge with git-svn since it can generate non-linear history. Non-linear history does not map well to SVN.

"git svn rebase" (in 1.5.1) is handy for getting upstream commits into your branch (it's a wrapper around "git rebase")

Show 9 quoted lines
> It seems like the right solution should be:
> 
> [remote "origin"]
> 	importer = svn
> 	url = svn://ixion.tartarus.org/main
> 	fetch = puzzles:refs/remotes/puzzles
> [branch "master"]
> 	remote = origin
> 	merge = puzzles
git-svn in 1.5.1 already allows you to define:
[svn-remote "svn"]
	url = svn://ixion.tartarus.org/main
	fetch = puzzles:refs/remotes/puzzles

And then "git svn rebase" should automatically be able to figure out to rebase against refs/remotes/puzzles without needing a [branch "master"] section.

I don't think having the "importer = svn" in [remote "..."] is a good idea since it would be incompatible with older versions of git and the documentation would confuse users who don't track the latest version.

> Which would mean that it would use "git svn fetch" instead of "git fetch" 
> for that remote, and "git svn fetch" would use that config section instead 
> of its current config section.
Here's what I'd like git-fetch to do someday[1]:

When git-fetch is called without any remote arguments, it would look for [remote "origin"] as it does now. However, if no [remote "..."] sections are found (as is common with importer-created repos), it would try other importers: [svn-remote "svn"], (and hopefully one day [cvs-remote "cvs"], [arch-remote "arch"], ...).

Of course, git-fetch would also be able to handle --svn (and later --cvs/--arch/...) flags if the [*remote "..."] section names are ambiguous.

I intentionally named the default svn-remote section "svn" instead of "origin" for this reason, too; I didn't want to confuse git-fetch.

[1] - patches would be very much welcome (*nudge*nudge*wink*wink),
      I have a lot on my plate and this isn't a high priority.
-- 
Eric Wong
Previous: Daniel BarkalowNext: Junio C Hamano
Message 4 of 7 in “[RFC] git pull and importers”
  1. Daniel BarkalowApr 7, 2007
  2. Junio C HamanoApr 7, 2007
  3. Daniel BarkalowApr 7, 2007
  4. Eric WongApr 7, 2007
  5. Junio C HamanoApr 7, 2007
  6. Eric WongApr 7, 2007
  7. Daniel BarkalowApr 7, 2007

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.