git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Bryan Turner <bturner@atlassian.com>
To: Andrew Ducker <andrew_ducker@standardlife.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Bug Report - Pull remote branch does not retrieve new tags
Date: Thu, 19 Apr 2018 15:14:20 -0700	[thread overview]
Message-ID: <CAGyf7-G7GDX6DtpAqQvQ-8Rwad1VS6_xdDw_Rt_p5kT-C7dFZA@mail.gmail.com> (raw)
In-Reply-To: <adc410f016e8405fb81fa92e45675e2a@standardlife.com>

Andrew,

On Thu, Apr 19, 2018 at 6:55 AM, Andrew Ducker
<andrew_ducker@standardlife.com> wrote:
>
> What happens:
> When I create a new tag on the remote (changing nothing else)
> "git pull origin master" produces the following:
>   From git.internal.company.com:team/testrepo
>    * branch            master     -> FETCH_HEAD
>   Already up-to-date.
>
> If I instead do a "git pull" I get:
>   From git.internal.company.com:team/testrepo
>    * [new tag]         Testing11  -> Testing11
>   Already up-to-date.
>
> What I think should happen:
> The "git pull origin master" should retrieve the tag.
>
> This is with 2.16.2.windows.1, but also occurred on my previously installed version (2.12.2.windows.2)
>
> My understanding is that "git pull" and "git pull $repo $currentbranch" should function identically.
>
> Is this a bug, or am I misunderstanding the manual page?

Looks like a misunderstanding, to me. Perhaps I can help clarify.

"git pull" without arguments fetches from the "origin" repository
using the configured "fetch" refspecs, which typically looks something
like "fetch = +refs/heads/*:refs/remotes/origin/*". It _doesn't_
actually fetch all tags, but any tag referencing any object/commit
included in the branches is brought along for the ride. This is
documented on "git pull":

--no-tags

    By default, tags that point at objects that are downloaded from
the remote repository are fetched and stored locally. This option
disables this automatic tag following. The default behavior for a
remote may be specified with the remote.<name>.tagOpt setting. See
git-config(1).

By comparison, on your "git pull $repo $currentBranch", what you're
calling "$currentBranch" is actually "[<refspec>...]" from the
documentation. In other words, by passing "master", you've told "git
pull" to fetch _nothing but "master"_, ignoring the configured
refspec(s). Additionally, since you haven't told "git pull" where to
_put_ "master" once it's fetched, it writes it to "FETCH_HEAD". If you
have a tracking branch setup, "git pull origin master" will also
update the tracking branch. For example, the same command for me
produces:

$ git pull origin master
From ...
 * branch                    master     -> FETCH_HEAD
   aca5eb0fef5..ad484477508  master     -> origin/master

As you can see, both FETCH_HEAD and origin/master were updated, since
my local "master" tracks "origin"'s "master":

[branch "master"]
        remote = origin
        merge = refs/heads/master

Hope this helps!
Bryan

  reply	other threads:[~2018-04-19 22:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-19 13:55 Bug Report - Pull remote branch does not retrieve new tags Andrew Ducker
2018-04-19 22:14 ` Bryan Turner [this message]
2018-04-20 10:11   ` Andrew Ducker
2018-04-20 11:41     ` Ævar Arnfjörð Bjarmason

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=CAGyf7-G7GDX6DtpAqQvQ-8Rwad1VS6_xdDw_Rt_p5kT-C7dFZA@mail.gmail.com \
    --to=bturner@atlassian.com \
    --cc=andrew_ducker@standardlife.com \
    --cc=git@vger.kernel.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).