git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Erik Cervin Edin <erik@cervined.in>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [BUG] git fetch fetches tags matching negative refspec
Date: Wed, 12 Oct 2022 11:11:47 +0200	[thread overview]
Message-ID: <221012.86mta1mmli.gmgdl@evledraar.gmail.com> (raw)
In-Reply-To: <CA+JQ7M-CN0UnHQDDDVz0kPcU1AcoL9+WFOeR8eiw_B=Yiyc-CA@mail.gmail.com>


On Wed, Oct 12 2022, Erik Cervin Edin wrote:

> Thank you for filling out a Git bug report!
> Please answer the following questions to help us understand your issue.
>
> What did you do before the bug happened? (Steps to reproduce your issue)
>
> Delete all v2.9.* tags
>   git tag | grep ^v2.9.* | xargs git tag -d
>
> Change standard the standard fetch configuration
> [remote "origin"]
>     url = git@github.com:git/git.git
>     fetch = +refs/heads/*:refs/remotes/origin/*
>
> By adding a negative respec for tags matching v2.9.*
> [remote "origin"]
>     url = git@github.com:git/git.git
>     fetch = +refs/heads/*:refs/remotes/origin/*
>     fetch = ^refs/tags/v2.9.*
>
> run
>   git fetch
>
> What did you expect to happen? (Expected behavior)
>
> To exclude tags matchings v2.9*, just like when running git fetch --tags
>
> What happened instead? (Actual behavior)
>
> Without specifying git fetch --tags, tags matching the negative
> refspec are still fetched
>
> What's different between what you expected and what actually happened?
>
> The negative refspec appears to be ignored or overruled when running
> git fetch without the --tags flag
>
> Anything else you want to add:
> I love git, thank you! ♥
>
> Please review the rest of the bug report below.
> You can delete any lines you don't wish to share.

I haven't had time to try this, but I believe this isn't a bug, it's
just that you didn't supply --no-tags.

"But I want some tags!", yes, that's not what --no-tags does, see the
2nd paragraph of the DESCRIPTION section of "git-fetch".

I.e. it got stuff you asked for, but also tags pointing at the main
history, --no-tags will stop that, at which point you can *also* fetch
tags, just with the refspec.


  reply	other threads:[~2022-10-12  9:13 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 [this message]
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
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

  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=221012.86mta1mmli.gmgdl@evledraar.gmail.com \
    --to=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.
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).