{"thread":{"id":"7952","subject":"[git-svn PATCH] Add --no-rebase option to git-svn dcommit","startedAt":"2007-05-03T05:51:35Z","lastAt":"2007-05-04T10:26:56Z","messageCount":7,"participants":["Karl Hasselström","David Kågedal","Seth Falcon","Eric Wong"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"40942","messageId":"20070503054749.20115.53805.stgit@yoghurt","threadId":"7952","inReplyTo":null,"subject":"[git-svn PATCH] Add --no-rebase option to git-svn dcommit","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-05-03T05:51:35Z","receivedAt":"2007-05-03T05:51:35Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"git-svn dcommit exports commits to Subversion, then imports them back\nto git again, and last but not least rebases or resets HEAD to the\nlast of the new commits. I guess this rebasing is convenient when\nusing just git, but when the commits to be exported are managed by\nStGIT, it's really annoying. So add an option to disable this\nbehavior. And document it, too!\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n---\n\nArguably, the switch should be --rebase instead, and default to not\nrebase. But that would change the existing behavior, and possibly make\ndcommit less convenient to use for at least the person who implemented\nthe existing behavior. Opinions?\n\n Documentation/git-svn.txt |    3 +++\n git-svn.perl              |   33 ++++++++++++++++++---------------\n 2 files changed, 21 insertions(+), 15 deletions(-)\n\ndiff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\nindex 62d7ef8..fcdeeaa 100644\n--- a/Documentation/git-svn.txt\n+++ b/Documentation/git-svn.txt\n@@ -125,6 +125,9 @@ and have no uncommitted changes.\n \talternative to HEAD.\n \tThis is advantageous over 'set-tree' (below) because it produces\n \tcleaner, more linear history.\n++\n+--no-rebase;;\n+\tAfter committing, do not rebase or reset.\n --\n \n 'log'::\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 6657e10..3c4f490 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -55,7 +55,7 @@ $sha1_short = qr/[a-f\\d]{4,40}/;\n my ($_stdin, $_help, $_edit,\n \t$_message, $_file,\n \t$_template, $_shared,\n-\t$_version, $_fetch_all,\n+\t$_version, $_fetch_all, $_no_rebase,\n \t$_merge, $_strategy, $_dry_run, $_local,\n \t$_prefix, $_no_checkout, $_verbose);\n $Git::SVN::_follow_parent = 1;\n@@ -114,6 +114,7 @@ my %cmd = (\n \t\t\t  'verbose|v' => \\$_verbose,\n \t\t\t  'dry-run|n' => \\$_dry_run,\n \t\t\t  'fetch-all|all' => \\$_fetch_all,\n+\t\t\t  'no-rebase' => \\$_no_rebase,\n \t\t\t%cmt_opts, %fc_opts } ],\n \t'set-tree' => [ \\&cmd_set_tree,\n \t                \"Set an SVN repository to a git tree-ish\",\n@@ -413,21 +414,23 @@ sub cmd_dcommit {\n \t\treturn;\n \t}\n \t$_fetch_all ? $gs->fetch_all : $gs->fetch;\n-\t# we always want to rebase against the current HEAD, not any\n-\t# head that was passed to us\n-\tmy @diff = command('diff-tree', 'HEAD', $gs->refname, '--');\n-\tmy @finish;\n-\tif (@diff) {\n-\t\t@finish = rebase_cmd();\n-\t\tprint STDERR \"W: HEAD and \", $gs->refname, \" differ, \",\n-\t\t             \"using @finish:\\n\", \"@diff\";\n-\t} else {\n-\t\tprint \"No changes between current HEAD and \",\n-\t\t      $gs->refname, \"\\nResetting to the latest \",\n-\t\t      $gs->refname, \"\\n\";\n-\t\t@finish = qw/reset --mixed/;\n+\tunless ($_no_rebase) {\n+\t\t# we always want to rebase against the current HEAD, not any\n+\t\t# head that was passed to us\n+\t\tmy @diff = command('diff-tree', 'HEAD', $gs->refname, '--');\n+\t\tmy @finish;\n+\t\tif (@diff) {\n+\t\t\t@finish = rebase_cmd();\n+\t\t\tprint STDERR \"W: HEAD and \", $gs->refname, \" differ, \",\n+\t\t\t\t     \"using @finish:\\n\", \"@diff\";\n+\t\t} else {\n+\t\t\tprint \"No changes between current HEAD and \",\n+\t\t\t      $gs->refname, \"\\nResetting to the latest \",\n+\t\t\t      $gs->refname, \"\\n\";\n+\t\t\t@finish = qw/reset --mixed/;\n+\t\t}\n+\t\tcommand_noisy(@finish, $gs->refname);\n \t}\n-\tcommand_noisy(@finish, $gs->refname);\n }\n \n sub cmd_find_rev {\n"},{"id":"40950","messageId":"87647aqu6i.fsf@morpheus.local","threadId":"7952","inReplyTo":"20070503054749.20115.53805.stgit@yoghurt","subject":"Re: [git-svn PATCH] Add --no-rebase option to git-svn dcommit","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-05-03T06:48:21Z","receivedAt":"2007-05-03T06:48:21Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"Karl Hasselström <kha@treskal.com> writes:\n\n> git-svn dcommit exports commits to Subversion, then imports them back\n> to git again, and last but not least rebases or resets HEAD to the\n> last of the new commits. I guess this rebasing is convenient when\n> using just git, but when the commits to be exported are managed by\n> StGIT, it's really annoying. So add an option to disable this\n> behavior. And document it, too!\n>\n> Signed-off-by: Karl Hasselström <kha@treskal.com>\n> ---\n>\n> Arguably, the switch should be --rebase instead, and default to not\n> rebase. But that would change the existing behavior, and possibly make\n> dcommit less convenient to use for at least the person who implemented\n> the existing behavior. Opinions?\n\nI don't agree.  The rebase behaviour makes perfect sense in the normal\ncase, and I've been using it without problems.  The special case is\nwhen you start using stgit, so that's when you need to tell dcommit to\ndo something out of the ordinary.\n\nOther than that, I like your patch.  But you knew that already :-)\n\n-- \nDavid Kågedal\n"},{"id":"40965","messageId":"m24pmtaop1.fsf@ziti.local","threadId":"7952","inReplyTo":"87647aqu6i.fsf@morpheus.local","subject":"Re: [git-svn PATCH] Add --no-rebase option to git-svn dcommit","fromName":"Seth Falcon","fromEmail":"sethfalcon@gmail.com","sentAt":"2007-05-03T15:53:30Z","receivedAt":"2007-05-03T15:53:30Z","isPatch":true,"sender":{"key":"sethfalcon@gmail.com","avatar":"https://gravatar.com/avatar/fd62fe73d3013b12fce71d5269ec52eaca3c4cee479efc6eea3603d6f1d8bf8d?d=mp&s=160"},"body":"David Kågedal <davidk@lysator.liu.se> writes:\n\n> Karl Hasselström <kha@treskal.com> writes:\n>\n>> git-svn dcommit exports commits to Subversion, then imports them back\n>> to git again, and last but not least rebases or resets HEAD to the\n>> last of the new commits. I guess this rebasing is convenient when\n>> using just git, but when the commits to be exported are managed by\n>> StGIT, it's really annoying. So add an option to disable this\n>> behavior. And document it, too!\n>>\n>> Signed-off-by: Karl Hasselström <kha@treskal.com>\n>> ---\n>>\n>> Arguably, the switch should be --rebase instead, and default to not\n>> rebase. But that would change the existing behavior, and possibly make\n>> dcommit less convenient to use for at least the person who implemented\n>> the existing behavior. Opinions?\n>\n> I don't agree.  The rebase behaviour makes perfect sense in the normal\n> case, and I've been using it without problems.  The special case is\n> when you start using stgit, so that's when you need to tell dcommit to\n> do something out of the ordinary.\n\nI'm happy with git-svn dcommit's current behavior.  Since it is\ngit-svn and not git-stGIT, I'm not in favor of changing a default to\nmake a stGIT use case more convenient.\n\n+ seth\n"},{"id":"41015","messageId":"20070504075908.GB17526@muzzle","threadId":"7952","inReplyTo":"20070503054749.20115.53805.stgit@yoghurt","subject":"Re: [git-svn PATCH] Add --no-rebase option to git-svn dcommit","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-05-04T07:59:08Z","receivedAt":"2007-05-04T07:59:08Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Karl Hasselström <kha@treskal.com> wrote:\n> git-svn dcommit exports commits to Subversion, then imports them back\n> to git again, and last but not least rebases or resets HEAD to the\n> last of the new commits. I guess this rebasing is convenient when\n> using just git, but when the commits to be exported are managed by\n> StGIT, it's really annoying. So add an option to disable this\n> behavior. And document it, too!\n\nCool, I've been planning to add this myself, too.\n\nAcked-by: Eric Wong <normalperson@yhbt.net>\n\n> Signed-off-by: Karl Hasselström <kha@treskal.com>\n> ---\n> \n> Arguably, the switch should be --rebase instead, and default to not\n> rebase. But that would change the existing behavior, and possibly make\n> dcommit less convenient to use for at least the person who implemented\n> the existing behavior. Opinions?\n> \n>  Documentation/git-svn.txt |    3 +++\n>  git-svn.perl              |   33 ++++++++++++++++++---------------\n>  2 files changed, 21 insertions(+), 15 deletions(-)\n> \n> diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\n> index 62d7ef8..fcdeeaa 100644\n> --- a/Documentation/git-svn.txt\n> +++ b/Documentation/git-svn.txt\n> @@ -125,6 +125,9 @@ and have no uncommitted changes.\n>  \talternative to HEAD.\n>  \tThis is advantageous over 'set-tree' (below) because it produces\n>  \tcleaner, more linear history.\n> ++\n> +--no-rebase;;\n> +\tAfter committing, do not rebase or reset.\n>  --\n>  \n>  'log'::\n> diff --git a/git-svn.perl b/git-svn.perl\n> index 6657e10..3c4f490 100755\n> --- a/git-svn.perl\n> +++ b/git-svn.perl\n> @@ -55,7 +55,7 @@ $sha1_short = qr/[a-f\\d]{4,40}/;\n>  my ($_stdin, $_help, $_edit,\n>  \t$_message, $_file,\n>  \t$_template, $_shared,\n> -\t$_version, $_fetch_all,\n> +\t$_version, $_fetch_all, $_no_rebase,\n>  \t$_merge, $_strategy, $_dry_run, $_local,\n>  \t$_prefix, $_no_checkout, $_verbose);\n>  $Git::SVN::_follow_parent = 1;\n> @@ -114,6 +114,7 @@ my %cmd = (\n>  \t\t\t  'verbose|v' => \\$_verbose,\n>  \t\t\t  'dry-run|n' => \\$_dry_run,\n>  \t\t\t  'fetch-all|all' => \\$_fetch_all,\n> +\t\t\t  'no-rebase' => \\$_no_rebase,\n>  \t\t\t%cmt_opts, %fc_opts } ],\n>  \t'set-tree' => [ \\&cmd_set_tree,\n>  \t                \"Set an SVN repository to a git tree-ish\",\n> @@ -413,21 +414,23 @@ sub cmd_dcommit {\n>  \t\treturn;\n>  \t}\n>  \t$_fetch_all ? $gs->fetch_all : $gs->fetch;\n> -\t# we always want to rebase against the current HEAD, not any\n> -\t# head that was passed to us\n> -\tmy @diff = command('diff-tree', 'HEAD', $gs->refname, '--');\n> -\tmy @finish;\n> -\tif (@diff) {\n> -\t\t@finish = rebase_cmd();\n> -\t\tprint STDERR \"W: HEAD and \", $gs->refname, \" differ, \",\n> -\t\t             \"using @finish:\\n\", \"@diff\";\n> -\t} else {\n> -\t\tprint \"No changes between current HEAD and \",\n> -\t\t      $gs->refname, \"\\nResetting to the latest \",\n> -\t\t      $gs->refname, \"\\n\";\n> -\t\t@finish = qw/reset --mixed/;\n> +\tunless ($_no_rebase) {\n> +\t\t# we always want to rebase against the current HEAD, not any\n> +\t\t# head that was passed to us\n> +\t\tmy @diff = command('diff-tree', 'HEAD', $gs->refname, '--');\n> +\t\tmy @finish;\n> +\t\tif (@diff) {\n> +\t\t\t@finish = rebase_cmd();\n> +\t\t\tprint STDERR \"W: HEAD and \", $gs->refname, \" differ, \",\n> +\t\t\t\t     \"using @finish:\\n\", \"@diff\";\n> +\t\t} else {\n> +\t\t\tprint \"No changes between current HEAD and \",\n> +\t\t\t      $gs->refname, \"\\nResetting to the latest \",\n> +\t\t\t      $gs->refname, \"\\n\";\n> +\t\t\t@finish = qw/reset --mixed/;\n> +\t\t}\n> +\t\tcommand_noisy(@finish, $gs->refname);\n>  \t}\n> -\tcommand_noisy(@finish, $gs->refname);\n>  }\n>  \n>  sub cmd_find_rev {\n> \n\n-- \nEric Wong\n"},{"id":"41020","messageId":"20070504080424.GA30555@muzzle","threadId":"7952","inReplyTo":"20070504075908.GB17526@muzzle","subject":"Re: [git-svn PATCH] Add --no-rebase option to git-svn dcommit","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-05-04T08:04:24Z","receivedAt":"2007-05-04T08:04:24Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Eric Wong <normalperson@yhbt.net> wrote:\n> Karl Hasselström <kha@treskal.com> wrote:\n> > git-svn dcommit exports commits to Subversion, then imports them back\n> > to git again, and last but not least rebases or resets HEAD to the\n> > last of the new commits. I guess this rebasing is convenient when\n> > using just git, but when the commits to be exported are managed by\n> > StGIT, it's really annoying. So add an option to disable this\n> > behavior. And document it, too!\n> \n> Cool, I've been planning to add this myself, too.\n> \n> Acked-by: Eric Wong <normalperson@yhbt.net>\n> \n> > Signed-off-by: Karl Hasselström <kha@treskal.com>\n> > ---\n> > \n> > Arguably, the switch should be --rebase instead, and default to not\n> > rebase. But that would change the existing behavior, and possibly make\n> > dcommit less convenient to use for at least the person who implemented\n> > the existing behavior. Opinions?\n\nErm, sorry, I skipped over this part.  No. I like rebase being the\ndefault behavior.\n\n> >  Documentation/git-svn.txt |    3 +++\n> >  git-svn.perl              |   33 ++++++++++++++++++---------------\n> >  2 files changed, 21 insertions(+), 15 deletions(-)\n> > \n> > diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\n> > index 62d7ef8..fcdeeaa 100644\n> > --- a/Documentation/git-svn.txt\n> > +++ b/Documentation/git-svn.txt\n> > @@ -125,6 +125,9 @@ and have no uncommitted changes.\n> >  \talternative to HEAD.\n> >  \tThis is advantageous over 'set-tree' (below) because it produces\n> >  \tcleaner, more linear history.\n> > ++\n> > +--no-rebase;;\n> > +\tAfter committing, do not rebase or reset.\n> >  --\n> >  \n> >  'log'::\n> > diff --git a/git-svn.perl b/git-svn.perl\n> > index 6657e10..3c4f490 100755\n> > --- a/git-svn.perl\n> > +++ b/git-svn.perl\n> > @@ -55,7 +55,7 @@ $sha1_short = qr/[a-f\\d]{4,40}/;\n> >  my ($_stdin, $_help, $_edit,\n> >  \t$_message, $_file,\n> >  \t$_template, $_shared,\n> > -\t$_version, $_fetch_all,\n> > +\t$_version, $_fetch_all, $_no_rebase,\n> >  \t$_merge, $_strategy, $_dry_run, $_local,\n> >  \t$_prefix, $_no_checkout, $_verbose);\n> >  $Git::SVN::_follow_parent = 1;\n> > @@ -114,6 +114,7 @@ my %cmd = (\n> >  \t\t\t  'verbose|v' => \\$_verbose,\n> >  \t\t\t  'dry-run|n' => \\$_dry_run,\n> >  \t\t\t  'fetch-all|all' => \\$_fetch_all,\n> > +\t\t\t  'no-rebase' => \\$_no_rebase,\n> >  \t\t\t%cmt_opts, %fc_opts } ],\n> >  \t'set-tree' => [ \\&cmd_set_tree,\n> >  \t                \"Set an SVN repository to a git tree-ish\",\n> > @@ -413,21 +414,23 @@ sub cmd_dcommit {\n> >  \t\treturn;\n> >  \t}\n> >  \t$_fetch_all ? $gs->fetch_all : $gs->fetch;\n> > -\t# we always want to rebase against the current HEAD, not any\n> > -\t# head that was passed to us\n> > -\tmy @diff = command('diff-tree', 'HEAD', $gs->refname, '--');\n> > -\tmy @finish;\n> > -\tif (@diff) {\n> > -\t\t@finish = rebase_cmd();\n> > -\t\tprint STDERR \"W: HEAD and \", $gs->refname, \" differ, \",\n> > -\t\t             \"using @finish:\\n\", \"@diff\";\n> > -\t} else {\n> > -\t\tprint \"No changes between current HEAD and \",\n> > -\t\t      $gs->refname, \"\\nResetting to the latest \",\n> > -\t\t      $gs->refname, \"\\n\";\n> > -\t\t@finish = qw/reset --mixed/;\n> > +\tunless ($_no_rebase) {\n> > +\t\t# we always want to rebase against the current HEAD, not any\n> > +\t\t# head that was passed to us\n> > +\t\tmy @diff = command('diff-tree', 'HEAD', $gs->refname, '--');\n> > +\t\tmy @finish;\n> > +\t\tif (@diff) {\n> > +\t\t\t@finish = rebase_cmd();\n> > +\t\t\tprint STDERR \"W: HEAD and \", $gs->refname, \" differ, \",\n> > +\t\t\t\t     \"using @finish:\\n\", \"@diff\";\n> > +\t\t} else {\n> > +\t\t\tprint \"No changes between current HEAD and \",\n> > +\t\t\t      $gs->refname, \"\\nResetting to the latest \",\n> > +\t\t\t      $gs->refname, \"\\n\";\n> > +\t\t\t@finish = qw/reset --mixed/;\n> > +\t\t}\n> > +\t\tcommand_noisy(@finish, $gs->refname);\n> >  \t}\n> > -\tcommand_noisy(@finish, $gs->refname);\n> >  }\n> >  \n> >  sub cmd_find_rev {\n\n-- \nEric Wong\n"},{"id":"41040","messageId":"87slad553c.fsf@morpheus.local","threadId":"7952","inReplyTo":"20070504075908.GB17526@muzzle","subject":"Re: [git-svn PATCH] Add --no-rebase option to git-svn dcommit","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-05-04T09:08:07Z","receivedAt":"2007-05-04T09:08:07Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"Eric Wong <normalperson@yhbt.net> writes:\n\n> Karl Hasselström <kha@treskal.com> wrote:\n>> git-svn dcommit exports commits to Subversion, then imports them back\n>> to git again, and last but not least rebases or resets HEAD to the\n>> last of the new commits. I guess this rebasing is convenient when\n>> using just git, but when the commits to be exported are managed by\n>> StGIT, it's really annoying. So add an option to disable this\n>> behavior. And document it, too!\n>\n> Cool, I've been planning to add this myself, too.\n\nOne thing I haven't figured out, although I haven't looked at the code\nmuch, is this:  When does git-svn do a merge rather than a rebase?\nHow can there ever be a diff?  Is this perhaps something that can\nhappen if you use set-tree, because I don't see how it happens with\ndcommit.\n\n-- \nDavid Kågedal\n"},{"id":"41032","messageId":"20070504102656.GB16446@diana.vm.bytemark.co.uk","threadId":"7952","inReplyTo":"20070504080424.GA30555@muzzle","subject":"Re: [git-svn PATCH] Add --no-rebase option to git-svn dcommit","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-05-04T10:26:56Z","receivedAt":"2007-05-04T10:26:56Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2007-05-04 01:04:24 -0700, Eric Wong wrote:\n\n> Erm, sorry, I skipped over this part. No. I like rebase being the\n> default behavior.\n\nAs did everyone else. So I guess that's settled, then. :-)\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"}]}