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

[PATCH] git-svn: recommend rebase for syncing against an SVN repo

From
EWEric Wong <normalperson@yhbt.net>
Date
Aug 25, 2006, 19:48 UTC
Message-ID
<20060825194823.GC8957@localdomain>
In-Reply-To
<20060825191516.GA8957@localdomain>
Does this make sense to other git-svn users out there?

pull can give funky history unless you understand how git-svn works internally, which users should not be expected to do.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
 Documentation/git-svn.txt |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index 7d86809..9fce4d3 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -212,12 +212,26 @@ # Commit only the git commits you want t
 	git-svn commit <tree-ish> [<tree-ish_2> ...]
 # Commit all the git commits from my-branch that don't exist in SVN:
 	git-svn commit remotes/git-svn..my-branch
-# Something is committed to SVN, pull the latest into your branch:
-	git-svn fetch && git pull . remotes/git-svn
+# Something is committed to SVN, rebase the latest into your branch:
+	git-svn fetch && git rebase remotes/git-svn
 # Append svn:ignore settings to the default git exclude file:
 	git-svn show-ignore >> .git/info/exclude
 ------------------------------------------------------------------------
 
+REBASE VS. PULL
+---------------
+
+Originally, git-svn recommended that the remotes/git-svn branch be
+pulled from.  This is because the author favored 'git-svn commit B'
+to commit a single head rather than the 'git-svn commit A..B' notation
+to commit multiple commits.
+
+If you use 'git-svn commit A..B' to commit several diffs and you do not
+have the latest remotes/git-svn merged into my-branch, you should use
+'git rebase' to update your work branch instead of 'git pull'.  'pull'
+can cause non-linear history to be flattened when committing into SVN,
+which can lead to merge commits reversing previous commits in SVN.
+
 DESIGN PHILOSOPHY
 -----------------
 Merge tracking in Subversion is lacking and doing branched development
@@ -310,6 +324,10 @@ the possible corner cases (git doesn't d
 copied files are fully supported if they're similar enough for git to
 detect them.
 
+SEE ALSO
+--------
+gitlink:git-rebase[1]
+
 Author
 ------
 Written by Eric Wong <normalperson@yhbt.net>.
-- 
1.4.2.g7c9b
Previous: Eric WongNext: Seth Falcon
Message 4 of 8 in “git-svn problem: unexpected files/diffs in commit”
  1. Seth FalconAug 25, 2006
  2. Eric WongAug 25, 2006
  3. git-svn: establish new connections on commit after forkEric Wong, Aug 25, 2006
  4. git-svn: recommend rebase for syncing against an SVN repoEric Wong, Aug 25, 2006
  5. Seth FalconAug 26, 2006
  6. Eric WongAug 26, 2006
  7. git-svn: add the 'dcommit' commandEric Wong, Aug 26, 2006
  8. git-svn: stop repeatedly reusing the first commit message with dcommitEric Wong, Aug 26, 2006

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.