From: Junio C Hamano <gitster@pobox.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: Erik Cervin Edin <erik@cervined.in>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: [BUG] git fetch fetches tags matching negative refspec
Date: Thu, 13 Oct 2022 08:30:55 -0700 [thread overview]
Message-ID: <xmqqlepjivv4.fsf@gitster.g> (raw)
In-Reply-To: <221013.865ygomybw.gmgdl@evledraar.gmail.com> ("Ævar Arnfjörð Bjarmason"'s message of "Thu, 13 Oct 2022 01:09:36 +0200")
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> Because your refspec doesn't include refs/tags/*:, try e.g.:
>
> git fetch https://github.com/git/git.git 'refs/tags/*:refs/tags/*' --no-tags --dry-run
>
> That's what "--no-tags", i.e. it's per-se (and confusingly) nothing to
> do with whether you get tags or not, it's to do with whether we to tag
> following.
It indeed is confusing and might warrant some clarification, if not
updating.
* "--tags" is equivalent to giving "refs/tags*:refs/tags*", so it
might be natural to expect that you can say the same thing as
above with "fetch $URL --tags --no-tags", but it does not work
that way. Command line parser treats "--tags" and "--no-tags" as
if they follow the "last one wins" semantics.
* As discussed in this thread, what "--no-tags" really means is "do
not follow tags"; there is no way to countermand a "--no-tags"
earlier on the command line to say "earlier we said do not
follow, but we changed our mind. Please do follow tags".
It would have been nice if we had from day one
* "--tags": equivalent to writing "refs/tags/*:refs/tags/*"
* "--no-tags": "earlier we said --tags, but we changed our
mind. Please forget we earlier said --tags".
* "--follow-tags": automatically fetch tags that point at an
object that were fetched (default).
* "--no-follow-tags": stop following tags.
but I do not think it is worth the churn and transition pain to
change it after more than 15 years.
next prev parent reply other threads:[~2022-10-13 15:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-12 8:29 [BUG] git fetch fetches tags matching negative refspec Erik Cervin Edin
2022-10-12 9:11 ` Ævar Arnfjörð Bjarmason
2022-10-12 15:10 ` Erik Cervin Edin
2022-10-12 23:09 ` Ævar Arnfjörð Bjarmason
2022-10-13 8:15 ` Erik Cervin Edin
2022-10-13 15:30 ` Junio C Hamano [this message]
2022-10-18 12:40 ` Erik Cervin Edin
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=xmqqlepjivv4.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=avarab@gmail.com \
--cc=erik@cervined.in \
--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.
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).