All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: "Carlsson\, Magnus" <Magnus.Carlsson@arris.com>,
	"git\@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: git fetch with refspec does not include tags?
Date: Thu, 17 Aug 2017 12:38:58 -0700	[thread overview]
Message-ID: <xmqq1soagf1p.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20170817092853.hteuzni5lxia4ejf@sigill.intra.peff.net> (Jeff King's message of "Thu, 17 Aug 2017 05:28:54 -0400")

Jeff King <peff@peff.net> writes:

>   # no tags, we just populate FETCH_HEAD because of the bare URL
>   git fetch ../parent
>
>   # this does fetch tags, because we're storing the result according to
>   # the configured refspec ("refs/heads/*:refs/remotes/origin/*").
>   git fetch origin

The above two look good.

>   # this doesn't fetch tags, as the main command is "just" populating
>   # FETCH_HEAD. But then our logic for "hey, we fetched the ref for
>   # refs/remotes/origin/master, so let's update it on the side" kicks
>   # in. And we end up updating FETCH_HEAD _and_ the tracking branch, but
>   # not the tags. Weird.
>   git fetch origin master

Yes, it looks weird, but I suspect that it is probably more correct
not to fetch tags in this case.  I wonder if it would be a solution
not to do the "on the side" thing---after all the user didn't tell
us to update refs/remotes/origin/master with this command line.

Then not following tags will be in line with all of the above
reasoning above.

>   # and this one does fetch tags, because we have a real destination.
>   git fetch origin master:foo

Yup, that is expected.

> So what I'd say is:
>
>   1. Definitely these defaults are under-documented. I couldn't find
>      them anywhere in git-fetch(1).

Yup.

>   2. If we continue to follow the "are we storing any refs" rule for the
>      default, possibly it should expand to "did we store anything,
>      including opportunistic tracking-ref updates".

That also is a workable way to make things consistent.

  parent reply	other threads:[~2017-08-17 19:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1502960406180.9006@arris.com>
2017-08-17  9:02 ` git fetch with refspec does not include tags? Carlsson, Magnus
2017-08-17  9:28   ` Jeff King
2017-08-17 11:29     ` Carlsson, Magnus
2017-08-17 14:22       ` Jeff King
2017-08-17 19:41         ` Junio C Hamano
2017-08-17 19:38     ` Junio C Hamano [this message]
2017-08-17 20:22       ` Kevin Daudt
2017-08-17 20:38         ` Junio C Hamano
2017-08-17 20:43           ` Kevin Daudt
2017-08-20  7:47             ` Jeff King
2017-08-20  7:50               ` Jeff King
2017-08-20 15:51                 ` Junio C Hamano

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=xmqq1soagf1p.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=Magnus.Carlsson@arris.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.