git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Dealing with an upstream cherry-picked branch
@ 2010-03-15  4:17 Jay Soffian
  2010-03-15 18:46 ` Avery Pennarun
  2010-03-15 21:30 ` Junio C Hamano
  0 siblings, 2 replies; 7+ messages in thread
From: Jay Soffian @ 2010-03-15  4:17 UTC (permalink / raw)
  To: git

I have the following scenario:

  o---o---Ma---o---o    local-master
 /       /
|       | .-b'------d'  upstream-a
|       |/  :       :
o---o---a---b---c---d   upstream-master

Local-master branched from upstream-master in distant past.
upstream-master periodically cuts tentative release branch upstream-a.
When they do this, that branch point (a) is merged into local-master
(Ma).

Over time, upstream applies fixes to upstream-a, but does so by
committing the fixes to upstream-master and then cherry-picking them
to upstream-a.

The question is how to best integrate the fixes on upstream-a into
local-master, w/o causing a headache when upstream cuts the next
tentative release branch, at which point upstrea-master will again
need to be merged into local-master (and that will also have other
local development). Here are two options I've considered:

1) Create a local-a integration branch, merged from upstream-a and
local-master. Keep this branch up-to-date by periodically merging
local-master and upstream-a:

  o---o---Ma---o---o     local-master
 /       /  \       \
|       |    `o------`o  local-a
|       |    /       /
|       | .-b'------d'   upstream-a
|       |/  :       :
o---o---a---b---c---d    upstream-master

2) Periodically merge upstream-a into local-master:

  o---o---Ma--o---o---o  local-master
 /       /   /       /
|       | .-b'------d'   upstream-a
|       |/  :       :
o---o---a---b---c---d    upstream-master

Then when it is next time to merge upstream-master into local-master either:

(a) Backout the upstream-a merges to local-master by reverting the
merge commits which introduced them to local-master, then merge
upstream-master.

(b) Just merge upstream-master and carefully deal with all the
conflicts. I think this will necessarily be an evil merge.

(c) Create a new branch at point Ma and cherry-pick only the local
commits from local-master past point Ma. This essentially gives me the
clean local-master I would've had if I'd been doing (1) all along.

- Are there any other options I'm missing?

- If I'm going to do (2a), I'm wondering if I'm missing any
subtleties. I've read the revert-a-faulty-merge how-to and I realize
my history won't be the cleanest, but I think it should work and leave
a picture like:

  o---o---Ma--o---o---o---o---Wd'---Wb'---Mi  local-master
 /       /   /       /                   /
|       | .-b'------d' upstream-a       |
|       |/  :       :                   |
o---o---a---b---c---d---e---f---g---h---i    upstream-master

Wd' is the revert of d' into local master. Wb' is the revert of b'
into local master. This reverts both merges from upstream-a into local
master. There may be conflicts to resolve due to the local changes
that happened in local-master. However, local-master should now be
"clean" to merge in upstream-master w/o having to worry about
conflicts between b and b', d and d'. Correct?

Thanks,

j.

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

end of thread, other threads:[~2010-03-16 22:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-15  4:17 Dealing with an upstream cherry-picked branch Jay Soffian
2010-03-15 18:46 ` Avery Pennarun
2010-03-15 21:07   ` Jay Soffian
2010-03-15 23:39     ` Avery Pennarun
2010-03-15 21:30 ` Junio C Hamano
2010-03-16 17:38   ` Jay Soffian
2010-03-16 22:56     ` Junio C Hamano

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