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>
Cc: Junio C Hamano <gitster@pobox.com>,
	Git Mailing List <git@vger.kernel.org>,
	kernel@pengutronix.de
Subject: Re: BUG: git request-pull broken for plain branches
Date: Wed, 25 Jun 2014 15:21:31 +0200	[thread overview]
Message-ID: <20140625132131.GO14781@pengutronix.de> (raw)
In-Reply-To: <CA+55aFwZb7tT7xb7y2XJpzcmrxB=Rf--bjz5XbBcxC-7MMm9eg@mail.gmail.com>

Hello Linus,

On Wed, Jun 25, 2014 at 05:05:51AM -0700, Linus Torvalds wrote:
> On Wed, Jun 25, 2014 at 2:55 AM, Uwe Kleine-König
> <u.kleine-koenig@pengutronix.de> wrote:
> >
> >         $ 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?
> 
> Notice how "HEAD" does not match.
> 
> The error message is perhaps misleading. It's not enough to match the
> commit. You need to match the branch name too. git used to guess the
> branch name (from the commit), and it often guessed wrongly. So now
> they need to match.
> 
> So you should do
> 
>     git request-pull origin/master origin ukl/for-mainline
> 
> to let request-pull know that you're requesting a pull for "ukl/for-mainline".
> 
> If you have another name for that branch locally (ie you did something
> like "git push origin local:remote"), then you can say
> 
>     git request-pull origin/master origin local-name:remote-name
> 
> to specify what the branch to be pulled is called locally vs remotely.
> 
> In other words, what used to be "pick some branch randomly" is now
> "you need to _specify_ the branch".
ah, got it. Still some of my concerns stay valid and I also have some
new ones:

 - if there is a branch and a tag on the remote side that match what I
   specified the outcome depends on the order of git-ls-remote. (minor
   nit.)
 - if I have to specify the remote name now, why do I have to also
   specify my local ref? Isn't the respective $sha1 of the remote side
   enough to do what is needed?
 - Isn't $found = $sha1; silly because I cannot pull a rev, only a ref?
   (side note:

   	git pull linus d91d66e88ea95b6dd21958834414009614385153

   gives no error message, only returns 1 and does nothing else.)
 - Is the result of

 	git request-pull $somecommit origin

   what is intended? For me it does

   	...
	are available in the git repository at:

	  $repository

	for you to fetch changes ...

   if the remote HEAD matches the local one. I'd prefer to have an
   explicit branch name there, or at least HEAD.

I liked git guessing the branch name, maybe we can teach it to guess a
bit better than it did before 2.0? Something like:

 - if there is a unique match on the remote side, use it.
 - if there are >= 1 match on the remote side and exactly one matches
   what I specified as <end>, use it.
 - if there are >= 1 match on the remote side and exactly one of them is
   a tag, use the tag
 - if there are two matches on the remote side, and one is "HEAD",
   pick the other one.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

  reply	other threads:[~2014-06-25 13:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-25  9:55 BUG: git request-pull broken for plain branches Uwe Kleine-König
2014-06-25 12:05 ` Linus Torvalds
2014-06-25 13:21   ` Uwe Kleine-König [this message]
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=20140625132131.GO14781@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).