Web lists-archives.com

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




Junio C Hamano <gitster@xxxxxxxxx> writes:

> Ævar Arnfjörð Bjarmason  <avarab@xxxxxxxxx> 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.