{"thread":{"id":"39919","subject":"[PATCH v5 0/2] refs: cleanup and new behavior","startedAt":"2015-07-22T21:05:31Z","lastAt":"2015-07-24T00:51:37Z","messageCount":13,"participants":["Jacob Keller","Junio C Hamano","Eric Sunshine","Keller, Jacob E"],"isPatch":true,"patchVersion":5,"patchTotal":2},"messages":[{"id":"266632","messageId":"1437599133-13012-1-git-send-email-jacob.e.keller@intel.com","threadId":"39919","inReplyTo":null,"subject":"[PATCH v5 0/2] refs: cleanup and new behavior","fromName":"Jacob Keller","fromEmail":"jacob.e.keller@intel.com","sentAt":"2015-07-22T21:05:31Z","receivedAt":"2015-07-22T21:05:31Z","isPatch":true,"sender":{"key":"jacob.e.keller@intel.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"From: Jacob Keller <jacob.keller@gmail.com>\n\nAs per Junio's suggestion, break cleanup/fix and new functionality into\nseparate patches. Also update description of the new functionality.\n\nThe first patch is entirely cleanup of comments with no functionality\nchange at all (indeed only changes to comment text!). It now correctly\nhighlights all characters which are disallowed. Discovered by creating a\ntest function that printed out the whole list.\n\nThe second patch introduces the new functionality for \"*\" and details\nhow it is now checked per-component. It also explains how the flags are\nnow passed as a pointer so that we can reject any multi-\"*\" reference,\nby clearing the REFNAME_REFSPEC_PATTERN bit.\n\nChange since v4\n- split the cleanup to a separate patch and included all missing values\n  from the disposition \"4\" on the comments.\n\nJacob Keller (2):\n  refs: cleanup comments regarding check_refname_component\n  refs: loosen restriction on wildcard \"*\" refspecs\n\n Documentation/git-check-ref-format.txt |  4 ++--\n refs.c                                 | 44 +++++++++++++++++++---------------\n refs.h                                 |  4 ++--\n t/t1402-check-ref-format.sh            |  8 ++++---\n 4 files changed, 34 insertions(+), 26 deletions(-)\n\n-- \n2.4.3\n"},{"id":"266633","messageId":"1437599133-13012-2-git-send-email-jacob.e.keller@intel.com","threadId":"39919","inReplyTo":"1437599133-13012-1-git-send-email-jacob.e.keller@intel.com","subject":"[PATCH 1/2] refs: cleanup comments regarding check_refname_component","fromName":"Jacob Keller","fromEmail":"jacob.e.keller@intel.com","sentAt":"2015-07-22T21:05:32Z","receivedAt":"2015-07-22T21:05:32Z","isPatch":true,"sender":{"key":"jacob.e.keller@intel.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"From: Jacob Keller <jacob.keller@gmail.com>\n\nCorrectly specify all characters which are rejected under the '4'\ndisposition, including '*' even though it does gain special treatment by\ncallers of check_refname_component.\n\nCleanup comment style for rejected refs by inserting a \", or\" at the end\nof each statement.\n\nSigned-off-by: Jacob Keller <jacob.keller@gmail.com>\nCc: Daniel Barkalow <barkalow@iabervon.iabervon.org>\nCc: Junio C Hamano <gitster@pobox.com>\n---\n refs.c | 12 +++++++-----\n 1 file changed, 7 insertions(+), 5 deletions(-)\n\ndiff --git a/refs.c b/refs.c\nindex ce8cd8d45001..8c08fc0489eb 100644\n--- a/refs.c\n+++ b/refs.c\n@@ -19,7 +19,8 @@ struct ref_lock {\n  * 1: End-of-component\n  * 2: ., look for a preceding . to reject .. in refs\n  * 3: {, look for a preceding @ to reject @{ in refs\n- * 4: A bad character: ASCII control characters, \"~\", \"^\", \":\" or SP\n+ * 4: A bad character: ASCII control characters, and\n+ *    \"*\", \":\", \"?\", \"[\", \"\\\", \"^\", \"~\", SP, or TAB\n  */\n static unsigned char refname_disposition[256] = {\n \t1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,\n@@ -70,10 +71,11 @@ static unsigned char refname_disposition[256] = {\n  *\n  * - any path component of it begins with \".\", or\n  * - it has double dots \"..\", or\n- * - it has ASCII control character, \"~\", \"^\", \":\" or SP, anywhere, or\n- * - it ends with a \"/\".\n- * - it ends with \".lock\"\n- * - it contains a \"\\\" (backslash)\n+ * - it has ASCII control characters, or\n+ * - it has \"*\", \":\", \"?\", \"[\", \"\\\", \"^\", \"~\", SP, or TAB anywhere, or\n+ * - it ends with a \"/\", or\n+ * - it ends with \".lock\", or\n+ * - it contains a \"@{\" portion\n  */\n static int check_refname_component(const char *refname, int flags)\n {\n-- \n2.4.3\n"},{"id":"266634","messageId":"1437599133-13012-3-git-send-email-jacob.e.keller@intel.com","threadId":"39919","inReplyTo":"1437599133-13012-1-git-send-email-jacob.e.keller@intel.com","subject":"[PATCH 2/2] refs: loosen restriction on wildcard \"*\" refspecs","fromName":"Jacob Keller","fromEmail":"jacob.e.keller@intel.com","sentAt":"2015-07-22T21:05:33Z","receivedAt":"2015-07-22T21:05:33Z","isPatch":true,"sender":{"key":"jacob.e.keller@intel.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"From: Jacob Keller <jacob.keller@gmail.com>\n\nModify logic of check_refname_component and add a new disposition\nregarding \"*\". Allow refspecs that contain a single \"*\" if\nREFNAME_REFSPEC_PATTERN is set. Change the function to pass the flags as\na pointer, and clear REFNAME_REFSPEC_PATTERN after the first \"*\" so that\nonly a single \"*\" is accepted.\n\nThis loosens restrictions on refspecs by allowing patterns that have\na \"*\" within a component instead of only as the whole component. Also\nremove the code that hangled refspec patterns in check_refname_format\nsince it is now handled via the check_refname_component logic.\n\nNow refs such as `for/bar*:foo/bar*` and even `foo/bar*:foo/baz*` will\nbe accepted. This allows users more control over what is fetched where.\nSince users must modify the default by hand to make use of this\nfunctionality it is not considered a large risk. Any refspec which\nfunctioned before shall continue functioning with the new logic.\n\nSigned-off-by: Jacob Keller <jacob.keller@gmail.com>\nCc: Daniel Barkalow <barkalow@iabervon.iabervon.org>\nCc: Junio C Hamano <gitster@pobox.com>\n---\n Documentation/git-check-ref-format.txt |  4 ++--\n refs.c                                 | 36 +++++++++++++++++++---------------\n refs.h                                 |  4 ++--\n t/t1402-check-ref-format.sh            |  8 +++++---\n 4 files changed, 29 insertions(+), 23 deletions(-)\n\ndiff --git a/Documentation/git-check-ref-format.txt b/Documentation/git-check-ref-format.txt\nindex fc02959ba4ab..9044dfaadae1 100644\n--- a/Documentation/git-check-ref-format.txt\n+++ b/Documentation/git-check-ref-format.txt\n@@ -94,8 +94,8 @@ OPTIONS\n \tInterpret <refname> as a reference name pattern for a refspec\n \t(as used with remote repositories).  If this option is\n \tenabled, <refname> is allowed to contain a single `*`\n-\tin place of a one full pathname component (e.g.,\n-\t`foo/*/bar` but not `foo/bar*`).\n+\tin the refspec (e.g., `foo/bar*/baz` or `foo/bar*baz/`\n+\tbut not `foo/bar*/baz*`).\n \n --normalize::\n \tNormalize 'refname' by removing any leading slash (`/`)\ndiff --git a/refs.c b/refs.c\nindex 8c08fc0489eb..16a1d8305579 100644\n--- a/refs.c\n+++ b/refs.c\n@@ -20,12 +20,13 @@ struct ref_lock {\n  * 2: ., look for a preceding . to reject .. in refs\n  * 3: {, look for a preceding @ to reject @{ in refs\n  * 4: A bad character: ASCII control characters, and\n- *    \"*\", \":\", \"?\", \"[\", \"\\\", \"^\", \"~\", SP, or TAB\n+ *    \":\", \"?\", \"[\", \"\\\", \"^\", \"~\", SP, or TAB\n+ * 5: *, reject unless REFNAME_REFSPEC_PATTERN is set\n  */\n static unsigned char refname_disposition[256] = {\n \t1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,\n \t4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,\n-\t4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 2, 1,\n+\t4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 2, 1,\n \t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 4,\n \t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n \t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 4, 0,\n@@ -72,12 +73,13 @@ static unsigned char refname_disposition[256] = {\n  * - any path component of it begins with \".\", or\n  * - it has double dots \"..\", or\n  * - it has ASCII control characters, or\n- * - it has \"*\", \":\", \"?\", \"[\", \"\\\", \"^\", \"~\", SP, or TAB anywhere, or\n+ * - it has \":\", \"?\", \"[\", \"\\\", \"^\", \"~\", SP, or TAB anywhere, or\n+ * - it has \"*\" anywhere unless REFNAME_REFSPEC_PATTERN is set, or\n  * - it ends with a \"/\", or\n  * - it ends with \".lock\", or\n  * - it contains a \"@{\" portion\n  */\n-static int check_refname_component(const char *refname, int flags)\n+static int check_refname_component(const char *refname, int *flags)\n {\n \tconst char *cp;\n \tchar last = '\\0';\n@@ -98,6 +100,16 @@ static int check_refname_component(const char *refname, int flags)\n \t\t\tbreak;\n \t\tcase 4:\n \t\t\treturn -1;\n+\t\tcase 5:\n+\t\t\tif (!(*flags & REFNAME_REFSPEC_PATTERN))\n+\t\t\t\treturn -1; /* refspec can't be a pattern */\n+\n+\t\t\t/*\n+\t\t\t * Unset the pattern flag so that we only accept a single glob for\n+\t\t\t * the entire refspec.\n+\t\t\t */\n+\t\t\t*flags &= ~ REFNAME_REFSPEC_PATTERN;\n+\t\t\tbreak;\n \t\t}\n \t\tlast = ch;\n \t}\n@@ -122,18 +134,10 @@ int check_refname_format(const char *refname, int flags)\n \n \twhile (1) {\n \t\t/* We are at the start of a path component. */\n-\t\tcomponent_len = check_refname_component(refname, flags);\n-\t\tif (component_len <= 0) {\n-\t\t\tif ((flags & REFNAME_REFSPEC_PATTERN) &&\n-\t\t\t\t\trefname[0] == '*' &&\n-\t\t\t\t\t(refname[1] == '\\0' || refname[1] == '/')) {\n-\t\t\t\t/* Accept one wildcard as a full refname component. */\n-\t\t\t\tflags &= ~REFNAME_REFSPEC_PATTERN;\n-\t\t\t\tcomponent_len = 1;\n-\t\t\t} else {\n-\t\t\t\treturn -1;\n-\t\t\t}\n-\t\t}\n+\t\tcomponent_len = check_refname_component(refname, &flags);\n+\t\tif (component_len <= 0)\n+\t\t\treturn -1;\n+\n \t\tcomponent_count++;\n \t\tif (refname[component_len] == '\\0')\n \t\t\tbreak;\ndiff --git a/refs.h b/refs.h\nindex e82fca51f501..1809a1d57577 100644\n--- a/refs.h\n+++ b/refs.h\n@@ -278,8 +278,8 @@ extern int for_each_reflog(each_ref_fn, void *);\n  * to the rules described in Documentation/git-check-ref-format.txt.\n  * If REFNAME_ALLOW_ONELEVEL is set in flags, then accept one-level\n  * reference names.  If REFNAME_REFSPEC_PATTERN is set in flags, then\n- * allow a \"*\" wildcard character in place of one of the name\n- * components.  No leading or repeated slashes are accepted.\n+ * allow a single \"*\" wildcard character in the refspec. No leading or\n+ * repeated slashes are accepted.\n  */\n extern int check_refname_format(const char *refname, int flags);\n \ndiff --git a/t/t1402-check-ref-format.sh b/t/t1402-check-ref-format.sh\nindex e5dc62e9efbf..0790edf60de2 100755\n--- a/t/t1402-check-ref-format.sh\n+++ b/t/t1402-check-ref-format.sh\n@@ -62,9 +62,11 @@ invalid_ref 'heads/foo\\bar'\n invalid_ref \"$(printf 'heads/foo\\t')\"\n invalid_ref \"$(printf 'heads/foo\\177')\"\n valid_ref \"$(printf 'heads/fu\\303\\237')\"\n-invalid_ref 'heads/*foo/bar' --refspec-pattern\n-invalid_ref 'heads/foo*/bar' --refspec-pattern\n-invalid_ref 'heads/f*o/bar' --refspec-pattern\n+valid_ref 'heads/*foo/bar' --refspec-pattern\n+valid_ref 'heads/foo*/bar' --refspec-pattern\n+valid_ref 'heads/f*o/bar' --refspec-pattern\n+invalid_ref 'heads/f*o*/bar' --refspec-pattern\n+invalid_ref 'heads/foo*/bar*' --refspec-pattern\n \n ref='foo'\n invalid_ref \"$ref\"\n-- \n2.4.3\n"},{"id":"266636","messageId":"xmqqio9brgrj.fsf@gitster.dls.corp.google.com","threadId":"39919","inReplyTo":"1437599133-13012-3-git-send-email-jacob.e.keller@intel.com","subject":"Re: [PATCH 2/2] refs: loosen restriction on wildcard \"*\" refspecs","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-07-22T22:04:16Z","receivedAt":"2015-07-22T22:04:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jacob Keller <jacob.e.keller@intel.com> writes:\n\n> From: Jacob Keller <jacob.keller@gmail.com>\n>\n> Modify logic of check_refname_component and add a new disposition\n> regarding \"*\". Allow refspecs that contain a single \"*\" if\n> REFNAME_REFSPEC_PATTERN is set. Change the function to pass the flags as\n> a pointer, and clear REFNAME_REFSPEC_PATTERN after the first \"*\" so that\n> only a single \"*\" is accepted.\n>\n> This loosens restrictions on refspecs by allowing patterns that have\n> a \"*\" within a component instead of only as the whole component. Also\n> remove the code that hangled refspec patterns in check_refname_format\n> since it is now handled via the check_refname_component logic.\n>\n> Now refs such as `for/bar*:foo/bar*` and even `foo/bar*:foo/baz*` will\n> be accepted. This allows users more control over what is fetched where.\n> Since users must modify the default by hand to make use of this\n> functionality it is not considered a large risk. Any refspec which\n> functioned before shall continue functioning with the new logic.\n\n\nThanks.  Now I can read the changes to the code in these two commits\nand see that they both make sense ;-)\n\nThe above description seem to use \"ref\" and \"refspec\" rather\nliberally, so I'll rewrite some parts of it to clarify while\nqueuing.\n\nBy the way, have you run test suite before sending this (or any\nprevious round of this) patch?  This seems to break t5511-refspec.sh\nfor me.\n\n \n"},{"id":"266638","messageId":"CA+P7+xo4xYVsoitBk7SJhQtHU9_dXFiOpWefUr_8M96GqX8W1w@mail.gmail.com","threadId":"39919","inReplyTo":"xmqqio9brgrj.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH 2/2] refs: loosen restriction on wildcard \"*\" refspecs","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2015-07-22T23:24:48Z","receivedAt":"2015-07-22T23:24:48Z","isPatch":true,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Wed, Jul 22, 2015 at 3:04 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Jacob Keller <jacob.e.keller@intel.com> writes:\n>\n>> From: Jacob Keller <jacob.keller@gmail.com>\n>>\n>> Modify logic of check_refname_component and add a new disposition\n>> regarding \"*\". Allow refspecs that contain a single \"*\" if\n>> REFNAME_REFSPEC_PATTERN is set. Change the function to pass the flags as\n>> a pointer, and clear REFNAME_REFSPEC_PATTERN after the first \"*\" so that\n>> only a single \"*\" is accepted.\n>>\n>> This loosens restrictions on refspecs by allowing patterns that have\n>> a \"*\" within a component instead of only as the whole component. Also\n>> remove the code that hangled refspec patterns in check_refname_format\n>> since it is now handled via the check_refname_component logic.\n>>\n>> Now refs such as `for/bar*:foo/bar*` and even `foo/bar*:foo/baz*` will\n>> be accepted. This allows users more control over what is fetched where.\n>> Since users must modify the default by hand to make use of this\n>> functionality it is not considered a large risk. Any refspec which\n>> functioned before shall continue functioning with the new logic.\n>\n>\n> Thanks.  Now I can read the changes to the code in these two commits\n> and see that they both make sense ;-)\n>\n> The above description seem to use \"ref\" and \"refspec\" rather\n> liberally, so I'll rewrite some parts of it to clarify while\n> queuing.\n>\n> By the way, have you run test suite before sending this (or any\n> previous round of this) patch?  This seems to break t5511-refspec.sh\n> for me.\n>\n>\n>\n\nLooks like another location I forgot to update. I can send a re-spin\nif you need with the following diff. Basically looks like the tests\njust didn't get updated to count the new behavior is valid.\n\ndiff --git i/t/t5511-refspec.sh w/t/t5511-refspec.sh\nindex de6db86ccff0..7bfca7962d41 100755\n--- i/t/t5511-refspec.sh\n+++ w/t/t5511-refspec.sh\n@@ -71,11 +71,11 @@ test_refspec fetch ':refs/remotes/frotz/HEAD-to-me'\n test_refspec push ':refs/remotes/frotz/delete me'              invalid\n test_refspec fetch ':refs/remotes/frotz/HEAD to me'            invalid\n\n-test_refspec fetch 'refs/heads/*/for-linus:refs/remotes/mine/*-blah' invalid\n-test_refspec push 'refs/heads/*/for-linus:refs/remotes/mine/*-blah' invalid\n+test_refspec fetch 'refs/heads/*/for-linus:refs/remotes/mine/*-blah'\n+test_refspec push 'refs/heads/*/for-linus:refs/remotes/mine/*-blah'\n\n-test_refspec fetch 'refs/heads*/for-linus:refs/remotes/mine/*' invalid\n-test_refspec push 'refs/heads*/for-linus:refs/remotes/mine/*' invalid\n+test_refspec fetch 'refs/heads*/for-linus:refs/remotes/mine/*'\n+test_refspec push 'refs/heads*/for-linus:refs/remotes/mine/*'\n\n test_refspec fetch 'refs/heads/*/*/for-linus:refs/remotes/mine/*' invalid\n test_refspec push 'refs/heads/*/*/for-linus:refs/remotes/mine/*' invalid\n\n\n\n\nRegards,\nJake\n"},{"id":"266666","messageId":"xmqqa8umrfge.fsf@gitster.dls.corp.google.com","threadId":"39919","inReplyTo":"CA+P7+xo4xYVsoitBk7SJhQtHU9_dXFiOpWefUr_8M96GqX8W1w@mail.gmail.com","subject":"Re: [PATCH 2/2] refs: loosen restriction on wildcard \"*\" refspecs","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-07-23T16:44:49Z","receivedAt":"2015-07-23T16:44:49Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jacob Keller <jacob.keller@gmail.com> writes:\n\n>> By the way, have you run test suite before sending this (or any\n>> previous round of this) patch?  This seems to break t5511-refspec.sh\n>> for me.\n>\n> Looks like another location I forgot to update. I can send a re-spin\n> if you need with the following diff. Basically looks like the tests\n> just didn't get updated to count the new behavior is valid.\n\nYeah, basically looks like an untested patch was sent and nobody\nnoticed during earlier rounds, even the patch was rerolled a few\ntimes, before I finally took it to 'pu' to take a look.  A typical\nslow summer moment---people rightfully find it is more important to\nhave fun themselves than to help polishing others' patches ;-).\n\nWill squash the changes; no need to resend (unless people discover\nother issues; let's hope that I wouldn't be the one to do so ;-).\n\nThanks.\n\n> diff --git i/t/t5511-refspec.sh w/t/t5511-refspec.sh\n> index de6db86ccff0..7bfca7962d41 100755\n> --- i/t/t5511-refspec.sh\n> +++ w/t/t5511-refspec.sh\n> @@ -71,11 +71,11 @@ test_refspec fetch ':refs/remotes/frotz/HEAD-to-me'\n>  test_refspec push ':refs/remotes/frotz/delete me'              invalid\n>  test_refspec fetch ':refs/remotes/frotz/HEAD to me'            invalid\n>\n> -test_refspec fetch 'refs/heads/*/for-linus:refs/remotes/mine/*-blah' invalid\n> -test_refspec push 'refs/heads/*/for-linus:refs/remotes/mine/*-blah' invalid\n> +test_refspec fetch 'refs/heads/*/for-linus:refs/remotes/mine/*-blah'\n> +test_refspec push 'refs/heads/*/for-linus:refs/remotes/mine/*-blah'\n>\n> -test_refspec fetch 'refs/heads*/for-linus:refs/remotes/mine/*' invalid\n> -test_refspec push 'refs/heads*/for-linus:refs/remotes/mine/*' invalid\n> +test_refspec fetch 'refs/heads*/for-linus:refs/remotes/mine/*'\n> +test_refspec push 'refs/heads*/for-linus:refs/remotes/mine/*'\n>\n>  test_refspec fetch 'refs/heads/*/*/for-linus:refs/remotes/mine/*' invalid\n>  test_refspec push 'refs/heads/*/*/for-linus:refs/remotes/mine/*' invalid\n>\n>\n>\n>\n> Regards,\n> Jake\n"},{"id":"266676","messageId":"CA+P7+xq8gSMYRD2SMNqDz8WL+A8y1jBPTBMQG_ckP-CeXk8X2A@mail.gmail.com","threadId":"39919","inReplyTo":"xmqqa8umrfge.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH 2/2] refs: loosen restriction on wildcard \"*\" refspecs","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2015-07-23T16:51:53Z","receivedAt":"2015-07-23T16:51:53Z","isPatch":true,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Thu, Jul 23, 2015 at 9:44 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Jacob Keller <jacob.keller@gmail.com> writes:\n>\n>>> By the way, have you run test suite before sending this (or any\n>>> previous round of this) patch?  This seems to break t5511-refspec.sh\n>>> for me.\n>>\n>> Looks like another location I forgot to update. I can send a re-spin\n>> if you need with the following diff. Basically looks like the tests\n>> just didn't get updated to count the new behavior is valid.\n>\n> Yeah, basically looks like an untested patch was sent and nobody\n> noticed during earlier rounds, even the patch was rerolled a few\n> times, before I finally took it to 'pu' to take a look.  A typical\n> slow summer moment---people rightfully find it is more important to\n> have fun themselves than to help polishing others' patches ;-).\n>\n\nI think what happened, is that I ran some tests when the patch was\n\"configurable\" and I had modified the one set of tests to try with the\noption enabled, but it didn't fail in the t5511-refspec.sh since this\nseries of tests didn't enable the new option. Then, I never re-tested\nagain (OOPS!) when I removed the optional portion.\n\n> Will squash the changes; no need to resend (unless people discover\n> other issues; let's hope that I wouldn't be the one to do so ;-).\n>\n> Thanks.\n>\n\nThank you! :)\n\nRegards,\nJake\n\n>> diff --git i/t/t5511-refspec.sh w/t/t5511-refspec.sh\n>> index de6db86ccff0..7bfca7962d41 100755\n>> --- i/t/t5511-refspec.sh\n>> +++ w/t/t5511-refspec.sh\n>> @@ -71,11 +71,11 @@ test_refspec fetch ':refs/remotes/frotz/HEAD-to-me'\n>>  test_refspec push ':refs/remotes/frotz/delete me'              invalid\n>>  test_refspec fetch ':refs/remotes/frotz/HEAD to me'            invalid\n>>\n>> -test_refspec fetch 'refs/heads/*/for-linus:refs/remotes/mine/*-blah' invalid\n>> -test_refspec push 'refs/heads/*/for-linus:refs/remotes/mine/*-blah' invalid\n>> +test_refspec fetch 'refs/heads/*/for-linus:refs/remotes/mine/*-blah'\n>> +test_refspec push 'refs/heads/*/for-linus:refs/remotes/mine/*-blah'\n>>\n>> -test_refspec fetch 'refs/heads*/for-linus:refs/remotes/mine/*' invalid\n>> -test_refspec push 'refs/heads*/for-linus:refs/remotes/mine/*' invalid\n>> +test_refspec fetch 'refs/heads*/for-linus:refs/remotes/mine/*'\n>> +test_refspec push 'refs/heads*/for-linus:refs/remotes/mine/*'\n>>\n>>  test_refspec fetch 'refs/heads/*/*/for-linus:refs/remotes/mine/*' invalid\n>>  test_refspec push 'refs/heads/*/*/for-linus:refs/remotes/mine/*' invalid\n>>\n>>\n>>\n>>\n>> Regards,\n>> Jake\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"266668","messageId":"xmqq1tfyre46.fsf@gitster.dls.corp.google.com","threadId":"39919","inReplyTo":"xmqqa8umrfge.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH 2/2] refs: loosen restriction on wildcard \"*\" refspecs","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-07-23T17:13:45Z","receivedAt":"2015-07-23T17:13:45Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Will squash the changes; no need to resend (unless people discover\n> other issues; let's hope that I wouldn't be the one to do so ;-).\n>\n> Thanks.\n>\n>> diff --git i/t/t5511-refspec.sh w/t/t5511-refspec.sh\n>> index de6db86ccff0..7bfca7962d41 100755\n>> --- i/t/t5511-refspec.sh\n>> +++ w/t/t5511-refspec.sh\n>> @@ -71,11 +71,11 @@ test_refspec fetch ':refs/remotes/frotz/HEAD-to-me'\n\nThat was whitespace damaged, so I had to hand-tweak the file in\nplace.  While at it, I noticed that we do not check a case where\nmultiple asterisks appear in a single component (which is rejected\nfor a reason different from having multiple components with an\nasterisk in them), which also deserves its own test.\n\nI'll squash in the following instead.\n\nThere is a slightly related tangent I noticed while doing so.\n\nI wonder if there is an obvious and unambiguous interpretation of\nwhat this command line wants to do:\n\n    $ git fetch origin refs/heads/*g*/for-linus:refs/remotes/i-*/mine\n\nWe _might_ want to allow one (and only one) component with more than\none asterisk on the LHS of a refspec, while requiring only one\nasterisk on the RHS to allow \"this '*g*' is just like '*' but\nexcluding things that do not have 'g' in it\".\n\nOr it may not be worth the additional complexity.\n\n\n t/t5511-refspec.sh | 11 +++++++----\n 1 file changed, 7 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t5511-refspec.sh b/t/t5511-refspec.sh\nindex de6db86..f541f30 100755\n--- a/t/t5511-refspec.sh\n+++ b/t/t5511-refspec.sh\n@@ -71,15 +71,18 @@ test_refspec fetch ':refs/remotes/frotz/HEAD-to-me'\n test_refspec push ':refs/remotes/frotz/delete me'\t\tinvalid\n test_refspec fetch ':refs/remotes/frotz/HEAD to me'\t\tinvalid\n \n-test_refspec fetch 'refs/heads/*/for-linus:refs/remotes/mine/*-blah' invalid\n-test_refspec push 'refs/heads/*/for-linus:refs/remotes/mine/*-blah' invalid\n+test_refspec fetch 'refs/heads/*/for-linus:refs/remotes/mine/*-blah'\n+test_refspec push 'refs/heads/*/for-linus:refs/remotes/mine/*-blah'\n \n-test_refspec fetch 'refs/heads*/for-linus:refs/remotes/mine/*' invalid\n-test_refspec push 'refs/heads*/for-linus:refs/remotes/mine/*' invalid\n+test_refspec fetch 'refs/heads*/for-linus:refs/remotes/mine/*'\n+test_refspec push 'refs/heads*/for-linus:refs/remotes/mine/*'\n \n test_refspec fetch 'refs/heads/*/*/for-linus:refs/remotes/mine/*' invalid\n test_refspec push 'refs/heads/*/*/for-linus:refs/remotes/mine/*' invalid\n \n+test_refspec fetch 'refs/heads/*g*/for-linus:refs/remotes/mine/*' invalid\n+test_refspec push 'refs/heads/*g*/for-linus:refs/remotes/mine/*' invalid\n+\n test_refspec fetch 'refs/heads/*/for-linus:refs/remotes/mine/*'\n test_refspec push 'refs/heads/*/for-linus:refs/remotes/mine/*'\n \n"},{"id":"266669","messageId":"CA+P7+xq1BYg6xE3pWJbXadEPbm2tcyRhOoy9-Scsx7Bj2krJqw@mail.gmail.com","threadId":"39919","inReplyTo":"xmqq1tfyre46.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH 2/2] refs: loosen restriction on wildcard \"*\" refspecs","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2015-07-23T17:18:35Z","receivedAt":"2015-07-23T17:18:35Z","isPatch":true,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Thu, Jul 23, 2015 at 10:13 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> That was whitespace damaged, so I had to hand-tweak the file in\n> place.  While at it, I noticed that we do not check a case where\n> multiple asterisks appear in a single component (which is rejected\n> for a reason different from having multiple components with an\n> asterisk in them), which also deserves its own test.\n>\n\nOops. Sorry about that..\n\n> I'll squash in the following instead.\n>\n> There is a slightly related tangent I noticed while doing so.\n>\n> I wonder if there is an obvious and unambiguous interpretation of\n> what this command line wants to do:\n>\n>     $ git fetch origin refs/heads/*g*/for-linus:refs/remotes/i-*/mine\n>\n\nPersonally, I do think this is \"obvious\" but I don't think that our\nparser is at all smart enough to handle it. The  advantage with the\ncurrent code, is that the match parser already handles it perfectly.\nIt was just the rules up front which limited how much we could do. I\ndon't think the added complexity is that valuable here.. For most\ncommon cases it's just prefixes or suffixes that matter.\n\n> We _might_ want to allow one (and only one) component with more than\n> one asterisk on the LHS of a refspec, while requiring only one\n> asterisk on the RHS to allow \"this '*g*' is just like '*' but\n> excluding things that do not have 'g' in it\".\n>\n\nAs above, I think it's obvious the intended meaning, but... the actual\ninterpretation could be a variety of things. It's not guaranteed to be\ninterpreted in that way, and while we could document it, I don't think\nthat it is worth the complexity unless someone actually needs this\nbehavior.\n\n> Or it may not be worth the additional complexity.\n>\n\nBelow diff looks fine, thanks!\n\nRegards,\nJake\n\n>\n>  t/t5511-refspec.sh | 11 +++++++----\n>  1 file changed, 7 insertions(+), 4 deletions(-)\n>\n> diff --git a/t/t5511-refspec.sh b/t/t5511-refspec.sh\n> index de6db86..f541f30 100755\n> --- a/t/t5511-refspec.sh\n> +++ b/t/t5511-refspec.sh\n> @@ -71,15 +71,18 @@ test_refspec fetch ':refs/remotes/frotz/HEAD-to-me'\n>  test_refspec push ':refs/remotes/frotz/delete me'              invalid\n>  test_refspec fetch ':refs/remotes/frotz/HEAD to me'            invalid\n>\n> -test_refspec fetch 'refs/heads/*/for-linus:refs/remotes/mine/*-blah' invalid\n> -test_refspec push 'refs/heads/*/for-linus:refs/remotes/mine/*-blah' invalid\n> +test_refspec fetch 'refs/heads/*/for-linus:refs/remotes/mine/*-blah'\n> +test_refspec push 'refs/heads/*/for-linus:refs/remotes/mine/*-blah'\n>\n> -test_refspec fetch 'refs/heads*/for-linus:refs/remotes/mine/*' invalid\n> -test_refspec push 'refs/heads*/for-linus:refs/remotes/mine/*' invalid\n> +test_refspec fetch 'refs/heads*/for-linus:refs/remotes/mine/*'\n> +test_refspec push 'refs/heads*/for-linus:refs/remotes/mine/*'\n>\n>  test_refspec fetch 'refs/heads/*/*/for-linus:refs/remotes/mine/*' invalid\n>  test_refspec push 'refs/heads/*/*/for-linus:refs/remotes/mine/*' invalid\n>\n> +test_refspec fetch 'refs/heads/*g*/for-linus:refs/remotes/mine/*' invalid\n> +test_refspec push 'refs/heads/*g*/for-linus:refs/remotes/mine/*' invalid\n> +\n>  test_refspec fetch 'refs/heads/*/for-linus:refs/remotes/mine/*'\n>  test_refspec push 'refs/heads/*/for-linus:refs/remotes/mine/*'\n>\n"},{"id":"266687","messageId":"CAPig+cRS0NcNcw-0wG4mThN_PW0RoN3b09Yu2GzCr=UFPLYd6A@mail.gmail.com","threadId":"39919","inReplyTo":"1437599133-13012-3-git-send-email-jacob.e.keller@intel.com","subject":"Re: [PATCH 2/2] refs: loosen restriction on wildcard \"*\" refspecs","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2015-07-23T22:00:55Z","receivedAt":"2015-07-23T22:00:55Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Wed, Jul 22, 2015 at 5:05 PM, Jacob Keller <jacob.e.keller@intel.com> wrote:\n> From: Jacob Keller <jacob.keller@gmail.com>\n>\n> Modify logic of check_refname_component and add a new disposition\n> regarding \"*\". Allow refspecs that contain a single \"*\" if\n> REFNAME_REFSPEC_PATTERN is set. Change the function to pass the flags as\n> a pointer, and clear REFNAME_REFSPEC_PATTERN after the first \"*\" so that\n> only a single \"*\" is accepted.\n>\n> This loosens restrictions on refspecs by allowing patterns that have\n> a \"*\" within a component instead of only as the whole component. Also\n> remove the code that hangled refspec patterns in check_refname_format\n\ns/hangled/handled/\n\n> since it is now handled via the check_refname_component logic.\n>\n> Now refs such as `for/bar*:foo/bar*` and even `foo/bar*:foo/baz*` will\n> be accepted. This allows users more control over what is fetched where.\n> Since users must modify the default by hand to make use of this\n> functionality it is not considered a large risk. Any refspec which\n> functioned before shall continue functioning with the new logic.\n>\n> Signed-off-by: Jacob Keller <jacob.keller@gmail.com>\n"},{"id":"266688","messageId":"xmqqvbdao762.fsf@gitster.dls.corp.google.com","threadId":"39919","inReplyTo":"CAPig+cRS0NcNcw-0wG4mThN_PW0RoN3b09Yu2GzCr=UFPLYd6A@mail.gmail.com","subject":"Re: [PATCH 2/2] refs: loosen restriction on wildcard \"*\" refspecs","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-07-23T22:12:05Z","receivedAt":"2015-07-23T22:12:05Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Sunshine <sunshine@sunshineco.com> writes:\n\n> On Wed, Jul 22, 2015 at 5:05 PM, Jacob Keller <jacob.e.keller@intel.com> wrote:\n>> From: Jacob Keller <jacob.keller@gmail.com>\n>>\n>> Modify logic of check_refname_component and add a new disposition\n>> regarding \"*\". Allow refspecs that contain a single \"*\" if\n>> REFNAME_REFSPEC_PATTERN is set. Change the function to pass the flags as\n>> a pointer, and clear REFNAME_REFSPEC_PATTERN after the first \"*\" so that\n>> only a single \"*\" is accepted.\n>>\n>> This loosens restrictions on refspecs by allowing patterns that have\n>> a \"*\" within a component instead of only as the whole component. Also\n>> remove the code that hangled refspec patterns in check_refname_format\n>\n> s/hangled/handled/\n> ...\n\nThanks; here is what I queued yesterday.\n\n-- >8 --\nFrom: Jacob Keller <jacob.keller@gmail.com>\nDate: Wed, 22 Jul 2015 14:05:33 -0700\nSubject: [PATCH] refs: loosen restriction on wildcard \"*\" refspecs\n\nLoosen restrictions on refspecs by allowing patterns that have a \"*\"\nwithin a component instead of only as the whole component.\n\nRemove the logic to accept a single \"*\" as a whole component from\ncheck_refname_format(), and implement an extended form of that logic\nin check_refname_component().  Pass the pointer to the flags argument\nto the latter, as it has to clear REFNAME_REFSPEC_PATTERN bit when\nit sees \"*\".\n\nTeach check_refname_component() function to allow an asterisk \"*\"\nonly when REFNAME_REFSPEC_PATTERN is set in the flags, and drop the\nbit after seeing a \"*\", to ensure that one side of a refspec\ncontains at most one asterisk.\n\nThis will allow us to accept refspecs such as `for/bar*:foo/baz*`.\nAny refspec which functioned before shall continue functioning with\nthe new logic.\n\nSigned-off-by: Jacob Keller <jacob.keller@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n Documentation/git-check-ref-format.txt |  4 ++--\n refs.c                                 | 36 +++++++++++++++++++---------------\n refs.h                                 |  4 ++--\n t/t1402-check-ref-format.sh            |  8 +++++---\n t/t5511-refspec.sh                     | 11 +++++++----\n 5 files changed, 36 insertions(+), 27 deletions(-)\n\ndiff --git a/Documentation/git-check-ref-format.txt b/Documentation/git-check-ref-format.txt\nindex fc02959..9044dfa 100644\n--- a/Documentation/git-check-ref-format.txt\n+++ b/Documentation/git-check-ref-format.txt\n@@ -94,8 +94,8 @@ OPTIONS\n \tInterpret <refname> as a reference name pattern for a refspec\n \t(as used with remote repositories).  If this option is\n \tenabled, <refname> is allowed to contain a single `*`\n-\tin place of a one full pathname component (e.g.,\n-\t`foo/*/bar` but not `foo/bar*`).\n+\tin the refspec (e.g., `foo/bar*/baz` or `foo/bar*baz/`\n+\tbut not `foo/bar*/baz*`).\n \n --normalize::\n \tNormalize 'refname' by removing any leading slash (`/`)\ndiff --git a/refs.c b/refs.c\nindex 0900f54..3127518 100644\n--- a/refs.c\n+++ b/refs.c\n@@ -21,12 +21,13 @@ struct ref_lock {\n  * 2: ., look for a preceding . to reject .. in refs\n  * 3: {, look for a preceding @ to reject @{ in refs\n  * 4: A bad character: ASCII control characters, and\n- *    \"*\", \":\", \"?\", \"[\", \"\\\", \"^\", \"~\", SP, or TAB\n+ *    \":\", \"?\", \"[\", \"\\\", \"^\", \"~\", SP, or TAB\n+ * 5: *, reject unless REFNAME_REFSPEC_PATTERN is set\n  */\n static unsigned char refname_disposition[256] = {\n \t1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,\n \t4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,\n-\t4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 2, 1,\n+\t4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 2, 1,\n \t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 4,\n \t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n \t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 4, 0,\n@@ -73,12 +74,13 @@ static unsigned char refname_disposition[256] = {\n  * - any path component of it begins with \".\", or\n  * - it has double dots \"..\", or\n  * - it has ASCII control characters, or\n- * - it has \"*\", \":\", \"?\", \"[\", \"\\\", \"^\", \"~\", SP, or TAB anywhere, or\n+ * - it has \":\", \"?\", \"[\", \"\\\", \"^\", \"~\", SP, or TAB anywhere, or\n+ * - it has \"*\" anywhere unless REFNAME_REFSPEC_PATTERN is set, or\n  * - it ends with a \"/\", or\n  * - it ends with \".lock\", or\n  * - it contains a \"@{\" portion\n  */\n-static int check_refname_component(const char *refname, int flags)\n+static int check_refname_component(const char *refname, int *flags)\n {\n \tconst char *cp;\n \tchar last = '\\0';\n@@ -99,6 +101,16 @@ static int check_refname_component(const char *refname, int flags)\n \t\t\tbreak;\n \t\tcase 4:\n \t\t\treturn -1;\n+\t\tcase 5:\n+\t\t\tif (!(*flags & REFNAME_REFSPEC_PATTERN))\n+\t\t\t\treturn -1; /* refspec can't be a pattern */\n+\n+\t\t\t/*\n+\t\t\t * Unset the pattern flag so that we only accept\n+\t\t\t * a single asterisk for one side of refspec.\n+\t\t\t */\n+\t\t\t*flags &= ~ REFNAME_REFSPEC_PATTERN;\n+\t\t\tbreak;\n \t\t}\n \t\tlast = ch;\n \t}\n@@ -123,18 +135,10 @@ int check_refname_format(const char *refname, int flags)\n \n \twhile (1) {\n \t\t/* We are at the start of a path component. */\n-\t\tcomponent_len = check_refname_component(refname, flags);\n-\t\tif (component_len <= 0) {\n-\t\t\tif ((flags & REFNAME_REFSPEC_PATTERN) &&\n-\t\t\t\t\trefname[0] == '*' &&\n-\t\t\t\t\t(refname[1] == '\\0' || refname[1] == '/')) {\n-\t\t\t\t/* Accept one wildcard as a full refname component. */\n-\t\t\t\tflags &= ~REFNAME_REFSPEC_PATTERN;\n-\t\t\t\tcomponent_len = 1;\n-\t\t\t} else {\n-\t\t\t\treturn -1;\n-\t\t\t}\n-\t\t}\n+\t\tcomponent_len = check_refname_component(refname, &flags);\n+\t\tif (component_len <= 0)\n+\t\t\treturn -1;\n+\n \t\tcomponent_count++;\n \t\tif (refname[component_len] == '\\0')\n \t\t\tbreak;\ndiff --git a/refs.h b/refs.h\nindex cf642e6..417f2c8 100644\n--- a/refs.h\n+++ b/refs.h\n@@ -224,8 +224,8 @@ extern int for_each_reflog(each_ref_fn, void *);\n  * to the rules described in Documentation/git-check-ref-format.txt.\n  * If REFNAME_ALLOW_ONELEVEL is set in flags, then accept one-level\n  * reference names.  If REFNAME_REFSPEC_PATTERN is set in flags, then\n- * allow a \"*\" wildcard character in place of one of the name\n- * components.  No leading or repeated slashes are accepted.\n+ * allow a single \"*\" wildcard character in the refspec. No leading or\n+ * repeated slashes are accepted.\n  */\n extern int check_refname_format(const char *refname, int flags);\n \ndiff --git a/t/t1402-check-ref-format.sh b/t/t1402-check-ref-format.sh\nindex e5dc62e..0790edf 100755\n--- a/t/t1402-check-ref-format.sh\n+++ b/t/t1402-check-ref-format.sh\n@@ -62,9 +62,11 @@ invalid_ref 'heads/foo\\bar'\n invalid_ref \"$(printf 'heads/foo\\t')\"\n invalid_ref \"$(printf 'heads/foo\\177')\"\n valid_ref \"$(printf 'heads/fu\\303\\237')\"\n-invalid_ref 'heads/*foo/bar' --refspec-pattern\n-invalid_ref 'heads/foo*/bar' --refspec-pattern\n-invalid_ref 'heads/f*o/bar' --refspec-pattern\n+valid_ref 'heads/*foo/bar' --refspec-pattern\n+valid_ref 'heads/foo*/bar' --refspec-pattern\n+valid_ref 'heads/f*o/bar' --refspec-pattern\n+invalid_ref 'heads/f*o*/bar' --refspec-pattern\n+invalid_ref 'heads/foo*/bar*' --refspec-pattern\n \n ref='foo'\n invalid_ref \"$ref\"\ndiff --git a/t/t5511-refspec.sh b/t/t5511-refspec.sh\nindex de6db86..f541f30 100755\n--- a/t/t5511-refspec.sh\n+++ b/t/t5511-refspec.sh\n@@ -71,15 +71,18 @@ test_refspec fetch ':refs/remotes/frotz/HEAD-to-me'\n test_refspec push ':refs/remotes/frotz/delete me'\t\tinvalid\n test_refspec fetch ':refs/remotes/frotz/HEAD to me'\t\tinvalid\n \n-test_refspec fetch 'refs/heads/*/for-linus:refs/remotes/mine/*-blah' invalid\n-test_refspec push 'refs/heads/*/for-linus:refs/remotes/mine/*-blah' invalid\n+test_refspec fetch 'refs/heads/*/for-linus:refs/remotes/mine/*-blah'\n+test_refspec push 'refs/heads/*/for-linus:refs/remotes/mine/*-blah'\n \n-test_refspec fetch 'refs/heads*/for-linus:refs/remotes/mine/*' invalid\n-test_refspec push 'refs/heads*/for-linus:refs/remotes/mine/*' invalid\n+test_refspec fetch 'refs/heads*/for-linus:refs/remotes/mine/*'\n+test_refspec push 'refs/heads*/for-linus:refs/remotes/mine/*'\n \n test_refspec fetch 'refs/heads/*/*/for-linus:refs/remotes/mine/*' invalid\n test_refspec push 'refs/heads/*/*/for-linus:refs/remotes/mine/*' invalid\n \n+test_refspec fetch 'refs/heads/*g*/for-linus:refs/remotes/mine/*' invalid\n+test_refspec push 'refs/heads/*g*/for-linus:refs/remotes/mine/*' invalid\n+\n test_refspec fetch 'refs/heads/*/for-linus:refs/remotes/mine/*'\n test_refspec push 'refs/heads/*/for-linus:refs/remotes/mine/*'\n \n-- \n2.5.0-rc3-352-g936684d\n"},{"id":"266692","messageId":"1437698706.22096.5.camel@intel.com","threadId":"39919","inReplyTo":"xmqqvbdao762.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH 2/2] refs: loosen restriction on wildcard \"*\" refspecs","fromName":"Keller, Jacob E","fromEmail":"jacob.e.keller@intel.com","sentAt":"2015-07-24T00:45:06Z","receivedAt":"2015-07-24T00:45:06Z","isPatch":true,"sender":{"key":"jacob.e.keller@intel.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Thu, 2015-07-23 at 15:12 -0700, Junio C Hamano wrote:\n> Eric Sunshine <sunshine@sunshineco.com> writes:\n> \n> > On Wed, Jul 22, 2015 at 5:05 PM, Jacob Keller <\n> > jacob.e.keller@intel.com> wrote:\n> > > From: Jacob Keller <jacob.keller@gmail.com>\n> > > \n> > > Modify logic of check_refname_component and add a new disposition\n> > > regarding \"*\". Allow refspecs that contain a single \"*\" if\n> > > REFNAME_REFSPEC_PATTERN is set. Change the function to pass the \n> > > flags as\n> > > a pointer, and clear REFNAME_REFSPEC_PATTERN after the first \"*\" \n> > > so that\n> > > only a single \"*\" is accepted.\n> > > \n> > > This loosens restrictions on refspecs by allowing patterns that \n> > > have\n> > > a \"*\" within a component instead of only as the whole component. \n> > > Also\n> > > remove the code that hangled refspec patterns in \n> > > check_refname_format\n> > \n> > s/hangled/handled/\n> > ...\n> \n> Thanks; here is what I queued yesterday.\n> \n\nWoah. I bow to your imperative commit message abilities. The new commit\nmessage is very nicely worded. Thanks for taking the time to reword my\njumble correctly.\n\nEverything looked great to me.\n\nRegards,\nJake"},{"id":"266693","messageId":"xmqqlhe6nzs6.fsf@gitster.dls.corp.google.com","threadId":"39919","inReplyTo":"1437698706.22096.5.camel@intel.com","subject":"Re: [PATCH 2/2] refs: loosen restriction on wildcard \"*\" refspecs","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-07-24T00:51:37Z","receivedAt":"2015-07-24T00:51:37Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Keller, Jacob E\" <jacob.e.keller@intel.com> writes:\n\n>> > s/hangled/handled/\n>> > ...\n>> \n>> Thanks; here is what I queued yesterday.\n>> \n>\n> Woah. I bow to your imperative commit message abilities. The new commit\n> message is very nicely worded.\n\nHeh, imperative is secondary. I just wanted to straighten out the\nuse of \"refs\" and \"refspecs\" there.\n\nThanks for a patch that was cleanly done.\n"}]}