git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, kernel@pengutronix.de
Subject: BUG: git request-pull broken for plain branches
Date: Wed, 25 Jun 2014 11:55:35 +0200	[thread overview]
Message-ID: <20140625095535.GA27365@pengutronix.de> (raw)

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/  |

             reply	other threads:[~2014-06-25  9:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-25  9:55 Uwe Kleine-König [this message]
2014-06-25 12:05 ` BUG: git request-pull broken for plain branches Linus Torvalds
2014-06-25 13:21   ` Uwe Kleine-König
2014-06-25 20:41     ` Junio C Hamano
2014-06-26  7:06       ` Uwe Kleine-König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140625095535.GA27365@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=kernel@pengutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).