Git development
 help / color / mirror / Atom feed
From: "Philip Oakley" <philipoakley@iee.org>
To: "Jay Soffian" <jaysoffian@gmail.com>,
	"Michael Witten" <mfwitten@gmail.com>
Cc: "git" <git@vger.kernel.org>
Subject: Re: Dealing with rewritten upstream
Date: Sat, 1 Oct 2011 12:34:21 +0100	[thread overview]
Message-ID: <B877FF8066FE4EC3A1CFEAF4B00D1E31@PhilipOakley> (raw)
In-Reply-To: CAG+J_Dw9Oa=LH1CSE3Dr_B6de8X-SQfrWGbayPy3OD-UqB6siA@mail.gmail.com

From: "Jay Soffian" <jaysoffian@gmail.com>
> On Fri, Sep 30, 2011 at 7:04 PM, Michael Witten <mfwitten@gmail.com> 
> wrote:
>>> Pictorially:
>>>
>>> ---A---B---C---D---E... new-upstream/master
>>>
>>> ---a---b---c---d---e... old-upstream/master
>>> \ \ \
>>> 1---2---3---4---5 master
>>>
>>> The obvious way do deal with this situation is:
>>>
>>> $ git merge -s ours -m "Splice in new-upstream/master" E
>>>
>>> Are there any other/better options I'm missing?
>>>
>>> (Eventually upstream plans to migrate entirely to git, so I can't just
>>> run git-svn myself.)
>>
>> Surely, you'd rather have your master rewritten such that the relevant
>> commits of new-upstream/master are used IN PLACE of the corresponding
>> old-upstream/master. Have you considered ways to achieve that?
>
> My master has over two years of history with its commit-IDs referenced
> in our bug tracker, in old emails, in archived binaries, etc. So no, I
> do not want to rewrite my master.
>
> Now, if you mean, do I want to use something like replacement refs to
> try to more cleanly splice the new upstream into my existing master,
> no I haven't really explored that. git-replace isn't very well
> documented with examples of its intended use case.
>
> I've considered setting up a new repo at a different URL that is
> rewritten to be based on the new upstream, and migrating to that,
> making the old repo read-only.
>
> But I'm not sure that's worth the trouble. There doesn't seem to be
> too much downside to splicing in the new upstream via merge -s ours.
> It barely increases the repo size since the trees are the same. Maybe
> there's some other downsides I'm missing.
>
Surely; one method is to simply create a merge between the Old_master and 
New_master (i.e. have two parallel branches of identical content) at the 
point where the new approach starts. Git-filter-branch (if used) already 
provides the ref to the original, so it's easy to create that special merge.

You have already noted that all the trees for the commits are identical, so 
the storage overhead is minimal for just the new commit objects (though the 
cognitive overhead can be large for some - plan for often/early 
explanations!)

I'm presuming that you will have at some point in the past, a common commit 
(it maybe the initial commit), so that there is still a single root.

The key question is to decide which 'branch' is Parent1, and which is 
Parent2 (at the merge) for any history traversals that may be required in 
the future. After the merge you can rename the branch back to Master if 
required (more cognitive discussions..)

This slightly differs from your original diagram in that you do not have any 
one-to-one links between the old and new commits. The date/time would be the 
same for the old & new so it shouldn't be hard to find one from the other.

Philip

      reply	other threads:[~2011-10-01 11:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-30 22:09 Dealing with rewritten upstream Jay Soffian
2011-09-30 23:04 ` Michael Witten
2011-09-30 23:28   ` Jay Soffian
2011-10-01 11:34     ` Philip Oakley [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B877FF8066FE4EC3A1CFEAF4B00D1E31@PhilipOakley \
    --to=philipoakley@iee.org \
    --cc=git@vger.kernel.org \
    --cc=jaysoffian@gmail.com \
    --cc=mfwitten@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox