{"thread":{"id":"59137","subject":"[PATCH] attr: fix instructions on how to check attrs","startedAt":"2023-01-22T03:06:19Z","lastAt":"2023-01-26T22:17:34Z","messageCount":6,"participants":["John Cai via GitGitGadget","Junio C Hamano","John Cai"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"470858","messageId":"pull.1441.git.git.1674356774172.gitgitgadget@gmail.com","threadId":"59137","inReplyTo":null,"subject":"[PATCH] attr: fix instructions on how to check attrs","fromName":"John Cai via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2023-01-22T03:06:14Z","receivedAt":"2023-01-22T03:06:19Z","isPatch":true,"sender":{"key":"johncai86@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2354211?v=4"},"body":"From: John Cai <johncai86@gmail.com>\n\nThe instructions in attr.h describing what functions to call to check\nattributes is missing the index as the first argument to git_check_attr.\n\nFix this to make it consistent with the actual function signature.\n\nSigned-off-by: John Cai <johncai86@gmail.com>\n---\n    attr: fix instructions on how to check attrs\n    \n    The instructions in attr.h describing what functions to call to check\n    attributes is missing the index as the first argument to git_check_attr.\n    \n    Fix this to make it consistent with the actual function signature.\n    \n    Signed-off-by: John Cai johncai86@gmail.com\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1441%2Fjohn-cai%2Fjc%2Ffix-attr-docs-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1441/john-cai/jc/fix-attr-docs-v1\nPull-Request: https://github.com/git/git/pull/1441\n\n attr.h | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/attr.h b/attr.h\nindex 2f22dffadb3..47f1111f391 100644\n--- a/attr.h\n+++ b/attr.h\n@@ -45,7 +45,7 @@\n  * const char *path;\n  *\n  * setup_check();\n- * git_check_attr(path, check);\n+ * git_check_attr(&the_index, path, check);\n  * ------------\n  *\n  * - Act on `.value` member of the result, left in `check->items[]`:\n\nbase-commit: 904d404274fef6695c78a6b055edd184b72e2f9b\n-- \ngitgitgadget\n"},{"id":"470881","messageId":"xmqq8rhuturw.fsf@gitster.g","threadId":"59137","inReplyTo":"pull.1441.git.git.1674356774172.gitgitgadget@gmail.com","subject":"Re: [PATCH] attr: fix instructions on how to check attrs","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-01-22T16:10:27Z","receivedAt":"2023-01-22T16:10:45Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"John Cai via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> From: John Cai <johncai86@gmail.com>\n>\n> The instructions in attr.h describing what functions to call to check\n> attributes is missing the index as the first argument to git_check_attr.\n>\n> Fix this to make it consistent with the actual function signature.\n\nSounds quite sensible.  It would have been very good to explain some\nresearch in the above, like\n\n    When 7a400a2c (attr: remove an implicit dependency on the_index,\n    2018-08-13) started passing an index_state instance to\n    git_check_attr(), it forgot to update the API documentation that\n    was in Documentation/technical/api-gitattributes.txt.  Later,\n    3a1b3415 (attr: move doc to attr.h, 2019-11-17) moved the API\n    documentation to attr.h and made it to a comment, without\n    realizing the earlier mistake.\n    \nor something like that.\n\nThanks.\n\n> diff --git a/attr.h b/attr.h\n> index 2f22dffadb3..47f1111f391 100644\n> --- a/attr.h\n> +++ b/attr.h\n> @@ -45,7 +45,7 @@\n>   * const char *path;\n>   *\n>   * setup_check();\n> - * git_check_attr(path, check);\n> + * git_check_attr(&the_index, path, check);\n>   * ------------\n>   *\n>   * - Act on `.value` member of the result, left in `check->items[]`:\n>\n> base-commit: 904d404274fef6695c78a6b055edd184b72e2f9b\n"},{"id":"470896","messageId":"FBC71853-6FC7-4D6A-83D5-3EDA2250F4DE@gmail.com","threadId":"59137","inReplyTo":"xmqq8rhuturw.fsf@gitster.g","subject":"Re: [PATCH] attr: fix instructions on how to check attrs","fromName":"John Cai","fromEmail":"johncai86@gmail.com","sentAt":"2023-01-23T04:07:53Z","receivedAt":"2023-01-23T04:07:59Z","isPatch":true,"sender":{"key":"johncai86@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2354211?v=4"},"body":"Hi Junio,\n\nOn 22 Jan 2023, at 11:10, Junio C Hamano wrote:\n\n> \"John Cai via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n>\n>> From: John Cai <johncai86@gmail.com>\n>>\n>> The instructions in attr.h describing what functions to call to check\n>> attributes is missing the index as the first argument to git_check_attr.\n>>\n>> Fix this to make it consistent with the actual function signature.\n>\n> Sounds quite sensible.  It would have been very good to explain some\n> research in the above, like\n>\n>     When 7a400a2c (attr: remove an implicit dependency on the_index,\n>     2018-08-13) started passing an index_state instance to\n>     git_check_attr(), it forgot to update the API documentation that\n>     was in Documentation/technical/api-gitattributes.txt.  Later,\n>     3a1b3415 (attr: move doc to attr.h, 2019-11-17) moved the API\n>     documentation to attr.h and made it to a comment, without\n>     realizing the earlier mistake.\n>\n> or something like that.\n\ngood tip about including some history. I'll include that in the re-roll\n\nthanks!\n\n>\n> Thanks.\n>\n>> diff --git a/attr.h b/attr.h\n>> index 2f22dffadb3..47f1111f391 100644\n>> --- a/attr.h\n>> +++ b/attr.h\n>> @@ -45,7 +45,7 @@\n>>   * const char *path;\n>>   *\n>>   * setup_check();\n>> - * git_check_attr(path, check);\n>> + * git_check_attr(&the_index, path, check);\n>>   * ------------\n>>   *\n>>   * - Act on `.value` member of the result, left in `check->items[]`:\n>>\n>> base-commit: 904d404274fef6695c78a6b055edd184b72e2f9b\n"},{"id":"470898","messageId":"pull.1441.v2.git.git.1674447742078.gitgitgadget@gmail.com","threadId":"59137","inReplyTo":"pull.1441.git.git.1674356774172.gitgitgadget@gmail.com","subject":"[PATCH v2] attr: fix instructions on how to check attrs","fromName":"John Cai via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2023-01-23T04:22:21Z","receivedAt":"2023-01-23T04:22:29Z","isPatch":true,"sender":{"key":"johncai86@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2354211?v=4"},"body":"From: John Cai <johncai86@gmail.com>\n\nThe instructions in attr.h describing what functions to call to check\nattributes is missing the index as the first argument to\ngit_check_attr().\n\nWhen 7a400a2c (attr: remove an implicit dependency on the_index,\n2018-08-13) started passing an index_state instance to git_check_attr(),\nit forgot to update the API documentation in\nDocumentation/technical/api-gitattributes.txt. Later, 3a1b3415\n(attr: move doc to attr.h, 2019-11-17) moved the API documentation to\nattr.h as a comment, but still left out the index_state as an argument.\n\nFix this to make the documentation in the comment consistent with the\nactual function signature.\n\nSigned-off-by: John Cai <johncai86@gmail.com>\n---\n    attr: fix instructions on how to check attrs\n    \n    The instructions in attr.h describing what functions to call to check\n    attributes is missing the index as the first argument to git_check_attr.\n    \n    Fix this to make it consistent with the actual function signature.\n    \n    Changes since V1:\n    \n     * updated commit message to include some history\n    \n    Signed-off-by: John Cai johncai86@gmail.com\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1441%2Fjohn-cai%2Fjc%2Ffix-attr-docs-v2\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1441/john-cai/jc/fix-attr-docs-v2\nPull-Request: https://github.com/git/git/pull/1441\n\nRange-diff vs v1:\n\n 1:  63bb84db487 ! 1:  8cfee55e48f attr: fix instructions on how to check attrs\n     @@ Commit message\n          attr: fix instructions on how to check attrs\n      \n          The instructions in attr.h describing what functions to call to check\n     -    attributes is missing the index as the first argument to git_check_attr.\n     +    attributes is missing the index as the first argument to\n     +    git_check_attr().\n      \n     -    Fix this to make it consistent with the actual function signature.\n     +    When 7a400a2c (attr: remove an implicit dependency on the_index,\n     +    2018-08-13) started passing an index_state instance to git_check_attr(),\n     +    it forgot to update the API documentation in\n     +    Documentation/technical/api-gitattributes.txt. Later, 3a1b3415\n     +    (attr: move doc to attr.h, 2019-11-17) moved the API documentation to\n     +    attr.h as a comment, but still left out the index_state as an argument.\n     +\n     +    Fix this to make the documentation in the comment consistent with the\n     +    actual function signature.\n      \n          Signed-off-by: John Cai <johncai86@gmail.com>\n      \n\n\n attr.h | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/attr.h b/attr.h\nindex 2f22dffadb3..47f1111f391 100644\n--- a/attr.h\n+++ b/attr.h\n@@ -45,7 +45,7 @@\n  * const char *path;\n  *\n  * setup_check();\n- * git_check_attr(path, check);\n+ * git_check_attr(&the_index, path, check);\n  * ------------\n  *\n  * - Act on `.value` member of the result, left in `check->items[]`:\n\nbase-commit: 904d404274fef6695c78a6b055edd184b72e2f9b\n-- \ngitgitgadget\n"},{"id":"471079","messageId":"pull.1441.v3.git.git.1674768107941.gitgitgadget@gmail.com","threadId":"59137","inReplyTo":"pull.1441.v2.git.git.1674447742078.gitgitgadget@gmail.com","subject":"[PATCH v3] attr: fix instructions on how to check attrs","fromName":"John Cai via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2023-01-26T21:21:47Z","receivedAt":"2023-01-26T21:21:54Z","isPatch":true,"sender":{"key":"johncai86@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2354211?v=4"},"body":"From: John Cai <johncai86@gmail.com>\n\nThe instructions in attr.h describing what functions to call to check\nattributes is missing the index as the first argument to\ngit_check_attr(), as well as tree_oid as the second argument.\n\nWhen 7a400a2c (attr: remove an implicit dependency on the_index,\n2018-08-13) started passing an index_state instance to git_check_attr(),\nit forgot to update the API documentation in\nDocumentation/technical/api-gitattributes.txt. Later, 3a1b3415\n(attr: move doc to attr.h, 2019-11-17) moved the API documentation to\nattr.h as a comment, but still left out the index_state as an argument.\n\nIn 47cfc9b (attr: add flag `--source` to work with tree-ish 2023-01-14)\nadded tree_oid as an optional parameter but was not added to the docs in\nattr.h\n\nFix this to make the documentation in the comment consistent with the\nactual function signature.\n\nSigned-off-by: John Cai <johncai86@gmail.com>\n---\n    attr: fix instructions on how to check attrs\n    \n    The instructions in attr.h describing what functions to call to check\n    attributes is missing the index as the first argument to git_check_attr.\n    \n    Fix this to make it consistent with the actual function signature.\n    \n    Changes since V2:\n    \n     * updated with adding second argument after rebasing against master\n    \n    Changes since V1:\n    \n     * updated commit message to include some history\n    \n    Signed-off-by: John Cai johncai86@gmail.com\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1441%2Fjohn-cai%2Fjc%2Ffix-attr-docs-v3\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1441/john-cai/jc/fix-attr-docs-v3\nPull-Request: https://github.com/git/git/pull/1441\n\nRange-diff vs v2:\n\n 1:  8cfee55e48f ! 1:  cf6f456af47 attr: fix instructions on how to check attrs\n     @@ Commit message\n      \n          The instructions in attr.h describing what functions to call to check\n          attributes is missing the index as the first argument to\n     -    git_check_attr().\n     +    git_check_attr(), as well as tree_oid as the second argument.\n      \n          When 7a400a2c (attr: remove an implicit dependency on the_index,\n          2018-08-13) started passing an index_state instance to git_check_attr(),\n     @@ Commit message\n          (attr: move doc to attr.h, 2019-11-17) moved the API documentation to\n          attr.h as a comment, but still left out the index_state as an argument.\n      \n     +    In 47cfc9b (attr: add flag `--source` to work with tree-ish 2023-01-14)\n     +    added tree_oid as an optional parameter but was not added to the docs in\n     +    attr.h\n     +\n          Fix this to make the documentation in the comment consistent with the\n          actual function signature.\n      \n     @@ attr.h\n        *\n        * setup_check();\n      - * git_check_attr(path, check);\n     -+ * git_check_attr(&the_index, path, check);\n     ++ * git_check_attr(&the_index, tree_oid, path, check);\n        * ------------\n        *\n        * - Act on `.value` member of the result, left in `check->items[]`:\n\n\n attr.h | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/attr.h b/attr.h\nindex 58a2bc1344f..9884ea2bc60 100644\n--- a/attr.h\n+++ b/attr.h\n@@ -45,7 +45,7 @@\n  * const char *path;\n  *\n  * setup_check();\n- * git_check_attr(path, check);\n+ * git_check_attr(&the_index, tree_oid, path, check);\n  * ------------\n  *\n  * - Act on `.value` member of the result, left in `check->items[]`:\n\nbase-commit: 5dec958dcf965fc75e0f459f8e8ccf9c9f495b15\n-- \ngitgitgadget\n"},{"id":"471081","messageId":"xmqq5yctaqkl.fsf@gitster.g","threadId":"59137","inReplyTo":"pull.1441.v3.git.git.1674768107941.gitgitgadget@gmail.com","subject":"Re: [PATCH v3] attr: fix instructions on how to check attrs","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-01-26T22:17:30Z","receivedAt":"2023-01-26T22:17:34Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"John Cai via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n>     Changes since V2:\n>     \n>      * updated with adding second argument after rebasing against master\n\nAhh, thanks for being so careful.  I forgot all about that other\ntopic changing the function signature.\n"}]}