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

Is this an acceptable workflow in git-svn, or a user error?

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 9, 2007, 19:10 UTC
Message-ID
<7vy7itdjv6.fsf@assigned-by-dhcp.cox.net>

Suppose you are interacting with svn://some.where/ and you want to have a public git://my.svn/mirror.git maintained with your effort for others to consume. I am wondering if the following workflow, especially the push part, is kosher.

----------------------------------------------------------------
0. Priming the process
$ (mkdir mirror.git && cd mirror.git && git init)

$ mkdir private.git && cd private.git && git init $ git svn init svn://some.where/ $ git push ../mirror.git/ refs/heads/master:refs/heads/master

After this step, mirror.git would be in-sync with the SVN; we haven't done any of our own development yet.

1. Hack away

$ edit/git-add/etc. $ git commit

2. Publish the result
git push ../mirror.git/
3. Re-sync with SVN

$ git svn dcommit ----------------------------------------------------------------

I suspect that the above sequence is a user error, in that re-syncing with SVN using git-svn (either dcommit or rebase) would need to redo the commits to embed SVN metadata, but the public mirror now has commits made with git without such rewriting. In other words, I suspect that "git push" should never be done if you made changes on the git side since you sync'ed with the SVN.

The reason I am asking is that somebody on #git got in a very confusing situation. After the Re-sync, "git push" to the mirror would refuse because it is not a fast forward. "git fetch" from the mirror reveals that what after 3. is done, we see two identically-looking commits, one that was pushed (before re-sync with SVN) and the other (replaced because of re-sync) are different.

If that is the case, then I presume that the correct workflow would be:

1. Hack away
2. Re-sync with SVN
3. Publish the result; do not do anything between 2. and 3.
Is my understanding correct?
Next: Eric Wong
Message 1 of 4 in “Is this an acceptable workflow in git-svn, or a user error?”
  1. Junio C HamanoJun 9, 2007
  2. Eric WongJun 9, 2007
  3. Sam VilainJun 10, 2007
  4. Sam VilainJun 10, 2007

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.