From: Junio C Hamano <gitster@pobox•com>
To: "Elijah Newren via GitGitGadget" <gitgitgadget@gmail•com>
Cc: git@vger•kernel.org, Elijah Newren <newren@gmail•com>
Subject: Re: [PATCH] tree-walk.h: fix incorrect API comment
Date: Tue, 29 Apr 2025 10:01:21 -0700 [thread overview]
Message-ID: <xmqqr01a6gwu.fsf@gitster.g> (raw)
In-Reply-To: <pull.1912.git.1745941503913.gitgitgadget@gmail.com> (Elijah Newren via GitGitGadget's message of "Tue, 29 Apr 2025 15:45:03 +0000")
"Elijah Newren via GitGitGadget" <gitgitgadget@gmail•com> writes:
> From: Elijah Newren <newren@gmail•com>
>
> When commit 50ddb089ff68 (tree-walk.c: remove the_repo from
> get_tree_entry(), 2019-06-27) added an extra parameter to
> get_tree_entry(), it did not fix the ordering comment about the meaning
> of the parameters. Rather than just changing "third"->"fourth" and
> "fourth"->"fifth", give the paramemters meaningful names (or actually,
> just take the existing names from the get_tree_entry() definition in the
> tree-walk.c file) and strike the comment.
Please drop "and strike the comment" part. The "oid" and "mode"
being out-parameters is significant for callers.
> /**
> * Find an entry in a tree given a pathname and the sha1 of a tree to
> - * search. Returns 0 if the entry is found and -1 otherwise. The third
> - * and fourth parameters are set to the entry's sha1 and mode respectively.
> + * search. Returns 0 if the entry is found and -1 otherwise.
> */
> -int get_tree_entry(struct repository *, const struct object_id *, const char *, struct object_id *, unsigned short *);
> +int get_tree_entry(struct repository *repo, const struct object_id *tree_oid,
> + const char *name, struct object_id *oid,
> + unsigned short *mode);
>
> /**
> * Generate the full pathname of a tree entry based from the root of the
>
> base-commit: f65182a99e545d2f2bc22e6c1c2da192133b16a3
Find an entry with the "name" in a tree object "tree_oid",
and return the the object name and the mode of the found
entry via the "oid" and the "mode" parameters. Return 0 if
the entry is found, and -1 otherwise.
or something, perhaps.
Thanks.
next prev parent reply other threads:[~2025-04-29 17:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-29 15:45 [PATCH] tree-walk.h: fix incorrect API comment Elijah Newren via GitGitGadget
2025-04-29 17:01 ` Junio C Hamano [this message]
2025-05-02 19:19 ` [PATCH v2] " Elijah Newren via GitGitGadget
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=xmqqr01a6gwu.fsf@gitster.g \
--to=gitster@pobox$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=gitgitgadget@gmail$(echo .)com \
--cc=newren@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox