BUG: git request-pull broken for plain branches
- From
Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
- Date
- Jun 25, 2014, 09:55 UTC
- Message-ID
- <20140625095535.GA27365@pengutronix.de>
Hello,
I have git from Debian's 2.0.0-2 package:
$ git version git version 2.0.0
git request-pull is broken for me:
$ git rev-parse HEAD 9e065e4a5a58308f1a0da4bb80b830929dfa90b3 $ git ls-remote origin | grep 9e065e4a5a58308f1a0da4bb80b830929dfa90b3 9e065e4a5a58308f1a0da4bb80b830929dfa90b3 refs/heads/ukl/for-mainline $ git request-pull origin/master origin HEAD > /dev/null warn: No match for commit 9e065e4a5a58308f1a0da4bb80b830929dfa90b3 found at origin warn: Are you sure you pushed 'HEAD' there?
The same happens on 2.0.0.421.g786a89d.
The problem is in git-request-pull.sh's find_matching_ref. This code has more than one problem (looking on 2.0.0.421.g786a89d):
- find_matching_ref doesn't assign to $found if none of the if conditions in the loop match (this results in my problem); - find_matching_ref happily overwrites $found even if the previous ref was better according to the metric specified above the definition of find_matching_ref; and - the output generated uses $pretty_remote without asserting that it matches $ref. In my case this results in a branch specification of "HEAD" even if I fix find_matching_ref to return refs/heads/ukl/for-mainline.
I tried to add this case to t/t5150-request-pull.sh, but didn't understand how after starring at it for half an hour. :-(
Bisection points on 024d34cb0813 (request-pull: more strictly match local/remote branches) as first bad commit. Apart from introducing the warning, it also changes the branch spec from "ukl/for-mainline" (which is correct) to the name of the current branch (which is bogus). Also 024d34cb0813 makes 5 out of 7 tests in t/t5150-request-pull.sh fail.
Best regards Uwe
-- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ |