public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Yukai Chou <muzimuzhi@gmail.com>, git@vger.kernel.org
Subject: Re: Tags auto fetched by "git fetch origin" but not "git fetch origin main"
Date: Thu, 29 Aug 2024 22:22:08 +0000	[thread overview]
Message-ID: <ZtD0kJU_OdBBktZ2@tapette.crustytoothpaste.net> (raw)
In-Reply-To: <xmqqy14ft36l.fsf@gitster.g>

[-- Attachment #1: Type: text/plain, Size: 1995 bytes --]

On 2024-08-29 at 21:44:02, Junio C Hamano wrote:
> "brian m. carlson" <sandals@crustytoothpaste.net> writes:
> 
> > If you want tags nonetheless, you can use the `--tags` option, which
> > should fetch tags in addition to the refspec provided.
> 
> But doesn't that grab _all_ tags, not only the relevant tags that
> point into the history leading to the commits being fetched?

It's not clear to me.  The description says this:

  By default, any tag that points into the histories being fetched is
  also fetched; the effect is to fetch tags that point at branches that
  you are interested in. This default behavior can be changed by using
  the --tags or --no-tags options or by configuring
  remote.<name>.tagOpt. By using a refspec that fetches tags explicitly,
  you can fetch tags that do not point into branches you are interested
  in as well.

That implies that `--tags` or `--no-tags` simply changes whether that
limited set of tags is fetched.

But the `--tags` option says this:

  Fetch all tags from the remote (i.e., fetch remote tags refs/tags/* into
  local tags with the same name), in addition to whatever else would
  otherwise be fetched. Using this option alone does not subject tags to
  pruning, even if --prune is used (though tags may be pruned anyway if
  they are also the destination of an explicit refspec; see --prune).

That implies that all tags are fetched.

I think we need somebody to test things and clarify the documentation.
(I'm not volunteering because I have a lot of things on my plate right
now.)

In addition, it might be useful to add a `--relevant-tags` option or
some such that simply fetches the relevant tags when arbitrary refspecs
are specified.  If someone felt super interested, they could even make
an additional generic option over other refspecs (I can imagine
something like GitHub's refs/pull might be interesting for users).
-- 
brian m. carlson (they/them or he/him)
Toronto, Ontario, CA

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

  reply	other threads:[~2024-08-29 22:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-28 23:23 Tags auto fetched by "git fetch origin" but not "git fetch origin main" Yukai Chou
2024-08-29 21:32 ` brian m. carlson
2024-08-29 21:44   ` Junio C Hamano
2024-08-29 22:22     ` brian m. carlson [this message]
2024-08-29 22:38       ` Junio C Hamano
2024-08-29 23:16   ` Yukai Chou

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=ZtD0kJU_OdBBktZ2@tapette.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=muzimuzhi@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