git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Avery Pennarun" <apenwarr@gmail.com>
To: "David A. Greene" <greened@obbligato.org>
Cc: git@vger.kernel.org
Subject: Re: git-svn for vendor branches?
Date: Thu, 12 Jun 2008 16:48:49 -0400	[thread overview]
Message-ID: <32541b130806121348u7a52841aicec1e31eaaec8014@mail.gmail.com> (raw)
In-Reply-To: <200806121459.12570.greened@obbligato.org>

On 6/12/08, David A. Greene <greened@obbligato.org> wrote:
>  The problem really gets unsolvable with svn when you start looking at
>  merging from upstream *branches.*  In that case, what's in the branch/tag
>  is something that appears nowhere on the upstream trunk.  At some point
>  it was branched from trunk and stuff was cherry-picked into it from trunk as
>  bugs were fixed for release.  So one can't just do an svn_load_dirs from
>  trunk at the point of the branch/tag.  And one can't svn_load_dirs from a
>  release branch and then svn_load_dirs from trunk later because svn_load_dirs
>  by its very nature aggregates lots of individual revisions into one giant one.
>  There's no way to do the merge without a horrible number of conflicts, most
>  of which are spurious.

Although git-svn does have ways of supporting multiple repositories,
I'm not really sure git will help much here.  The confusion above
seems to be that fixes were cherry-picked from trunk into release
branches, and now you want to merge release branches together.
Neither git nor svn tracks cherry picks explicitly, and so they have
about the same problems and conflicts when attempting to merge in such
situations.

If I'm wrong about this, I'm sure other people on the list will enlighten me :)

>  We really do need to merge from a release branch into our local repository
>  and in the future do merges from later release branches or from trunk.

But the above is a bit easier.  It sounds from the above like most of
the cherry-picking difficulties are incurred by the *upstream*
maintainers, ie. not you.  Great!  That means someone is already
resolving those conflicts for you and producing pre-merged releases.

If I understand correctly, all you really want to do is have your
local repo contain "some upstream branch that you might want to switch
occasionally" + "my local changes".  This is quite elegant to do in
git with git-rebase (if your local repo switches to git), but it's not
even so hard to do in svn.

Basically, you just do an svn merge into your local branch of the
differences from (oldbranch@oldrevision) to (newbranch@newrevision).
In other words, let's say your current local version is:

    release_1 + local_patches

If you then apply the changes from release_1 to release_2, you then have:

   release_1 + local_patches + release_1..release_2
  = release_1 + release_1..release_2 + local_patches
  = release_2 + local_patches

This method works for any two svn versions release_1 and release_2.
You can bounce back and forth between the trunk and a release branch,
or downgrade from release_2 to release_1.  The only conflicts you
should get are the (unavoidable anyway) conflicts between your local
changes and the changes between the two remote branches.

You can either produce the diff between release_1 and release_2 using
"svn diff" on the remote repo and use plain "patch" to apply them to
the local copy, or else git_load_dirs the two revisions on your local
copy and "svn merge" (not "svnmerge") between the two.  The latter
makes it easier to resolve conflicts.

Have fun,

Avery

      reply	other threads:[~2008-06-12 20:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-12 19:59 git-svn for vendor branches? David A. Greene
2008-06-12 20:48 ` Avery Pennarun [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=32541b130806121348u7a52841aicec1e31eaaec8014@mail.gmail.com \
    --to=apenwarr@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=greened@obbligato.org \
    /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;
as well as URLs for NNTP newsgroup(s).