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

Re: Question about tracking multiple Subversion repository from the same git repository with git-svn

From
EWEric Wong <normalperson@yhbt.net>
Date
Jun 11, 2010, 21:28 UTC
Message-ID
<20100611212808.GB7262@dcvr.yhbt.net>
In-Reply-To
<AANLkTim_wx9lQ_IClmajo5etFKay0xPCTz1UrKilGWln@mail.gmail.com>
Daniele Segato <daniele.bilug@gmail.com> wrote:
Show 9 quoted lines
> On Thu, Jun 10, 2010 at 9:04 PM, Eric Wong <normalperson@yhbt.net> wrote:
> >> 1. Is there a way to tell git that abc/trunk is a branch of svn/tags/1.2.3 ?
> >
> > You need to use grafts.
> 
> this one?
> https://git.wiki.kernel.org/index.php/GraftPoint
> 
> seems what I need..
Yes
Show 10 quoted lines
> in this case, I had a question:
> 
> since if I use this feature my commit will have different SHA-1. I
> used to write the commit SHA-1 in some of the svn tags. If I do this
> they will no longer be valid.
> I think with git SVN the "best" way to identify a commit is using the
> "Tree" object SHA-1, it should be the same for every revision that
> contains the same content...
> so..
> 1b. Can I extract the tree sha-1 from a commit?
Yes, "git cat-file commit $commit" will show you the tree.
Show 8 quoted lines
> 1c. Is there a way to get every commit pointing to to a tree?
> 
> Ideally I would do something like
> 
> git contain-tree <sha-1-of-the-tree>
> [list of commit's here]
> 
> does this make any sense to you?
Sort of, yes...

Back in ancient times, there used to be a "git svn graft-branches" command which could automate what you're doing. It was removed in commit d05d72e07e49869fe988d4d99e6ac60711570db5 because it was largely unused.

Perhaps you can resurrect it as a standalone command. I imagine it could be used for other import utilities, too.

Show 9 quoted lines
> >> 2. can I rename svn-remote "svn" to something like "main" without side effect?
> >
> > You should be able to (and use GIT_SVN_ID=main in the env),
> > though I haven't used these features in a while.
> 
> Renamed, thanks.
> do you know if I can set a GIT_SVN_ID (default) per-repository instead
> of using the environment
> variable?

Err, actually, --svn-remote=main is probably preferred, these days. GIT_SVN_ID is --id=foo. Sorry for the confusion.

Show 39 quoted lines
> (since I use git-new-workdir it would be best if I can use a default
> per workdir)
> 
> >> 3. after 2) can I also rename all the names of the remote branches to
> >> main/* instead of svn/* ?
> >
> > It should be possible...  you need to edit $GIT_DIR/svn/.metadata, too.
> 
> thanks, did it.
> 
> >> 7. if the merge --squash cause a lot of conflicts is there a way to
> >> split the conflict resolution across different persons?
> >
> > I'm not sure what you mean... multiple people working on the same
> > working tree?  On a shared screen session?  I don't see why not.
> 
> 
> no,
> what I had in mind was a "migration team" to work on the migration of
> the customization
> to a product to the new version of the main product.
> 
> What I have in mind here is some kind of "selective merge".
> For example...
> 
> I merge a group of commits, someone else, on another computer with
> git-svn or subversion merge another part and so on..
> 
> like...
> 
> git merge --squash -- path/to/something
> or something like
> 
> git merge --squash --interactive
> 
> this could give you a way to choose different paths you want to "merge".
> 
> I know this is not very like a merge but I hope I gave you the idea of
> what I meant.

I'll wait for others to answer that. I rarely encounter conflict-heavy merges, partly because my workflows are setup to avoid them.

-- 
Eric Wong
Previous: Daniele Segato
Message 4 of 4 in “Question about tracking multiple Subversion repository from the same git repository with git-svn”
  1. Daniele SegatoJun 10, 2010
  2. Eric WongJun 10, 2010
  3. Daniele SegatoJun 11, 2010
  4. Eric WongJun 11, 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.