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

git-svn and repository hierarchy?

From
JWJosef Wolf <jw@raven.inka.de>
Date
Feb 24, 2009, 22:34 UTC
Message-ID
<20090224223412.GA4573@raven.wolf.lan>
Hello,
I have set up a repository hierarchy like this:
         subversion-repos
                |
           git-svn-repos
          /     |     \
      clone1  clone2  clone3

subversion-repos is an existing repository that can not be converted to git.

git-svn-clone is meant as an intermediate "synchronization" repository. I never commit directly to this repos. Its only intention is to synchronize the clones to each other and against subversion-repos. git-svn-clone was created by

     git svn init --stdlayout $svn_url git-svn-repos
     (cd git-svn-repos && git svn fetch)

cloneX are ordinary git clones of git-svn-repos for the day-by-day work. They were created by

     git clone git-svn-repos cloneX
I can successfully work on the clones.  To synchronize with git-svn-clone,
I do
     git stash
     git pull
     git push origin
     git stash apply
     git stash clear
And here is my first problem: every time I push to git-svn-repos, its
working tree gets out of sync, because pushing don't update the tree.
So every time I push, "git status" shows me local modifications which
are actually outdated files.  I thought I could use a bare repository
to avoid this problem, but git-svn refuses to work on a bare repos.
So here's my first question: Any ideas how to get around this?

Once git-svn-repos is cleaned up, I want it to synchronize against subversion-repos. Thus I do

     git svn rebase
     git svn dcommit

This works most of the time. Sometimes, I get error messages like this from rebase:

  Applying Fix logging of IP-Addresses when reading access list.
  error: patch failed: upnp/websrv:528
  error: upnp/websrv: patch does not apply
  Using index info to reconstruct a base tree...
  Falling back to patching base and 3-way merge...
  No changes -- Patch already applied.

I've never seen any damage after this error message, and the last line suggests that this is only some informative warning.

But now here's the real catch: this time I got following error message from "git svn rebase":

  Auto-merged server/misc.c
  CONFLICT (content): Merge conflict in server/misc.c
  Failed to merge in the changes.
  Patch failed at 0005.
  
  When you have resolved this problem run "git rebase --continue".
  If you would prefer to skip this patch, instead run "git rebase --skip".
  To restore the original branch and stop rebasing run "git rebase --abort".
Unfortunately, none of the three suggested commands help.

Investigation reveals that the conflict was caused by two independent commits to one of the clones. That is: both commits were on the same clone and no commits were done to the other clones in the mean time. The commits just happen to touch neighboring lines.

Those two commits have managed to go all the way up from cloneA through git-svn-repos to subversion-repos without any problem. Only on the way back from subversion-repos to git-svn-repos, they create the conflict.

Any ideas how to clean up from the situation? And how to avoid this problem in the future?

Next: Michael J Gruber
Message 1 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.