From: "Philip Oakley" <philipoakley@iee.org>
To: "Junio C Hamano" <gitster@pobox.com>, 乙酸鋰 <ch3cooli@gmail.com>
Cc: <git@vger.kernel.org>
Subject: Re: unclear documentation of git fetch --tags option and tagopt config
Date: Thu, 13 Dec 2012 23:54:45 -0000 [thread overview]
Message-ID: <084AB408ED4E4CF3B048B8615658F158@PhilipOakley> (raw)
In-Reply-To: 7v7golzta8.fsf@alter.siamese.dyndns.org
From: "Junio C Hamano" <gitster@pobox.com> Sent: Thursday, December 13,
2012 6:44 PM
> 乙酸鋰 <ch3cooli@gmail.com> writes:
>
>> With git fetch --tags
>> or remote.origin.tagopt = --tags
>> git fetch only fetches tags, but not branches.
>> Current documentation does not mention that no branches are fetched /
>> pulled when --tags option or remote.origin.tagopt = --tags is
>> specified.
>
> In the canonical form you spell out what you want to fetch from
> where, and a lazy "git fetch" or "git fetch origin" that does not
> specify what are to be fetched are the special cases. Because they
> do not say what to fetch, they would become a no-op, which would not
> be very useful, if there is no special casing for them. Instead,
> they use sensible default, taking refspec from the configuration
> variable remote.$name.fetch.
>
> Giving refspecs or the "--tags" option from the command line is a
> way to explicitly override this default, hence:
>
> $ git fetch origin HEAD
>
> only fetches the history leading to the commit at HEAD at the
> remote, ignoring the configured refspecs. As "--tags" is a synonym
> to "refs/tags/*:refs/tags/*", "git fetch --tags origin" tells us to
> ignore refspecs and grab only the tags, i.e.:
>
> $ git fetch origin "refs/tags/*:refs/tags/*"
>
> which does not grab any branches.
>
> You can of course do:
>
> $ git fetch --tags origin
> refs/heads/master:refs/remotes/origin/master
>
> --
What would be the best way of updating the documentation to clarify the
point? Given ch3cooli's previous surprise.
next prev parent reply other threads:[~2012-12-13 23:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-13 6:29 unclear documentation of git fetch --tags option and tagopt config 乙酸鋰
2012-12-13 18:44 ` Junio C Hamano
2012-12-13 23:54 ` Philip Oakley [this message]
2012-12-14 0:13 ` Junio C Hamano
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=084AB408ED4E4CF3B048B8615658F158@PhilipOakley \
--to=philipoakley@iee.org \
--cc=ch3cooli@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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