diff mbox series

[v2] attr: fix instructions on how to check attrs

Message ID pull.1441.v2.git.git.1674447742078.gitgitgadget@gmail.com (mailing list archive)
State Superseded
Commit 13d6c61e6b97c5ee5aa12dfc41f425b0e5d08d4d
Headers show
Series [v2] attr: fix instructions on how to check attrs | expand

Commit Message

John Cai Jan. 23, 2023, 4:22 a.m. UTC
From: John Cai <johncai86@gmail.com>

The instructions in attr.h describing what functions to call to check
attributes is missing the index as the first argument to
git_check_attr().

When 7a400a2c (attr: remove an implicit dependency on the_index,
2018-08-13) started passing an index_state instance to git_check_attr(),
it forgot to update the API documentation in
Documentation/technical/api-gitattributes.txt. Later, 3a1b3415
(attr: move doc to attr.h, 2019-11-17) moved the API documentation to
attr.h as a comment, but still left out the index_state as an argument.

Fix this to make the documentation in the comment consistent with the
actual function signature.

Signed-off-by: John Cai <johncai86@gmail.com>
---
    attr: fix instructions on how to check attrs
    
    The instructions in attr.h describing what functions to call to check
    attributes is missing the index as the first argument to git_check_attr.
    
    Fix this to make it consistent with the actual function signature.
    
    Changes since V1:
    
     * updated commit message to include some history
    
    Signed-off-by: John Cai johncai86@gmail.com

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1441%2Fjohn-cai%2Fjc%2Ffix-attr-docs-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1441/john-cai/jc/fix-attr-docs-v2
Pull-Request: https://github.com/git/git/pull/1441

Range-diff vs v1:

 1:  63bb84db487 ! 1:  8cfee55e48f attr: fix instructions on how to check attrs
     @@ Commit message
          attr: fix instructions on how to check attrs
      
          The instructions in attr.h describing what functions to call to check
     -    attributes is missing the index as the first argument to git_check_attr.
     +    attributes is missing the index as the first argument to
     +    git_check_attr().
      
     -    Fix this to make it consistent with the actual function signature.
     +    When 7a400a2c (attr: remove an implicit dependency on the_index,
     +    2018-08-13) started passing an index_state instance to git_check_attr(),
     +    it forgot to update the API documentation in
     +    Documentation/technical/api-gitattributes.txt. Later, 3a1b3415
     +    (attr: move doc to attr.h, 2019-11-17) moved the API documentation to
     +    attr.h as a comment, but still left out the index_state as an argument.
     +
     +    Fix this to make the documentation in the comment consistent with the
     +    actual function signature.
      
          Signed-off-by: John Cai <johncai86@gmail.com>
      


 attr.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: 904d404274fef6695c78a6b055edd184b72e2f9b
diff mbox series

Patch

diff --git a/attr.h b/attr.h
index 2f22dffadb3..47f1111f391 100644
--- a/attr.h
+++ b/attr.h
@@ -45,7 +45,7 @@ 
  * const char *path;
  *
  * setup_check();
- * git_check_attr(path, check);
+ * git_check_attr(&the_index, path, check);
  * ------------
  *
  * - Act on `.value` member of the result, left in `check->items[]`: