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

Re: Commit a series of patches to SVN without rebase

From
EWEric Wong <normalperson@yhbt.net>
Date
Dec 22, 2007, 04:53 UTC
Message-ID
<20071222045340.GA21524@soma>
In-Reply-To
<20071220164044.GA22683@alea.gnuu.de>
Jörg Sommer <joerg@alea.gnuu.de> wrote:
Show 7 quoted lines
> Hi,
> 
> I've a number of patches in git I want to send to a SVN repository. git
> svn dcommit does a rebase after each commit which makes the whole commit
> takes very long. Is it possible to skip the rebase? All patches are in
> one branch without merges, a simple chain. Is it save to use --no-rebase
> in this case?

Right now, only if the changes don't depend on each other (they all modify different files).

The following patch should allow dcommit of multiple changes that depend on each other with --no-rebase. --no-rebase was Karl's idea, and I've never used it myself so I don't know how it works.

I don't have time to write a test case for --no-rebase at the moment, but any reports/feedback would be helpful. Thanks.

diff --git a/git-svn.perl b/git-svn.perl
index c51f1e7..9b1113a 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -418,7 +418,7 @@ sub cmd_dcommit {
 		warn "Attempting to commit more than one change while ",
 		     "--no-rebase is enabled.\n",
 		     "If these changes depend on each other, re-running ",
-		     "without --no-rebase will be required."
+		     "without --no-rebase may be required."
 	}
 	while (1) {
 		my $d = shift @$linear_refs or last;
@@ -453,6 +453,7 @@ sub cmd_dcommit {
 				                               $parents->{$d};
 			}
 			$_fetch_all ? $gs->fetch_all : $gs->fetch;
+			$last_rev = $cmt_rev;
 			next if $_no_rebase;
 
 			# we always want to rebase against the current HEAD,
@@ -512,7 +513,6 @@ sub cmd_dcommit {
 				$parents = \%p;
 				$linear_refs = \@l;
 			}
-			$last_rev = $cmt_rev;
 		}
 	}
 	unlink $gs->{index};
-- 
Eric Wong
Previous: Jörg SommerNext: Jörg Sommer
Message 2 of 4 in “Commit a series of patches to SVN without rebase”
  1. Jörg SommerDec 20, 2007
  2. Eric WongDec 22, 2007
  3. Jörg SommerDec 23, 2007
  4. Eric WongJan 2, 2008

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.