git-upstream finds extra commits when changing the upstream branch tracked

Bug #1380652 reported by Darragh Bailey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
git-upstream
Fix Released
High
Darragh Bailey

Bug Description

git-upstream should be able to handle switching which upstream ref is being tracked and still be able to determine the correct set of local changes to be carried. At the very least it should provide the capability to be told what other references to search when looking for the previous point that imported from.

Simple use case would be switching from mainline to a stable branch, which diverges from master and then after a period of time to want to switch back to the latest master. Currently git-upstream will see the merge-base between master and the stable branch as the last import. Unfortunately this means any fixes to the stable branch will also be picked up and believed to also be local changes that should be replayed onto the new import.

The impact of this is lessened since the filters in git-upstream will spot any duplicate ChangeIds and discard as already being on master. So backports from master to stable branches are not an issue, however any unique release only changes will cause problems.

Revision history for this message
Darragh Bailey (dbailey-k) wrote :

Example using ascii art:

--------------------------------I -> local/master
                                         /
                          F---G---H -> previous import branch
                         /
                D---E -> upstream/stable
               /
A---B---C---J---K---L -> upstream/master

when running 'git upstream import --into local/master upstream/master' the previous import commit found will be 'C' when it should be 'E'.

It should be possible at least to tell git-upstream to scan both upstream/stable and upstream/master to find the most recent point from any upstream reference that is reachable and to use that as the previous import commit.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to git-upstream (master)

Reviewed: https://review.openstack.org/129319
Committed: https://git.openstack.org/cgit/stackforge/git-upstream/commit/?id=83669ee54bdaa991230c9a14f19db5773f6161d4
Submitter: Jenkins
Branch: master

commit 83669ee54bdaa991230c9a14f19db5773f6161d4
Author: Darragh Bailey <email address hidden>
Date: Fri Oct 17 16:17:35 2014 +0100

    Add support and CLI option to search multiple refs for last import

    When auto-detecting the most recent point in the history of the current
    branch to be updated that came from upstream, need to support searching
    more than the given upstream reference where the user is switching the
    upstream branch being tracked.

    Use a default of 'upstream/*' and add a CLI option to set a different
    pattern to be searched in cases where the repository is not using the
    same naming.

    The CLI option '--search-refs' may be specified multiple times to
    provide multiple ref patterns to be searched using simple globbing. The
    default if none provided by the user is 'upstream/*'.

    Change-Id: If890d1bee015d6b495a5caa60dd8f7783cf7c4e0
    Closes-Bug: #1380652

Changed in git-upstream:
status: New → Fix Committed
Changed in git-upstream:
assignee: nobody → Darragh Bailey (dbailey-k)
importance: Undecided → High
Changed in git-upstream:
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.