{"thread":{"id":"32329","subject":"unclear documentation of git fetch --tags option and tagopt config","startedAt":"2012-12-13T06:29:32Z","lastAt":"2012-12-14T00:13:40Z","messageCount":4,"participants":["乙酸鋰","Junio C Hamano","Philip Oakley"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"204825","messageId":"CAHtLG6Ti7yPFfhTb2qfSKE1+5n4Ftey4DQeqpm3SSL-bOfspUg@mail.gmail.com","threadId":"32329","inReplyTo":null,"subject":"unclear documentation of git fetch --tags option and tagopt config","fromName":"乙酸鋰","fromEmail":"ch3cooli@gmail.com","sentAt":"2012-12-13T06:29:32Z","receivedAt":"2012-12-13T06:29:32Z","isPatch":false,"sender":{"key":"ch3cooli@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2804967?v=4"},"body":"Hi,\n\nWith git fetch --tags\nor remote.origin.tagopt = --tags\ngit fetch only fetches tags, but not branches.\nCurrent documentation does not mention that no branches are fetched /\npulled when --tags option or remote.origin.tagopt = --tags is\nspecified.\n\nRegards,\nch3cooli\n"},{"id":"204844","messageId":"7v7golzta8.fsf@alter.siamese.dyndns.org","threadId":"32329","inReplyTo":"CAHtLG6Ti7yPFfhTb2qfSKE1+5n4Ftey4DQeqpm3SSL-bOfspUg@mail.gmail.com","subject":"Re: unclear documentation of git fetch --tags option and tagopt config","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-12-13T18:44:15Z","receivedAt":"2012-12-13T18:44:15Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"乙酸鋰 <ch3cooli@gmail.com> writes:\n\n> With git fetch --tags\n> or remote.origin.tagopt = --tags\n> git fetch only fetches tags, but not branches.\n> Current documentation does not mention that no branches are fetched /\n> pulled when --tags option or remote.origin.tagopt = --tags is\n> specified.\n\nIn the canonical form you spell out what you want to fetch from\nwhere, and a lazy \"git fetch\" or \"git fetch origin\" that does not\nspecify what are to be fetched are the special cases.  Because they\ndo not say what to fetch, they would become a no-op, which would not\nbe very useful, if there is no special casing for them.  Instead,\nthey use sensible default, taking refspec from the configuration\nvariable remote.$name.fetch.\n\nGiving refspecs or the \"--tags\" option from the command line is a\nway to explicitly override this default, hence:\n\n    $ git fetch origin HEAD\n\nonly fetches the history leading to the commit at HEAD at the\nremote, ignoring the configured refspecs.  As \"--tags\" is a synonym\nto \"refs/tags/*:refs/tags/*\", \"git fetch --tags origin\" tells us to\nignore refspecs and grab only the tags, i.e.:\n\n    $ git fetch origin \"refs/tags/*:refs/tags/*\"\n\nwhich does not grab any branches.\n\nYou can of course do:\n\n    $ git fetch --tags origin refs/heads/master:refs/remotes/origin/master\n"},{"id":"204859","messageId":"084AB408ED4E4CF3B048B8615658F158@PhilipOakley","threadId":"32329","inReplyTo":"7v7golzta8.fsf@alter.siamese.dyndns.org","subject":"Re: unclear documentation of git fetch --tags option and tagopt config","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":null,"receivedAt":"2012-12-13T23:47:40Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Junio C Hamano\" <gitster@pobox.com> Sent: Thursday, December 13, \n2012 6:44 PM\n> 乙酸鋰 <ch3cooli@gmail.com> writes:\n>\n>> With git fetch --tags\n>> or remote.origin.tagopt = --tags\n>> git fetch only fetches tags, but not branches.\n>> Current documentation does not mention that no branches are fetched /\n>> pulled when --tags option or remote.origin.tagopt = --tags is\n>> specified.\n>\n> In the canonical form you spell out what you want to fetch from\n> where, and a lazy \"git fetch\" or \"git fetch origin\" that does not\n> specify what are to be fetched are the special cases.  Because they\n> do not say what to fetch, they would become a no-op, which would not\n> be very useful, if there is no special casing for them.  Instead,\n> they use sensible default, taking refspec from the configuration\n> variable remote.$name.fetch.\n>\n> Giving refspecs or the \"--tags\" option from the command line is a\n> way to explicitly override this default, hence:\n>\n>    $ git fetch origin HEAD\n>\n> only fetches the history leading to the commit at HEAD at the\n> remote, ignoring the configured refspecs.  As \"--tags\" is a synonym\n> to \"refs/tags/*:refs/tags/*\", \"git fetch --tags origin\" tells us to\n> ignore refspecs and grab only the tags, i.e.:\n>\n>    $ git fetch origin \"refs/tags/*:refs/tags/*\"\n>\n> which does not grab any branches.\n>\n> You can of course do:\n>\n>    $ git fetch --tags origin \n> refs/heads/master:refs/remotes/origin/master\n>\n> --\n\nWhat would be the best way of updating the documentation to clarify the \npoint? Given ch3cooli's previous surprise.\n"},{"id":"204861","messageId":"7vd2ydwkwb.fsf@alter.siamese.dyndns.org","threadId":"32329","inReplyTo":"084AB408ED4E4CF3B048B8615658F158@PhilipOakley","subject":"Re: unclear documentation of git fetch --tags option and tagopt config","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-12-14T00:13:40Z","receivedAt":"2012-12-14T00:13:40Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Philip Oakley\" <philipoakley@iee.org> writes:\n\n> What would be the best way of updating the documentation to clarify the \n> point? Given ch3cooli's previous surprise.\n\nOh, thanks for bringing it up.  I was about to start another message\nthat begins with \"Having said all that...\" ;-)\n\nI think the entire paragraph should be rewritten.  The first long\nsentence explains that you will get tags that point at the branches\nand other stuff you follow by default, so there is no need to\nexplicitly ask for tags most of the time.  While that is true, it is\nsecondary in describing what \"--tags\" is about.  It is to grab all\ntags and store them locally, and that needs to come at the very\nbeginning.\n\nAnd that auto-following behaviour is already described in the\nprevious entry for -n/--no-tags.  So how about something like this:\n\n\tThis is a short-hand for giving \"refs/tags/*:refs/tags/*\"\n\trefspec from the command line, to ask all tags to be fetched\n\tand stored locally.\n\nNote that it is deliberate that the above does not mention tagopt\nconfiguration at all.  The variable was primarily meant to be used\nwith --no-tags, so that with this:\n\n    [remote \"origin\"] tagopt = --no-tags\n\nyou can \"git fetch origin\" to keep up with the development on\nbranches without having to fetch tags from there.  Fetching tags and\nonly tags from a remote is almost always not what you want; in other\nwords, remote.\"origin\".tagopt set to --tags is a misconfiguration\n99% of the time, unless you are only interested in following tagged\nrelease points.\n"}]}