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

Re: git svn branch tracking + ignore paths

From
Lachlan Deck <lachlan.deck@gmail.com>
Date
Oct 28, 2009, 03:00 UTC
Message-ID
<AC7B0CB1-1B14-4EAE-A6B6-D0845EACE626@gmail.com>
In-Reply-To
<32541b130910271616ha861d08xa4b90b822d31f0ea@mail.gmail.com>
On 28/10/2009, at 10:16 AM, Avery Pennarun wrote:
Show 21 quoted lines
> On Tue, Oct 27, 2009 at 7:00 PM, Lachlan Deck  
> <lachlan.deck@gmail.com> wrote:
>> I'm wondering if it's possible to create a branch (starting as  
>> local but
>> later on pushed to svn) that essentially stays in sync with the  
>> main branch
>> (svn trunk) but both (a) ignores pulling in certain paths from  
>> trunk and (b)
>> provides a few extra paths of its own (some of which overlap with  
>> those
>> ignored from trunk) and (c) only pushes to trunk paths that are  
>> relevant for
>> trunk (i.e., not specifically ignored)?
>>
>> If someone's able to share how they'd go about setting this up  
>> that'd be
>> great.
>
> This sounds like a generally scary idea.  Perhaps if you described
> your problem at a higher level (what are you really trying to
> achieve?) there would be a less scary way to do it.

:) Sure. Essentially a project that I'm contributing to has both maven poms and ant/lib-based configs (with the ant ones as default for eclipse .project etc files). I'd like to be able to import the projects with maven into Eclipse to work on things but without committing back changes to eclipse .project/.classpath/.settings/*.

So I'm hoping for a fairly transparent process.
Show 30 quoted lines
> That said, if you *really* need this... one option that comes to  
> mind is:
>
> 1. extract the history from svn into git using 'git svn' as usual.
>
> 2. extract the subtree of svn that you're interested in (if you're
> lucky enough that you only need one subtree) by using 'git subtree
> split'.  This creates a new branch or new git repo, depending how you
> do it.
>
> 3. Create a third project that will host your new work with extra
> subtrees that you don't want.  Use 'git subtree add' and 'git subtree
> merge' to keep this up to date with the stuff you extracted in step 2.
> (Repeat steps 1-3 as necessary to keep your project up to date with
> the svn project.)
>
> 4. When you want to merge your own changes back into svn, first
> extract them from your own project (step 3) using 'git subtree split'.
> Then merge those changes into the main project (step 1) using 'git
> subtree merge'.  Then use git-svn to upload them to the main svn repo.
>
> You can save yourself some steps if you import the *entire* svn
> project into your own project, rather than trying to trim it on
> import.  That way you only have to split when going from #3 to #1, not
> in the other direction, and you don't need repository #2.
>
> If all this sounds crazy, it probably is.  Maybe see if you can come
> up with a way to avoid trying to do this altogether.
>
> Good luck... :)

Sounding scary. But if the above description of what I'm trying to achieve helps in finding a simple way to work I'm all ears :)

Thanks.
> Avery
>
> [1] http://github.com/apenwarr/git-subtree
I'll check this out anyway. Thanks.

with regards, --

Lachlan Deck
Previous: Avery PennarunNext: Avery Pennarun
Message 3 of 7 in “git svn branch tracking + ignore paths”
  1. Lachlan DeckOct 27, 2009
  2. Avery PennarunOct 27, 2009
  3. Lachlan DeckOct 28, 2009
  4. Avery PennarunOct 28, 2009
  5. Lachlan DeckOct 28, 2009
  6. Avery PennarunOct 28, 2009
  7. Lachlan DeckOct 29, 2009

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.