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
Mar 6, 2009, 16:10 UTC
Message-ID
<20090306161026.GA14554@raven.wolf.lan>
In-Reply-To
<eaa105840903051148s3515e8b7x9d7b8f9be12da735@mail.gmail.com>
On Thu, Mar 05, 2009 at 02:48:14PM -0500, Peter Harris wrote:
Show 10 quoted lines
> On Thu, Mar 5, 2009 at 1:05 PM, Josef Wolf wrote:
> >
> > Well, actually it allows the changes for a very limited user group (that
> > is: only me 8-).  While I agree that author/date should not be changed,
> > I like to be able to fix silly typos in the log.  After all, we all do
> > typos now and then ;-)
> 
> True, but in my experience it happens considerably less often with
> git. I find and fix most of my typos when reviewing my change-set
> before doing a "git push" or "git svn dcommit".
So you are rewriting yourself but not accept rewrites by svn ;-)
Show 8 quoted lines
> > Maybe there's room for more improvement:  Since the merge is done on a
> > scratch branch anyway, why not letting the clones _push_ into branches
> > with random names: cloneX-`uuidgen` or something.  So the clones could
> > do the push whenever they have net access.  The actual merge can be done
> > completely decoupled from the push operation.
> 
> Indeed. Or even not-so-random names, such as cloneX/topic-name if you
> prefer.

That would have the risk of multiple clones pushing to the same branch. I am not sure I am prepared to resolve such conflicts (yet). But you are right, the branch name should contain the topic-name. So here's my current favorite of the workflow:

     # work on clone
     #
     (
       cd clone$clone
       # first move commits from subversion to clone
       #
       git checkout master
       git pull --rebase
       # do some work
       #
       git checkout -b topic-branch
       for commit in 1 2 3; do
         echo change $clone $commit >>test
         git commit -a -m "commit $clone $commit"
       done
       # push the work
       #
       git push ../git-svn-repos topic-branch:clone-topic-branch-`uuidgen`
       git checkout master
       git branch -D topic-branch
     )
     # Integrate commits from clones an move them to subversion
     #
     (
       cd git-svn-repos
       for scratch in `git branch | grep ' clone-'` ; do
         # merge client's work
         #
         git checkout $scratch
         git svn rebase trunk
         # resolve possible conflicts
         #
         grep change test >test.resolved
         if diff test test.resolved ; then
             rm test.resolved
         else
             mv test.resolved test
             git add test
             git commit -m "merge"
             git rebase --skip
         fi
         # sync with svn repository
         #
         git svn dcommit
         git checkout master
         git svn rebase -l     # fast-forward master to where scratch is
         # clean up
         #
         git branch -d $scratch
       done
      )
Does that look sane?

The benefit is that work on clones and work on git-svn-repos is decoupled.

Previous: Peter HarrisNext: Peter Harris
Message 21 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.