{"thread":{"id":"13573","subject":"[PATCH] Add a --dry-run option to git-svn rebase","startedAt":"2008-05-19T14:20:44Z","lastAt":"2008-06-02T05:37:20Z","messageCount":8,"participants":["Seth Falcon","Toby Allsopp","toby.allsopp (toby.allsopp - NAVMAN)","Eric Wong","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"77274","messageId":"1211206844-29842-1-git-send-email-seth@userprimary.net","threadId":"13573","inReplyTo":"3c20080519141036.GV396@ziti.local","subject":"[PATCH] Add a --dry-run option to git-svn rebase","fromName":"Seth Falcon","fromEmail":"seth@userprimary.net","sentAt":"2008-05-19T14:20:44Z","receivedAt":"2008-05-19T14:20:44Z","isPatch":true,"sender":{"key":"seth@userprimary.net","avatar":"https://gravatar.com/avatar/1db807504c1f8fb0a13bf1056a1e4d5096d17f3a09a1e9540f3af5f8b5ee009c?d=mp&s=160"},"body":"When working with multiple branches in an svn repository, it can be\nuseful to verify the svn repository and local tracking branch that will\nbe used for the rebase operation.\n\nSigned-off-by: Seth Falcon <seth@userprimary.net>\n---\n Documentation/git-svn.txt |    8 ++++++--\n git-svn.perl              |    6 ++++++\n 2 files changed, 12 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\nindex c6b56b4..5890028 100644\n--- a/Documentation/git-svn.txt\n+++ b/Documentation/git-svn.txt\n@@ -342,11 +342,15 @@ Passed directly to git-rebase when using 'dcommit' if a\n -n::\n --dry-run::\n \n-This is only used with the 'dcommit' command.\n+This can be used with the 'dcommit' and 'rebase' commands.\n \n-Print out the series of git arguments that would show\n+For 'dcommit', print out the series of git arguments that would show\n which diffs would be committed to SVN.\n \n+For 'rebase', display the local branch associated with the upstream svn\n+repository associated with the current branch and the URL of svn\n+repository that will be fetched from.\n+\n --\n \n ADVANCED OPTIONS\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 2c53f39..de52c12 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -176,6 +176,7 @@ my %cmd = (\n \t\t\t  'strategy|s=s' => \\$_strategy,\n \t\t\t  'local|l' => \\$_local,\n \t\t\t  'fetch-all|all' => \\$_fetch_all,\n+                          'dryrun|n' => \\$_dry_run,\n \t\t\t  %fc_opts } ],\n \t'commit-diff' => [ \\&cmd_commit_diff,\n \t                   'Commit a diff between two trees',\n@@ -553,6 +554,11 @@ sub cmd_rebase {\n \t\tdie \"Unable to determine upstream SVN information from \",\n \t\t    \"working tree history\\n\";\n \t}\n+        if ($_dry_run) {\n+                print \"remote-branch: \" . $gs->refname . \"\\n\";\n+                print \"svn-url: \" . $url . \"\\n\";\n+                return;\n+        }\n \tif (command(qw/diff-index HEAD --/)) {\n \t\tprint STDERR \"Cannot rebase with uncommited changes:\\n\";\n \t\tcommand_noisy('status');\n-- \n1.5.5.1.316.g377d9.dirty\n"},{"id":"77298","messageId":"87tzgtygh9.fsf@nav-akl-pcn-343.mitacad.com","threadId":"13573","inReplyTo":"1211206844-29842-1-git-send-email-seth@userprimary.net","subject":"Re: [PATCH] Add a --dry-run option to git-svn rebase","fromName":"Toby Allsopp","fromEmail":"toby.allsopp@navman.co.nz","sentAt":"2008-05-20T00:19:30Z","receivedAt":"2008-05-20T00:19:30Z","isPatch":true,"sender":{"key":"toby.allsopp@navman.co.nz","avatar":null},"body":"On Tue, May 20 2008, Seth Falcon wrote:\n\n[...]\n\n> diff --git a/git-svn.perl b/git-svn.perl\n> index 2c53f39..de52c12 100755\n> --- a/git-svn.perl\n> +++ b/git-svn.perl\n> @@ -176,6 +176,7 @@ my %cmd = (\n>  \t\t\t  'strategy|s=s' => \\$_strategy,\n>  \t\t\t  'local|l' => \\$_local,\n>  \t\t\t  'fetch-all|all' => \\$_fetch_all,\n> +                          'dryrun|n' => \\$_dry_run,\n\ns/dryrun/dry-run/ perhaps?  Also, it looks like you've used spaces\ninstead of tabs.\n\nToby.\n"},{"id":"77299","messageId":"87hcctygah.fsf@nav-akl-pcn-343.mitacad.com","threadId":"13573","inReplyTo":"1211206844-29842-1-git-send-email-seth@userprimary.net","subject":"Re: [PATCH] Add a --dry-run option to git-svn rebase","fromName":"toby.allsopp (toby.allsopp - NAVMAN)","fromEmail":"toby.allsopp@navman.co.nz","sentAt":"2008-05-20T00:19:30Z","receivedAt":"2008-05-20T00:19:30Z","isPatch":true,"sender":{"key":"toby.allsopp@navman.co.nz","avatar":null},"body":"[resending to correct Eric's email address]\n\nOn Tue, May 20 2008, Seth Falcon wrote:\n\n[...]\n\n> diff --git a/git-svn.perl b/git-svn.perl\n> index 2c53f39..de52c12 100755\n> --- a/git-svn.perl\n> +++ b/git-svn.perl\n> @@ -176,6 +176,7 @@ my %cmd = (\n>  \t\t\t  'strategy|s=s' => \\$_strategy,\n>  \t\t\t  'local|l' => \\$_local,\n>  \t\t\t  'fetch-all|all' => \\$_fetch_all,\n> +                          'dryrun|n' => \\$_dry_run,\n\ns/dryrun/dry-run/ perhaps?  Also, it looks like you've used spaces\ninstead of tabs.\n\nToby.\n"},{"id":"77304","messageId":"20080520032458.GF396@ziti.local","threadId":"13573","inReplyTo":"87hcctygah.fsf@nav-akl-pcn-343.mitacad.com","subject":"Re: [PATCH] Add a --dry-run option to git-svn rebase","fromName":"Seth Falcon","fromEmail":"seth@userprimary.net","sentAt":"2008-05-20T03:24:58Z","receivedAt":"2008-05-20T03:24:58Z","isPatch":true,"sender":{"key":"seth@userprimary.net","avatar":"https://gravatar.com/avatar/1db807504c1f8fb0a13bf1056a1e4d5096d17f3a09a1e9540f3af5f8b5ee009c?d=mp&s=160"},"body":"* On 2008-05-20 at 12:19 +1200 toby.allsopp (toby.allsopp - NAVMAN) wrote:\n\n> [resending to correct Eric's email address]\n\nSorry about that, typoed the address.\n\n> s/dryrun/dry-run/ perhaps?  Also, it looks like you've used spaces\n> instead of tabs.\n\nI'll address both of those and resend, thanks.\n\n+ seth\n\n-- \nSeth Falcon | http://userprimary.net/user/\n"},{"id":"77305","messageId":"1211254157-41316-1-git-send-email-seth@userprimary.net","threadId":"13573","inReplyTo":"87hcctygah.fsf@nav-akl-pcn-343.mitacad.com","subject":"[PATCH] Add a --dry-run option to git-svn rebase","fromName":"Seth Falcon","fromEmail":"seth@userprimary.net","sentAt":"2008-05-20T03:29:17Z","receivedAt":"2008-05-20T03:29:17Z","isPatch":true,"sender":{"key":"seth@userprimary.net","avatar":"https://gravatar.com/avatar/1db807504c1f8fb0a13bf1056a1e4d5096d17f3a09a1e9540f3af5f8b5ee009c?d=mp&s=160"},"body":"When working with multiple branches in an svn repository, it can be\nuseful to verify the svn repository and local tracking branch that will\nbe used for the rebase operation.\n\nSigned-off-by: Seth Falcon <seth@userprimary.net>\n---\n\nReworked to fix the spelling of dry-run and whitespace issues.\n\n Documentation/git-svn.txt |    8 ++++++--\n git-svn.perl              |    6 ++++++\n 2 files changed, 12 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\nindex c6b56b4..5890028 100644\n--- a/Documentation/git-svn.txt\n+++ b/Documentation/git-svn.txt\n@@ -342,11 +342,15 @@ Passed directly to git-rebase when using 'dcommit' if a\n -n::\n --dry-run::\n \n-This is only used with the 'dcommit' command.\n+This can be used with the 'dcommit' and 'rebase' commands.\n \n-Print out the series of git arguments that would show\n+For 'dcommit', print out the series of git arguments that would show\n which diffs would be committed to SVN.\n \n+For 'rebase', display the local branch associated with the upstream svn\n+repository associated with the current branch and the URL of svn\n+repository that will be fetched from.\n+\n --\n \n ADVANCED OPTIONS\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 2c53f39..9c60ef4 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -176,6 +176,7 @@ my %cmd = (\n \t\t\t  'strategy|s=s' => \\$_strategy,\n \t\t\t  'local|l' => \\$_local,\n \t\t\t  'fetch-all|all' => \\$_fetch_all,\n+\t\t\t  'dry-run|n' => \\$_dry_run,\n \t\t\t  %fc_opts } ],\n \t'commit-diff' => [ \\&cmd_commit_diff,\n \t                   'Commit a diff between two trees',\n@@ -553,6 +554,11 @@ sub cmd_rebase {\n \t\tdie \"Unable to determine upstream SVN information from \",\n \t\t    \"working tree history\\n\";\n \t}\n+\tif ($_dry_run) {\n+\t\tprint \"remote-branch: \" . $gs->refname . \"\\n\";\n+\t\tprint \"svn-url: \" . $url . \"\\n\";\n+\t\treturn;\n+\t}\n \tif (command(qw/diff-index HEAD --/)) {\n \t\tprint STDERR \"Cannot rebase with uncommited changes:\\n\";\n \t\tcommand_noisy('status');\n-- \n1.5.5.1.316.g377d9.dirty\n"},{"id":"78285","messageId":"20080601101304.GC16064@hand.yhbt.net","threadId":"13573","inReplyTo":"20080530171831.GB76080@ziti.local","subject":"Re: [PATCH] Add a --dry-run option to git-svn rebase","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2008-06-01T10:13:04Z","receivedAt":"2008-06-01T10:13:04Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Seth Falcon <seth@userprimary.net> wrote:\n> Hi Eric,\n> \n> I think this may have slipped by without your notice as I gather\n> things have been busy for you.\n> \n> Could you take a look at this patch and let me know if you like\n> it/hate it/have a suggestion?\n> \n> My motivation was wanting to automate some commit rewritting and\n> wanting a script to be able to determine what the local upstream\n> branch is...\n\nThis patch looks reasonable to me.\nAcked-by: Eric Wong <normalperson@yhbt.net>\n\n> * On 2008-05-19 at 20:29 -0700 Seth Falcon wrote:\n> > @@ -553,6 +554,11 @@ sub cmd_rebase {\n> >  \t\tdie \"Unable to determine upstream SVN information from \",\n> >  \t\t    \"working tree history\\n\";\n> >  \t}\n> > +\tif ($_dry_run) {\n> > +\t\tprint \"remote-branch: \" . $gs->refname . \"\\n\";\n> > +\t\tprint \"svn-url: \" . $url . \"\\n\";\n> > +\t\treturn;\n> > +\t}\n> >  \tif (command(qw/diff-index HEAD --/)) {\n> >  \t\tprint STDERR \"Cannot rebase with uncommited changes:\\n\";\n> >  \t\tcommand_noisy('status');\n\nOne minor nit is 'url' not being capitalized in the output.  Perhaps:\n\n\tRemote Branch: foo\n\tSVN URL: http://asdf/foo/trunk\n\n\nWhich would make it consistent with 'git svn info' using spaces:\n\nRFC822-style headers would be alright, too.\n\n\tRemote-Branch: foo\n\tSVN-URL: http://asdf/foo/trunk\n\nI do however harbor a deep dislike of camel-case\n(used by 'git log --pretty=fuller' and .git/config).\n\n\tRemoteBranch: foo\n\tSvnUrl: http://asdf/foo/trunk\n\n\nHmm, I don't think I've even _noticed_ a real bike shed in decades.\nPerhaps they should be painted purple with yellow polkadots and have the\nwords \"BIKE SHED\" on a flashing neon sign.\n\n-- \nEric Wong\n"},{"id":"78327","messageId":"20080602045639.GB647@ziti.local","threadId":"13573","inReplyTo":"20080601101304.GC16064@hand.yhbt.net","subject":"Re: [PATCH] Add a --dry-run option to git-svn rebase","fromName":"Seth Falcon","fromEmail":"seth@userprimary.net","sentAt":"2008-06-02T04:56:39Z","receivedAt":"2008-06-02T04:56:39Z","isPatch":true,"sender":{"key":"seth@userprimary.net","avatar":"https://gravatar.com/avatar/1db807504c1f8fb0a13bf1056a1e4d5096d17f3a09a1e9540f3af5f8b5ee009c?d=mp&s=160"},"body":"* On 2008-06-01 at 03:13 -0700 Eric Wong wrote:\n> This patch looks reasonable to me.\n> Acked-by: Eric Wong <normalperson@yhbt.net>\n\n> One minor nit is 'url' not being capitalized in the output.\n> Perhaps:\n\nAny of the suggested bike shed colors are fine by me :-) I'll assume\nthe patch is fine as-is, or will be edited by Junio before being\napplied, unless I hear otherwise.\n\n\n-- \nSeth Falcon | http://userprimary.net/user/\n"},{"id":"78333","messageId":"7v7id89z3j.fsf@gitster.siamese.dyndns.org","threadId":"13573","inReplyTo":"20080602045639.GB647@ziti.local","subject":"Re: [PATCH] Add a --dry-run option to git-svn rebase","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-06-02T05:37:20Z","receivedAt":"2008-06-02T05:37:20Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Seth Falcon <seth@userprimary.net> writes:\n\n> * On 2008-06-01 at 03:13 -0700 Eric Wong wrote:\n>> This patch looks reasonable to me.\n>> Acked-by: Eric Wong <normalperson@yhbt.net>\n>\n>> One minor nit is 'url' not being capitalized in the output.\n>> Perhaps:\n>\n> Any of the suggested bike shed colors are fine by me :-) I'll assume\n> the patch is fine as-is, or will be edited by Junio before being\n> applied, unless I hear otherwise.\n\nYeah, I've queued the patch.  Thanks, both.\n"}]}