git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Keeping two repos in sync
@ 2012-09-09  8:12 David Chanters
  2012-09-09  8:36 ` Andreas Schwab
  0 siblings, 1 reply; 4+ messages in thread
From: David Chanters @ 2012-09-09  8:12 UTC (permalink / raw)
  To: git

Hi all,

I'm wondering how best to go about this problem.  I've got two
separate git repositories -- one is a portable version which I'll call
"portable", the other is part of a BSD project, which I'll call "bsd".
 Both repositories have the same set of *conceptual* files in them,
it's just that the portable repository has additional files which are
not found in the bsd repository.  It should be noted that the bsd
repository is an automatically managed cvsexport clone of a CVS
repository -- but I don't think this matters here, as we're just
talking about two git repositories.

The "workflow" if you can call it that, is commits happen in the bsd
repository and are then put in the portable repo.  At the moment, I am
using git grafts to do this.  The important point to remember here is
the two repositories DO NOT have any common history to them -- it's
just that where the files are the same in both the bsd and portable
repository I can see and hence tell git, where to graft the two master
branches from each repository and for me to merge bsd:master ->
portable:master.

However, I am wondering how best to handle this situation.  It's
pretty convoluted -- not to mention the fact that git grafts are never
permanent.  What I'd like is for some "safe" way of setting up an
initial git graft which tied the two master branches between bsd and
portable to reflect changes on bsd:master not on portable:master and
then for me to treat those two branches as though they shared common
history so that I can merge one to the other.  Unfortunately, what I'm
doing at the moment is each time changes happen to bsd:master, I'm
having to reset the git graft each time; and since that operation is a
local one, it makes things rather awkward in a shared repository
situation as I am the sole person who can perform these merges.

I'm guessing I could rebase at some point and push those changes out?
I'm just wondering how other people handle this situation or if it's
just unique to me?

Kindly,

David

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

* Re: Keeping two repos in sync
  2012-09-09  8:12 Keeping two repos in sync David Chanters
@ 2012-09-09  8:36 ` Andreas Schwab
  2012-09-09  8:44   ` David Chanters
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Schwab @ 2012-09-09  8:36 UTC (permalink / raw)
  To: David Chanters; +Cc: git

Add "bsd" as a remote in "portable" and cherry-pick each commit in
"bsd".

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] 4+ messages in thread

* Re: Keeping two repos in sync
  2012-09-09  8:36 ` Andreas Schwab
@ 2012-09-09  8:44   ` David Chanters
  2012-09-09  9:03     ` Andreas Schwab
  0 siblings, 1 reply; 4+ messages in thread
From: David Chanters @ 2012-09-09  8:44 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: git

Hi,

On 9 September 2012 09:36, Andreas Schwab <schwab@linux-m68k.org> wrote:
> Add "bsd" as a remote in "portable" and cherry-pick each commit in
> "bsd".

I am already kind of doing this at the moment.  Hence:

1.  In portable, I have:

% git remote add bsd /path/to/bsd/repo
% git fetch bsd

2.  At this point I scan the two branches looking for a point to
graft; I might have done this already in the past, but the point is
since grafting is a local operation and I am not working in that
repository, I might need to do it again anyway -- that graft
represents a way of tieing the branches together at a point I can then
"git merge".

Kindly,

David

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

* Re: Keeping two repos in sync
  2012-09-09  8:44   ` David Chanters
@ 2012-09-09  9:03     ` Andreas Schwab
  0 siblings, 0 replies; 4+ messages in thread
From: Andreas Schwab @ 2012-09-09  9:03 UTC (permalink / raw)
  To: David Chanters; +Cc: git

David Chanters <david.chanters@googlemail.com> writes:

> 2.  At this point I scan the two branches looking for a point to
> graft; I might have done this already in the past, but the point is
> since grafting is a local operation and I am not working in that
> repository, I might need to do it again anyway -- that graft
> represents a way of tieing the branches together at a point I can then
> "git merge".

You can "git merge -s ours" that grafting point, assuming "portable"
completely subsumes "bsd" at that point.  Future merges should then be
working normally.

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] 4+ messages in thread

end of thread, other threads:[~2012-09-09  9:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-09  8:12 Keeping two repos in sync David Chanters
2012-09-09  8:36 ` Andreas Schwab
2012-09-09  8:44   ` David Chanters
2012-09-09  9:03     ` Andreas Schwab

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).