git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] clone: add a --no-tags option to clone without tags

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 19, 2017, 05:32 UTC
Message-ID
<xmqq1ssparom.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<xmqq60i1dvnk.fsf@gitster.mtv.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 17 quoted lines
> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
>
>> Add a --no-tags option to "git clone" to clone without tags. Currently
>> there's no easy way to clone a repository and end up with just a
>> "master" branch via --single-branch, or track all branches and no
>> tags. Now --no-tags can be added to "git clone" with or without
>> --single-branch to clone a repository without tags.
>
> Makes sense.
>
>> +--no-tags::
>> +	Don't clone any tags, and set `remote.origin.tagOpt=--no-tags`
>> +	in the config, ensuring that future `git pull` and `git fetch`
>> +	operations won't fetch any tags.
>
> OK.  Not just we ignore tags during the initial cloning, we set
> things up so that we do not _follow_ tags in subsequent fetches.

I somewhat doubt the utility of this change. "--single-branch" already refrains from grabbing all the tags, and the tags it grabs when "clone" runs and also in subsequent "fetch" are only the ones relevant to that branch. When a user is fetching say 'maint', it is very likely that the user wants tags that are reachable from the tip of 'maint' (if only to make the tip of that branch describable), even though the user would not care about the tags on the other branches that are ahead of 'maint'.

It is not that much code, and carrying it is not that much burden, but I am reasonably sure that I won't use it myself.

Previous: Junio C HamanoNext: Ævar Arnfjörð Bjarmason
Message 6 of 11 in “Is there a way to get 'git fetch --no-tags' semantics with 'git clone'?”
  1. Ævar Arnfjörð BjarmasonApr 14, 2017
  2. clone: add a --no-tags option to clone without tagsÆvar Arnfjörð Bjarmason, Apr 18, 2017
  3. Ævar Arnfjörð BjarmasonApr 18, 2017
  4. Brandon WilliamsApr 18, 2017
  5. Junio C HamanoApr 19, 2017
  6. Junio C HamanoApr 19, 2017
  7. clone: add a --no-tags option to clone without tagsÆvar Arnfjörð Bjarmason, Apr 19, 2017
  8. Jonathan NiederApr 25, 2017
  9. Junio C HamanoApr 26, 2017
  10. Ævar Arnfjörð BjarmasonApr 26, 2017
  11. Jonathan NiederApr 25, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.