Re: git-svn and repository hierarchy?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 3, 2009 at 1:51 PM, Josef Wolf wrote:
>  # work on clones, pull work into git-svn-repos when we're done
>  #
>  for clone in 1 2 3; do
>    (
>      cd clone$clone
>      git pull --rebase
>      for commit in 1 2 3; do
>        echo change $clone $commit >>test
>        git commit -a -m "commit $clone $commit"
>      done
>    )
>    (cd git-svn-repos; git pull --rebase ../clone$clone)
>  done

Um. This has each clone basing their commits on the work of some other
clone. This line, specifically:

>    (cd git-svn-repos; git pull --rebase ../clone$clone)

breaks the "git-svn-repos only ever pulls from subversion" model I
suggested elsewhere.

Also, this line says "rebase my changes onto those of ../clone$clone",
which isn't what you want. It will end up rebasing svn commits that
the client didn't have on top of the client's commits, and will break
git-svn's index. Don't use --rebase here.

>  # Although we have resolved the conflict, spurious conflicts are
>  # propagated to the clones

...and this is because you had clones all merge from each other (via
git-svn-repos) *before* the changes were in svn.

Worse, since the git clients don't know that their work has been
rebased, they can wind up conflicting with themselves too. Which is
why I suggested "git svn dcommit" from each client, not from the
central repository.

This can be made work if you do something more like (untested):
    (cd git-svn-repos; git pull ../clone$clone topic-branch;
    git svn dcommit)
    (cd clone$clone; git checkout master; git pull;
    have a human verify that changes to master are correct;
    git branch -D topic-branch)

instead of

>    (cd git-svn-repos; git pull --rebase ../clone$clone)

ie. throw away each topic branch as you push it to git-svn-repos, and
take the changes that have gone through git-svn back via a pull of
master.

But that starts to look to me like more work for each clone than "git
svn dcommit" - YMMV, of course.

Peter Harris
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux