improved heuristic for --upstream-branch

Bug #637739 reported by Rolf Leggewie
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
git-buildpackage (Debian)
Fix Released
Unknown
git-buildpackage (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: git-buildpackage

the current default for gbp and friends is to use HEAD of the upstream branch for --upstream-branch. Thinking about bug 615212, I felt that gbp could do much better than this. Consider the very simple commit graph in http://launchpadlibrarian.net/55567353/graph.txt for example. Let's say that commit X were to correspond to the lenny package, for example, and you want to make a security release or backport an important bugfix to stable. You branch off X and commit X'. When you now build against X' the default is to use the HEAD of upstream which is wrong and gbp has the necessary information to determine it is wrong.

I think gbp should the find the "highest" common ancestor on the upstream branch and use that for --upstream-branch. I'm sure there is a ready-made, easy tool in git to do this.

Revision history for this message
Rolf Leggewie (r0lf) wrote :

git merge-base is what you want, I think, more specifically --upstream-branch should default to $(git merge-base HEAD upstream)

Revision history for this message
Guido Günther (agx) wrote : Re: [Bug 637739] [NEW] improved heuristic for --upstream-branch

On Tue, Sep 14, 2010 at 03:17:08AM -0000, Launchpad Bug Tracker wrote:
> You have been subscribed to a public bug by Rolf Leggewie (r0lf):
>
> Binary package hint: git-buildpackage
>
> the current default for gbp and friends is to use HEAD of the upstream
> branch for --upstream-branch. Thinking about bug 615212, I felt that
> gbp could do much better than this. Consider the very simple commit
> graph in http://launchpadlibrarian.net/55567353/graph.txt for example.
> Let's say that commit X were to correspond to the lenny package, for
> example, and you want to make a security release or backport an
> important bugfix to stable. You branch off X and commit X'. When you
> now build against X' the default is to use the HEAD of upstream which is
> wrong and gbp has the necessary information to determine it is wrong.
>
> I think gbp should the find the "highest" common ancestor on the
> upstream branch and use that for --upstream-branch. I'm sure there is a
> ready-made, easy tool in git to do this.

Something like this is on the todo list since quiet some time, however
we can even do better and look at the specific tag of that upstream
version which so guessing is needed at all. This was delayed by #534494.

The corresponding Debian Bug is #564791.
 -- Guido

Changed in git-buildpackage (Debian):
status: Unknown → New
Changed in git-buildpackage (Debian):
status: New → Fix Committed
Changed in git-buildpackage (Debian):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.