git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-svn and repository hierarchy?

From
JWJosef Wolf <jw@raven.inka.de>
Date
Feb 27, 2009, 17:12 UTC
Message-ID
<20090227171248.GB14187@raven.wolf.lan>
In-Reply-To
<49A50EB2.80300@drmicha.warpmail.net>
On Wed, Feb 25, 2009 at 10:26:10AM +0100, Michael J Gruber wrote:
> Josef Wolf venit, vidit, dixit 24.02.2009 23:34:
Show 11 quoted lines
> > I have set up a repository hierarchy like this:
> > 
> > 
> >          subversion-repos
> >                 |
> >            git-svn-repos
> >           /     |     \
> >       clone1  clone2  clone3
>
> Recent enough git should even warn you against doing that, "that" being
> pushing into checked out branches.

I've now tried to synchronize via pull instead of push, but I still get conflicts.

> Your diagram above is missing important info, namely which branches you
> are pushing into. But the problem indicates that you are pushing into a
> checked out branch.

In order to get a better understanding what's going on, I've written a small script which can be copy-pasted into some terminal window:

(
  set -ex
  # create test directory
  #
  TESTDIR=`mktemp --tmpdir=. git-svn-hierarchy-test-XXXXXXXX`
  rm -rf $TESTDIR
  mkdir -p $TESTDIR
  cd $TESTDIR
  SUBVERSION_REPOS=file://`pwd`/subversion-repos
  # create subversion repos with some history
  #
  svnadmin create subversion-repos
  svn -m "create standard layout" mkdir \
      $SUBVERSION_REPOS/trunk \
      $SUBVERSION_REPOS/branches \
      $SUBVERSION_REPOS/tags
  svn co $SUBVERSION_REPOS/trunk subversion-wc
  echo change1 >>subversion-wc/test
  svn add subversion-wc/test
  svn ci -m "commit 1" subversion-wc
  # create git-svn-repos
  #
  git svn init --stdlayout $SUBVERSION_REPOS git-svn-repos
  (cd git-svn-repos; git svn fetch)
  # create a clone and do some work on it
  #
  git clone git-svn-repos clone1
  for i in 2 3 4; do
    ( cd clone1; echo change$i >>test ; git commit -a -m "commit $i")
  done
  (cd git-svn-repos; git pull ../clone1)
  (cd git-svn-repos; git svn rebase)
  (cd git-svn-repos; git svn dcommit)
  (cd git-svn-repos; git pull ../clone1)  # if this line is executed,
  (cd git-svn-repos; git svn rebase)      # this command gives the conflict
)

When I comment out the second "git pull ../clone1", the conflict does not happen on the last "git svn rebase", but on some later pull, rebase or dcommit command.

Obviously, I'm doing something wrong.  But I can't figure what.  Any hints?
Previous: Peter HarrisNext: Michael J Gruber
Message 9 of 24 in “git-svn and repository hierarchy?”
  1. Josef WolfFeb 24, 2009
  2. Michael J GruberFeb 25, 2009
  3. Josef WolfFeb 25, 2009
  4. Peter HarrisFeb 26, 2009
  5. Josef WolfFeb 27, 2009
  6. Peter HarrisFeb 27, 2009
  7. Josef WolfFeb 27, 2009
  8. Peter HarrisFeb 28, 2009
  9. Josef WolfFeb 27, 2009
  10. Michael J GruberFeb 27, 2009
  11. Josef WolfFeb 27, 2009
  12. Michael J GruberFeb 28, 2009
  13. Josef WolfMar 3, 2009
  14. Peter HarrisMar 3, 2009
  15. Josef WolfMar 3, 2009
  16. Peter HarrisMar 4, 2009
  17. Josef WolfMar 4, 2009
  18. Peter HarrisMar 4, 2009
  19. Josef WolfMar 5, 2009
  20. Peter HarrisMar 5, 2009
  21. Josef WolfMar 6, 2009
  22. Peter HarrisMar 6, 2009
  23. Josef WolfMar 6, 2009
  24. Florian MicklerMar 8, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.