summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog2
-rwxr-xr-xgit-debrebase13
-rw-r--r--git-debrebase.1.pod2
3 files changed, 14 insertions, 3 deletions
diff --git a/debian/changelog b/debian/changelog
index ef70f6e..4d6e50a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,8 @@ dgit (6.3~) unstable; urgency=medium
with bad syntax.
* git-debrebase test suite: Test messages about unprocessable commits.
* git-debrebase: new-upstream: Fix handling of epochs.
+ * git-debrebase: convert-from-gbp: Use same algorithm for finding
+ upstream commitish as new-upstream. Closes:#905062.
--
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;
diff --git a/git-debrebase.1.pod b/git-debrebase.1.pod
index 273ef47..b15bf00 100644
--- a/git-debrebase.1.pod
+++ b/git-debrebase.1.pod
@@ -250,6 +250,8 @@ the gbp upstream branch, if there is one.
It is a snag if it is not an ancestor of HEAD,
or if the history between the upstream and HEAD
contains commits which make changes to upstream files.
+If it is not specified,
+the same algorithm is used as for git-debrebase new-upstream.
It is also a snag if the specified upstream
has a debian/ subdirectory.