Previous import merge detection bug

Bug #1648029 reported by mdes@hp.com
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
git-upstream
Fix Released
Undecided
Unassigned

Bug Description

Using git-upstream 0.12.1, I have a scenario whereby a no-op merge which appears between the tip of the local branch and the merge-base with the upstream branch, is being incorrectly detected as being the previous import merge.

I've log --graphical tree attached to illustrate the scenario.

The reason for the mistake is that the merge commit that is detected as being the previous import merge is a 'no-op' merge - the change(LC7) that it's merging into tree was also submitted upstream and had already been imported onto the local branch before LC7 was merged.

Revision history for this message
mdes@hp.com (mdes) wrote :
Revision history for this message
mdes@hp.com (mdes) wrote :
Download full text (4.5 KiB)

Git-upstream-import log (truncated past the point of previous-merge-point detection):

(git-upstream-latest) 2016-12-02.14:11 desbonne@kilcolgan2:~/tmp/neutron$ git-upstream --version
git-upstream 0.12.1
(git-upstream-latest) 2016-12-02.14:13 desbonne@kilcolgan2:~/tmp/neutron$ script -f git-upstream-import.log -c 'git-upstream -vvv import --import-branch hp/import/desbonne --into hp/prerelease/mitaka stable/mitaka'
Script started, file is git-upstream-import.log
Searching for previous import
Searching for most recent merge base with upstream branches
Upstream refs:
    stable/mitaka

Construct list of upstream revs to search:
    git rev-list --min-parents=1 --no-walk \
        stable/mitaka

Retrieve minimal list of revs to check with merge-base by excluding
revisions that are in the reachable from others in the list:
    git rev-list \
        c86f1ab75a97c4ea23c2533bc1d8d2b7baaae037 \
        --not \
        fe14343fabc21341f630d8bfd4dfce1b98524508

Running merge-base against each found upstream revision and target
    git merge-base hp/prerelease/mitaka ${upstream_rev}

Order the possible merge-base commits in descendent order, to
find the most recent one used irrespective of date:
    git rev-list --topo-order --max-count=1 --no-walk \
        0bc12bc4b3dd22cb1bcd34c3ff54225f14abe491

Most recent merge-base commit is: '0bc12bc4b3dd22cb1bcd34c3ff54225f14abe491'
Searching for previous merges that exclude one side of the history
since the last import.
    git rev-list --ancestry-path --merges 0bc12bc4b3dd22cb1bcd34c3ff54225f14abe491..hp/prerelease/mitaka

previous upstream: 0bc12bc4b3dd22cb1bcd34c3ff54225f14abe491
merge-base: 0bc12bc4b3dd22cb1bcd34c3ff54225f14abe491
parent: f716d76df03d080651a41c5e5bcbd72dec8744d3

previous upstream: 0bc12bc4b3dd22cb1bcd34c3ff54225f14abe491
merge-base: 0bc12bc4b3dd22cb1bcd34c3ff54225f14abe491
parent: a086cc5466e759843cc5a4002fb0500ceb5982e0

previous upstream: 0bc12bc4b3dd22cb1bcd34c3ff54225f14abe491
merge-base: 0bc12bc4b3dd22cb1bcd34c3ff54225f14abe491
parent: 43b9d0d734ca1736e040f76193b51f6ba69f544b

previous upstream: 0bc12bc4b3dd22cb1bcd34c3ff54225f14abe491
merge-base: 0bc12bc4b3dd22cb1bcd34c3ff54225f14abe491
parent: 903173e1ac39099eca5cac69b6af8063f993b430

previous upstream: 0bc12bc4b3dd22cb1bcd34c3ff54225f14abe491
merge-base: 0bc12bc4b3dd22cb1bcd34c3ff54225f14abe491
parent: 9c997bdf1c3099ae5e29b87ba506aaf532e7a2ab

previous upstream: 0bc12bc4b3dd22cb1bcd34c3ff54225f14abe491
merge-base: 0bc12bc4b3dd22cb1bcd34c3ff54225f14abe491
parent: c255028efdcf680d18d9bd7d03e9e52a55f0ed22

previous upstream: 0bc12bc4b3dd22cb1bcd34c3ff54225f14abe491
merge-base: 0bc12bc4b3dd22cb1bcd34c3ff54225f14abe491
parent: bf60247966cab6e5daa3c1c11c380905e2dce630

previous upstream: 0bc12bc4b3dd22cb1bcd34c3ff54225f14abe491
merge-base: 0bc12bc4b3dd22cb1bcd34c3ff54225f14abe491
parent: 8c0631957c850179fc133be802ab16839abd8722

previous upstream: 0bc12bc4b3dd22cb1bcd34c3ff54225f14abe491
merge-base: 0bc12bc4b3dd22cb1bcd34c3ff54225f14abe491
parent: 28bc9ac70d5dab1e4a55c63b3ea6c34629062b51

Adding following to ignore list:
    ^47c94110decc765eab3e606b13da0eedbfabe823

Found the previous import merge:
    7a5a28e59ac76d14a8d2b8432ef70311...

Read more...

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to git-upstream (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/408004

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Related fix proposed to branch: master
Review: https://review.openstack.org/408215

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

Reviewed: https://review.openstack.org/408215
Committed: https://git.openstack.org/cgit/openstack/git-upstream/commit/?id=0100a7e1d56e140d2e831fb032cc1d35973c3b3c
Submitter: Jenkins
Branch: master

commit 0100a7e1d56e140d2e831fb032cc1d35973c3b3c
Author: Darragh Bailey <email address hidden>
Date: Wed Dec 7 16:35:37 2016 +0000

    Find better import merge commit candidate

    Continue checking until the last possible candidate has been inspected
    in case we encountered a merge commit that looks a lot like an import
    merge commit does.

    It is possible for a merge to occur where the commit brought in does
    not contribute anything to the resulting tree. In such cases the merge
    commit will appear TREESAME to the previous state of the branch, and
    will be mistaken to be an import merge. Ensure if there is an
    additional merge commit to be considered that it is also checked.

    Change-Id: If5694506b59e1288e23aecbe6e0bf8297574c72a
    Related-Bug: #1648029

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/408216
Committed: https://git.openstack.org/cgit/openstack/git-upstream/commit/?id=ccae7b1a63328a32afb55d2748748fb6231a3a45
Submitter: Jenkins
Branch: master

commit ccae7b1a63328a32afb55d2748748fb6231a3a45
Author: Darragh Bailey <email address hidden>
Date: Wed Dec 7 16:46:15 2016 +0000

    Handle non contributing merges where no import

    Catch a non-contributing merge of a commit where it's parent is within
    the ancestry path to the previous upstream imported.

    Add it to a list of commits to be stripped to ensure when encountered
    it is removed from being attempted to be re-played.

    Change-Id: Ibf5034a4eec5a92097cc38120959fcc12a44af74
    Related-Bug: #1648029

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

Reviewed: https://review.openstack.org/408245
Committed: https://git.openstack.org/cgit/openstack/git-upstream/commit/?id=6415738c1c3c9d26774f3e0f814d122f549ccf8b
Submitter: Jenkins
Branch: master

commit 6415738c1c3c9d26774f3e0f814d122f549ccf8b
Author: Darragh Bailey <email address hidden>
Date: Wed Dec 7 17:44:32 2016 +0000

    Handle multiple non-contributing commits being merged

    When encountering multiple non-contributing commits included in a merge
    that is TREESAME to the existing contents, ensure a list of all commits
    being brought in by that merge are included in the list to be pruned
    from history.

    Change-Id: I643e0923f8967f9b70d10b8796688b782681bfe0
    Closes-Bug: #1648029

Changed in git-upstream:
status: New → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on git-upstream (master)

Change abandoned by Darragh Bailey (<email address hidden>) on branch: master
Review: https://review.openstack.org/408004
Reason: https://review.openstack.org/408215 fixes this in a slightly different way. We may decided to change again in the future but for now, I'll close this one off.

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.