chiark / gitweb /
git-debrebase: new-upstream-v0: allow upstream to be omitted
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 18 Feb 2018 14:16:41 +0000 (14:16 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 16 Jun 2018 15:06:59 +0000 (16:06 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
git-debrebase

index 8e47251..2b38d4f 100755 (executable)
@@ -22,9 +22,9 @@
 # usages:
 #
 #    git-debrebase [<options>] new-upstream-v0 \
-#             <new-version> <orig-commitish> \
+#             <new-version> [<orig-commitish> \
 #            [<extra-orig-name> <extra-orig-commitish> ...] \
-#            [<git-rebase options>...]
+#            [<git-rebase options>...]]
 #
 #    git-debrebase [<options> --] [<git-rebase options...>]
 #    git-debrebase [<options>] analyse
@@ -1025,13 +1025,13 @@ sub cmd_new_upstream_v0 () {
 
     my %pieces;
 
-    badusage "need NEW-VERSION UPS-COMMITTISH" unless @ARGV >= 2;
+    badusage "need NEW-VERSION [UPS-COMMITTISH]" unless @ARGV >= 1;
 
     # parse args - low commitment
     my $new_version = (new Dpkg::Version scalar(shift @ARGV), check => 1);
     my $new_upstream_version = $new_version->version();
 
-    my $new_upstream = git_rev_parse shift @ARGV;
+    my $new_upstream = git_rev_parse (shift @ARGV // 'upstream');
 
     record_ffq_auto();