Cannot import when there is multiple tags on same commits
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
git-upstream | Status tracked in Trunk | |||||
0.12 |
Fix Released
|
Undecided
|
Unassigned | |||
Trunk |
Fix Released
|
Medium
|
Darragh Bailey |
Bug Description
I'm trying to import 2015.1.4 tag from Nova project.
This tag also matches an existing tag: kilo-eol.
To import a specific tag, I created a temporary branch:
git branch temp-import/
I can import (without merge) just fine:
git-upstream import --no-merge temp-import/
However git-upstream is using the tag kilo-eol to construct the import branch resulting in using import/kilo-eol instead of the expected import/2015.1.4.
Thus when finalizing the import:
git-upstream import --finish --into local/kilo --import-branch import/2015.1.4 temp-import/
I get this error:
Searching for previous import
Merging import to requested branch 'local/kilo'
ERROR : Failed to finish import by merging branch:
'
into and replacing the contents of:
'local/kilo'
ERROR : 'git merge --no-commit -s ours import/2015.1.4' returned with exit code 128
stderr: 'fatal: import/2015.1.4 - not something we can merge'
I end up with those branches being created:
import/kilo-eol
import/
Instead of the "expected" branches with import/2015.1.4 prefix.
description: | updated |
Changed in git-upstream: | |
status: | Incomplete → Confirmed |
importance: | Undecided → Medium |
I've been able to reproduce this, but only if I skip one of the steps mentioned above.
To set up a test repo I've doing the following in the base of git-upstream:
# reset to commit at HEAD of master at the time 7d618d68b3fd57c 60e701ff8a tests/commands/ import/ interactive_ scenarios/ basic.yaml bin/activate trees/basic
git checkout b7dc443ea0b0fef
tox -e py27
tox -e build-tree -- git_upstream/
source .tox/py27/
cd .git-test-
git tag 2015.1.4 upstream/master
Then I've followed your steps (with the only different is that I'm using master as target):
git branch temp-import/ 2015.1. 4 2015.1.4 2015.1. 4
git-upstream import --no-merge temp-import/
Which returned the following output:
Searching for previous import
Starting import of upstream
Successfully created import branch
Attempting to linearise previous changes
Successfully applied all locally carried changes
Import complete, not merging to target branch 'HEAD' as
requested.
And then running:
git-upstream import --finish --into master --import-branch import/2015.1.4 temp-import/ 2015.1. 4
Returned:
Searching for previous import 2015.1. 4'
Merging import to requested branch 'master'
Successfully finished import:
target branch: 'master'
upstream branch: 'temp-import/
import branch: 'import/2015.1.4'
However when I run the following steps instead:
git branch temp-import/ 2015.1. 4 2015.1.4 2015.1. 4
# note no import with --no-merge
git-upstream import --finish --into master --import-branch import/2015.1.4 temp-import/
I see the response of:
Searching for previous import
Merging import to requested branch 'master'
ERROR : Failed to finish import by merging branch: 'import/2015.1.4'
With commit: 'import/2015.1.4'
into and replacing the contents of: 'master'
ERROR : 'git merge --no-commit -s ours import/2015.1.4' returned with exit code 1
stderr: 'merge: import/2015.1.4 - not something we can merge'
So I'm wondering if perhaps this was just accidental missing a step? As the Nova project is more complex it may not be obvious when running 'git log --decorate --graph --all --oneline' as to what exactly is happening that a step was missed, and also I believe there were other bugs causing some problems.
Any chance you could retest the steps you used with both the commit from git-upstream at the time, and if it does reproduce could you attach a log file (using 'git upstream --log-level debug --log-file myimport.log ...' for both commands will work just fine) from that run and then confirm whether it still occurs with the latest HEAD as well.