Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [git] repo-layout question: cross-repo cherry-picking?

Hi James,

On Monday, November 21, 2011 11:50:09 PM James Blackburn wrote:
> On 21 November 2011 17:12, Stephan Herrmann <stephan@xxxxxxxxxxxxxxx> wrote:
> > ...
> > Unfortunately, both repos don't match in structure, the jdt.core plugin
> > resides in these locations:
> >
> >  repo: eclipse.jdt.core
> >  path: /org.eclipse.jdt.core
> > vs.
> >  repo: org.eclipse.objectteams
> >  path: /plugins/org.eclipse.jdt.core
> >
> 
> 
> The subtree merge does precisely this.  If there's a foreign git repo,
> whose content corresponds to a subdirectory of your main repo, then you can
> mark the point where the repo's were most recently in sync (using a graft,
> say), and then use git merge -s subtree to merge in more recent changes.
 
Thanks for mentioning "graft", that looks like an important piece in the puzzle!

Also subtree merge could be good, but that might still impose some
limitations:
- not available via the UI of EGit (?)
- restricted to merge (vs. cherry-pick) (?)
- needs to guess directory correspondence on each operation
So your other suggestion looks more promising to me ...

> If you want to move content around, changing history, then having done the
> conversion you can git-filter-branch to change branches and tags to the
> layout of your choice.

OK, I'm currently running git filter-branch using a script with a few lines like:
  test -d plugins/org.eclipse.jdt.core && mv plugins/org.eclipse.jdt.core . || echo "jdt.core not found"
When done I should hopefully have a repo where everything is in the most
convenient location. To me, a one-time repo-conversion looks safer, than relying
on *every* subsequent command to apply magic to find corresponding bits.

thanks,
Stephan


PS:
On Tuesday, November 22, 2011 12:52:38 AM Matthias Sohn wrote:
> There were a couple of EGit fixes recently regarding following moves, so
> you may try a recent nightly build
> and enable "Preferences > Team > Git > Views > History View > Follow
> Renames"

I'm sure there will still be plenty of occasion where I will use this. Thanks!


Back to the top