git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Francis Moreau <francis.moro@gmail.com>
To: "Johan 't Hart" <johanthart@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: Question about "git pull --rebase"
Date: Mon, 16 Nov 2009 13:00:36 +0100	[thread overview]
Message-ID: <38b2ab8a0911160400w8eaf3afjf53077e969e8c0f5@mail.gmail.com> (raw)
In-Reply-To: <4B006549.8050803@gmail.com>

On Sun, Nov 15, 2009 at 9:32 PM, Johan 't Hart <johanthart@gmail.com> wrote:
> Junio C Hamano schreef:
>>
>> Johan 't Hart <johanthart@gmail.com> writes:
>>>>
>>>> I've been somehow confused by the git-pull man page, which says:
>>>>
>>>>  A parameter <ref> without a colon is equivalent to <ref>: when
>>>>  pulling/fetching, so it merges <ref> into the current branch without
>>>>  storing the remote branch anywhere locally
>>>>
>
>> Thanks for clearing it up.
>>
>> I was puzzled by the above pointing-finger because I wanted to see where a
>> misinformation originated from to fix it at the source.  But still don't
>> see anything wrong with it.
>>
>
> My guess is that he was confused by '<ref>:' not meaning '<ref>:<ref>'. But
> I can't speak for him ofcource :)
>

Well, I don't remember how I started to think that:

<src>:

was equivalent to

<src>:<current-branch>

so, assuming I'm on branch 'foo':

$ git pull --rebase origin master:

was equivalent to

$ git pull --rebase origin master:foo

hence my confusion, which certainly due to my lack of attention
(sorry) when reading the man page.

> Refspecs confused me too at the beginning... But knowing more and more about
> git, it seems that this part of the docs look OK to me.. At most an example
> might make things a little more clear, but I doubt it is necessary.

Perhaps, the definition of a refspec with an empty string for <dst>
might be clearer if defined on its own. For example, doing this in the
git-pull man page:

      <refspec>
           The format of a <refspec> parameter is an ....

           The remote ref that matches <src> is fetched,

                  if <dst> is not empty string, the local ref that
matches it is fast
                  forwarded using <src>. If the optional plus + is
used, the local ref is
                  updated even if it does not result in a fast forward update.

                  if <dst> is an empty string the fetched <src> is
merged into the
                  current branch without updating any local refs. In
this case the
                  optional + has no meaning.

           Note
                  ....

           Some short-cut notations are also supported.

               . A parameter <src> (<ref> without the ':<dst>' part)
is equivalent
                 to '<src>:' (a ref with an empty string for <dst>).


-- 
Francis

  reply	other threads:[~2009-11-16 12:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-14 20:39 Question about "git pull --rebase" Francis Moreau
2009-11-14 23:16 ` Nanako Shiraishi
2009-11-15 14:31   ` Francis Moreau
2009-11-14 23:29 ` Johan 't Hart
2009-11-15 14:34   ` Francis Moreau
2009-11-15 19:47     ` Johan 't Hart
2009-11-15 20:18       ` Junio C Hamano
2009-11-15 20:32         ` Johan 't Hart
2009-11-16 12:00           ` Francis Moreau [this message]
2009-11-16 12:17   ` Francis Moreau

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=38b2ab8a0911160400w8eaf3afjf53077e969e8c0f5@mail.gmail.com \
    --to=francis.moro@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johanthart@gmail.com \
    /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).