All of lore.kernel.org
 help / color / mirror / Atom feed
From: "John Cai via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: John Cai <johncai86@gmail.com>, John Cai <johncai86@gmail.com>
Subject: [PATCH v3] attr: fix instructions on how to check attrs
Date: Thu, 26 Jan 2023 21:21:47 +0000	[thread overview]
Message-ID: <pull.1441.v3.git.git.1674768107941.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.1441.v2.git.git.1674447742078.gitgitgadget@gmail.com>

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(), as well as tree_oid as the second argument.

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.

In 47cfc9b (attr: add flag `--source` to work with tree-ish 2023-01-14)
added tree_oid as an optional parameter but was not added to the docs in
attr.h

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 V2:
    
     * updated with adding second argument after rebasing against master
    
    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-v3
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1441/john-cai/jc/fix-attr-docs-v3
Pull-Request: https://github.com/git/git/pull/1441

Range-diff vs v2:

 1:  8cfee55e48f ! 1:  cf6f456af47 attr: fix instructions on how to check attrs
     @@ Commit message
      
          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().
     +    git_check_attr(), as well as tree_oid as the second argument.
      
          When 7a400a2c (attr: remove an implicit dependency on the_index,
          2018-08-13) started passing an index_state instance to git_check_attr(),
     @@ Commit message
          (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.
      
     +    In 47cfc9b (attr: add flag `--source` to work with tree-ish 2023-01-14)
     +    added tree_oid as an optional parameter but was not added to the docs in
     +    attr.h
     +
          Fix this to make the documentation in the comment consistent with the
          actual function signature.
      
     @@ attr.h
        *
        * setup_check();
      - * git_check_attr(path, check);
     -+ * git_check_attr(&the_index, path, check);
     ++ * git_check_attr(&the_index, tree_oid, path, check);
        * ------------
        *
        * - Act on `.value` member of the result, left in `check->items[]`:


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

diff --git a/attr.h b/attr.h
index 58a2bc1344f..9884ea2bc60 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, tree_oid, path, check);
  * ------------
  *
  * - Act on `.value` member of the result, left in `check->items[]`:

base-commit: 5dec958dcf965fc75e0f459f8e8ccf9c9f495b15
-- 
gitgitgadget

  reply	other threads:[~2023-01-26 21:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-22  3:06 [PATCH] attr: fix instructions on how to check attrs John Cai via GitGitGadget
2023-01-22 16:10 ` Junio C Hamano
2023-01-23  4:07   ` John Cai
2023-01-23  4:22 ` [PATCH v2] " John Cai via GitGitGadget
2023-01-26 21:21   ` John Cai via GitGitGadget [this message]
2023-01-26 22:17     ` [PATCH v3] " Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pull.1441.v3.git.git.1674768107941.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=johncai86@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.