{"thread":{"id":"36967","subject":"Surprising 'git-describe --all --match' behavior.","startedAt":"2014-06-19T13:31:07Z","lastAt":"2014-06-19T21:50:38Z","messageCount":6,"participants":["Sergei Organov","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"244643","messageId":"87ionxxbz8.fsf@osv.gnss.ru","threadId":"36967","inReplyTo":null,"subject":"Surprising 'git-describe --all --match' behavior.","fromName":"Sergei Organov","fromEmail":"osv@javad.com","sentAt":"2014-06-19T13:31:07Z","receivedAt":"2014-06-19T13:31:07Z","isPatch":false,"sender":{"key":"osv@javad.com","avatar":null},"body":"Hello,\n\nJust playing with it, got some surprises:\n\n$ git --version\ngit version 1.9.3\n\n$ git describe --all\nheads/v3.5\n$ git describe --all --match 'v*'\ntags/v3.5.6b2-4-gab4bf78\n$ git describe --all --match 'heads/v*'\nfatal: No names found, cannot describe anything.\n\n\n... \"heads/v3.5\" matches neither 'v*' nor 'heads/v*'?\n\n$ git describe --all --match 'v*'\ntags/v3.5.6b2-4-gab4bf78\n$ git describe --all --match 'tags/v*'\nfatal: No names found, cannot describe anything.\n\n... git matches short names when outputs full names?\n\nIs it a defect, or what do I miss?\n\n-- \nSergei.\n"},{"id":"244697","messageId":"xmqqr42khl3l.fsf@gitster.dls.corp.google.com","threadId":"36967","inReplyTo":"87ionxxbz8.fsf@osv.gnss.ru","subject":"Re: Surprising 'git-describe --all --match' behavior.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-06-19T17:20:46Z","receivedAt":"2014-06-19T17:20:46Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sergei Organov <osv@javad.com> writes:\n\n> Just playing with it, got some surprises:\n>\n> $ git --version\n> git version 1.9.3\n>\n> $ git describe --all\n> heads/v3.5\n> $ git describe --all --match 'v*'\n> tags/v3.5.6b2-4-gab4bf78\n> $ git describe --all --match 'heads/v*'\n> fatal: No names found, cannot describe anything.\n\nI think\n\n$ git describe --help\n\n       ...\n       --match <pattern>\n           Only consider tags matching the given glob(7) pattern,\n           excluding the \"refs/tags/\" prefix. This can be used to\n           avoid leaking private tags from the repository.\n       ...\n\nis poorly phrased, especially its \"excluding\" part.  What it wants\nto say is \"You give <pattern> but without refs/tags/, because the\nprogram helpfully always prepend refs/tags/ to your pattern and\nlimit the output to those that match\".  Hence you gave 'v*' as\n<pattern> and limited the output to those that match 'refs/tags/v*'\n(or you gave 'heads/v*' and limited to 'refs/tags/heads/v*').\n"},{"id":"244701","messageId":"87d2e4d8w7.fsf@osv.gnss.ru","threadId":"36967","inReplyTo":"xmqqr42khl3l.fsf@gitster.dls.corp.google.com","subject":"Re: Surprising 'git-describe --all --match' behavior.","fromName":"Sergei Organov","fromEmail":"osv@javad.com","sentAt":"2014-06-19T18:58:00Z","receivedAt":"2014-06-19T18:58:00Z","isPatch":false,"sender":{"key":"osv@javad.com","avatar":null},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Sergei Organov <osv@javad.com> writes:\n>\n>> Just playing with it, got some surprises:\n>>\n>> $ git --version\n>> git version 1.9.3\n>>\n>> $ git describe --all\n>> heads/v3.5\n>> $ git describe --all --match 'v*'\n>> tags/v3.5.6b2-4-gab4bf78\n>> $ git describe --all --match 'heads/v*'\n>> fatal: No names found, cannot describe anything.\n>\n> I think\n>\n> $ git describe --help\n>\n>        ...\n>        --match <pattern>\n>            Only consider tags matching the given glob(7) pattern,\n>            excluding the \"refs/tags/\" prefix. This can be used to\n>            avoid leaking private tags from the repository.\n>        ...\n>\n> is poorly phrased, especially its \"excluding\" part.  What it wants\n> to say is \"You give <pattern> but without refs/tags/, because the\n> program helpfully always prepend refs/tags/ to your pattern and\n> limit the output to those that match\".  Hence you gave 'v*' as\n> <pattern> and limited the output to those that match 'refs/tags/v*'\n> (or you gave 'heads/v*' and limited to 'refs/tags/heads/v*').\n\nOK, thanks, at least I now see how it works. So no <pattern> can ever\nmatch any reference but tag, even when --all switch is given? If so,\nappearance of --match effectively turns --all into --tags, that is still\nrather confusing, isn't it?\n\nWill something break if it won't helpfully prepend refs/tags/ once\n--all is given?\n\n-- \nSergei.\n"},{"id":"244702","messageId":"xmqq38f0hg0h.fsf@gitster.dls.corp.google.com","threadId":"36967","inReplyTo":"87d2e4d8w7.fsf@osv.gnss.ru","subject":"Re: Surprising 'git-describe --all --match' behavior.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-06-19T19:10:38Z","receivedAt":"2014-06-19T19:10:38Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sergei Organov <osv@javad.com> writes:\n\n> Will something break if it won't helpfully prepend refs/tags/ once\n> --all is given?\n\n\"describe --all --match 'v*'\" will no longer match a tag v1.2.3, and\nforces the users to say \"describe --match 'refs/tags/v*'\", and these\nusers will probably see it as a new breakage, I would imagine.\n"},{"id":"244703","messageId":"8761jwd5gk.fsf@osv.gnss.ru","threadId":"36967","inReplyTo":"xmqq38f0hg0h.fsf@gitster.dls.corp.google.com","subject":"Re: Surprising 'git-describe --all --match' behavior.","fromName":"Sergei Organov","fromEmail":"osv@javad.com","sentAt":"2014-06-19T20:12:11Z","receivedAt":"2014-06-19T20:12:11Z","isPatch":false,"sender":{"key":"osv@javad.com","avatar":null},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Sergei Organov <osv@javad.com> writes:\n>\n>> Will something break if it won't helpfully prepend refs/tags/ once\n>> --all is given?\n>\n> \"describe --all --match 'v*'\" will no longer match a tag v1.2.3, and\n> forces the users to say \"describe --match 'refs/tags/v*'\",\n\nNo,\n\ndescirbe --match 'v*'\n\nor\n\ndescribe --tags --match 'v*'\n\ndepending on what they actually meant. Notice my \"once --all is given\"\nabove. \n\nThose who used --all meant to match against all the refs, no?\n\n> and these users will probably see it as a new breakage, I would imagine.\n\nBut why would anybody use --all --match if they only meant --tags\n--match or even just --match alone? Was it historically --all that was\nfirst introduced, maybe? \n\n-- \nSergei.\n"},{"id":"244724","messageId":"xmqq7g4cfu1d.fsf@gitster.dls.corp.google.com","threadId":"36967","inReplyTo":"8761jwd5gk.fsf@osv.gnss.ru","subject":"Re: Surprising 'git-describe --all --match' behavior.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-06-19T21:50:38Z","receivedAt":"2014-06-19T21:50:38Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sergei Organov <osv@javad.com> writes:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> Sergei Organov <osv@javad.com> writes:\n>>\n>>> Will something break if it won't helpfully prepend refs/tags/ once\n>>> --all is given?\n>>\n>> \"describe --all --match 'v*'\" will no longer match a tag v1.2.3, and\n>> forces the users to say \"describe --match 'refs/tags/v*'\",\n>\n> No,\n>\n> descirbe --match 'v*'\n>\n> or\n>\n> describe --tags --match 'v*'\n>\n> depending on what they actually meant. Notice my \"once --all is given\"\n> above.  ...\n> Those who used --all meant to match against all the refs, no?\n\nI noticed it when I responded and ignored it as unworkable, because\nit would make the interface inconsistent by making the meaning of\none option (i.e. --match) change depending on an unrelated option\n(i.e. --all or --tags).\n\nYou can argue both ways: Those who read the doc and used --match\ndid mean to limit to tags.\n\nThe thing is, you cannot change it without risking to break existing\nusage.  That does not necessarily mean you can never change\nanything.  You only need to craft a careful transition plan to\nminimize the pain for those who will be broken, and the end result\nwill be good if the pain is small enough and the benefit is large\nenough ;)\n"}]}