summaryrefslogtreecommitdiff
path: root/git-debrebase
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2018-07-31 13:16:53 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2018-07-31 13:16:54 +0100
commitc83cc428208bee99de3b75158b9779449403ee1b (patch)
treed8527b23eed180d768adafdc347c52cd69631107 /git-debrebase
parent8b650aeb481a3a4cb71325b6b7255194589c7612 (diff)
git-debrebase: convert-from-gbp: Use same algorithm for finding upstream
The version is in the changelog, and thus upstream commitish can then be found from as new-upstream. This also means we now give the same error message, which is much better than the one we had before. Closes:#905062. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'git-debrebase')
-rwxr-xr-xgit-debrebase13
1 files changed, 10 insertions, 3 deletions
diff --git a/git-debrebase b/git-debrebase
index 5d3c742..2687ef1 100755
--- a/git-debrebase
+++ b/git-debrebase
@@ -1604,11 +1604,18 @@ sub cmd_make_patches () {
}
sub cmd_convert_from_gbp () {
- badusage "needs 1 optional argument, the upstream git rev"
+ badusage "want only 1 optional argument, the upstream git commitish"
unless @ARGV<=1;
+
+ my $clogp = parsechangelog();
+ my $version = $clogp->{'Version'}
+ // die "missing Version from changelog";
+
my ($upstream_spec) = @ARGV;
- $upstream_spec //= 'refs/heads/upstream';
- my $upstream = git_rev_parse $upstream_spec;
+
+ my ($upstream, $upstream_version) =
+ resolve_upstream_version($upstream_spec, $version);
+
my $old_head = get_head();
my $upsdiff = get_differs $upstream, $old_head;