git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Grafting Alternate History
@ 2012-08-31 23:39 dag
  2012-09-01  6:48 ` Andreas Schwab
  0 siblings, 1 reply; 3+ messages in thread
From: dag @ 2012-08-31 23:39 UTC (permalink / raw)
  To: git

I have an unfortunate situation where I have two subversion repositories
for the same project, one a public version and one a private version.
Because they are mirrors of svn repositories, they have very different
histories as far as git is concerned.  This is not all that uncommon but
of course I would like to manage things in git.

git-svn is great for interacting with one svn repository.  The public
svn repository has a fully-supported git mirror.  The private repository
also has a fully-supported git mirror.  But I need to check in changes
to the private repository via git-svn.  I eventually need to check in
changes to the public repository as well but that is orders of magnitude
less frequent.  A manual diff+patch+git-svn is acceptable for now.

I am wondering if it's possible to graft the history of one of the git
mirrors onto an empty branch of the other and share changes between
them.  I need to take updates from the public repository and apply them
to the private repository.  This is a frequent operation.  I have been
essentially using manual diff+patch but that is highly error-prone and
annoying.

For example, let's say we take a local copy of the private repository.
I would like to somehow create an empty branch in that local copy and
then populate it with the history of the public repository.  I would
like to be able to specify a git diff-like command on the public graft
branch to get some changes over a range of commits and apply those
changes to one of the private branches (say master).  If I could use a
git-merge-like or git-rebase-like command, so much the better.  I would
like to do the same in reverse but as I said that is a much less common
operation.

Has anyone done anything like this before?  Is it even theoretically
possible to manage disjoint histories like this?

Thanks for your help!

                            -Dave

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Grafting Alternate History
  2012-08-31 23:39 Grafting Alternate History dag
@ 2012-09-01  6:48 ` Andreas Schwab
  2012-09-04 22:56   ` dag
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Schwab @ 2012-09-01  6:48 UTC (permalink / raw)
  To: dag; +Cc: git

<dag@cray.com> writes:

> For example, let's say we take a local copy of the private repository.
> I would like to somehow create an empty branch in that local copy and
> then populate it with the history of the public repository.  I would
> like to be able to specify a git diff-like command on the public graft
> branch to get some changes over a range of commits and apply those
> changes to one of the private branches (say master).

You can set up (the git mirror of) the public repository as a remote in
the private repository and git cherry-pick the commits you want to copy
over.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Grafting Alternate History
  2012-09-01  6:48 ` Andreas Schwab
@ 2012-09-04 22:56   ` dag
  0 siblings, 0 replies; 3+ messages in thread
From: dag @ 2012-09-04 22:56 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: git

Andreas Schwab <schwab@linux-m68k.org> writes:

> You can set up (the git mirror of) the public repository as a remote in
> the private repository and git cherry-pick the commits you want to copy
> over.

Now why didn't I think of that!?  :)

Thanks for helping an old bumbler along.  :)

                         -Dave

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-09-04 22:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-31 23:39 Grafting Alternate History dag
2012-09-01  6:48 ` Andreas Schwab
2012-09-04 22:56   ` dag

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).