Skip to contentSkip to conversation

Commit a series of patches to SVN without rebase

DISCUSSION Jörg Sommer 2 participants 4 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

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?

Bye, Jörg

Signature · 1 line
Der Klügere gibt so lange nach bis er der Dumme ist.
#1 lore raw
Quoted 7 lines · Jörg Sommer

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.

git-svn.perl +2 -2
index c51f1e7..9b1113a 100755
@@ -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};
Signature · 1 line
Eric Wong
#2 lore raw

Hi Eric,

Quoted 9 lines · Eric Wong
Quoted 5 lines · Jörg Sommer

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).

May I ask you what the rational behind doing a rebase every time is? Is it needed? Why is it not possible to send all commits and do one rebase after the last one?

Bye, Jörg.

Signature · 2 lines
Wer A sagt, muß nicht B sagen. Er kann auch erkennen, daß A falsch war.
      	    	      	       	       	    	(Erich Kästner)
#3 lore raw
Quoted 10 lines · Jörg Sommer

Hi Eric,

Quoted 7 lines · Eric Wong
Quoted 5 lines · Jörg Sommer

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?

Quoted 6 lines
Quoted 2 lines

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

May I ask you what the rational behind doing a rebase every time is? Is it needed? Why is it not possible to send all commits and do one rebase after the last one?

Rebase is done to alert the user of potential conflicts before attempting to commit them to a remote repository. Formerly it was done to prevent potential clobbering of upstream changes if there were conflicts, but I think that's been rectified in recent months.

Signature · 1 line
Eric Wong