-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
packfile.h: fix a typo #1614
packfile.h: fix a typo #1614
Conversation
One parameter is called `file_pach`. On the face of it, this looks as if it was supposed to talk about a `path` instead of a `pach`. However, looking at the way this callback is called, it gets fed the `d_name` from a directory entry, which provides just the file name, not the full path. Therefore, let's fix this by calling the parameter `file_name` instead. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
/submit |
Submitted as pull.1614.git.1700226915859.gitgitgadget@gmail.com To fetch this version into
To fetch this version to local tag
|
On the Git mailing list, Junio C Hamano wrote (reply to this): "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
writes:
> Subject: Re: [PATCH] Fix a typo in `each_file_in_pack_dir_fn()`'s declaration
Let's have "packfile.[ch]: " before the title to tell what area the
helper function is about.
> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> One parameter is called `file_pach`. On the face of it, this looks as if
> it was supposed to talk about a `path` instead of a `pach`.
>
> However, looking at the way this callback is called, it gets fed the
> `d_name` from a directory entry, which provides just the file name, not
> the full path. Therefore, let's fix this by calling the parameter
> `file_name` instead.
> ...
> typedef void each_file_in_pack_dir_fn(const char *full_path, size_t full_path_len,
> - const char *file_pach, void *data);
> + const char *file_name, void *data);
Very good observation. We form a pathname to a file in a
"objects/pack/" subdirectory by concatenating this parameter after
the full_path/full_path_len parameter, which has the path to that
subdirectory, so "file_name" definitely is a much better name.
The "full_path" that does not say full path to what directory may
have room for improvement ("leading_path" or even "packdir"), but
that's OK.
Thanks for spotting.
> void for_each_file_in_pack_dir(const char *objdir,
> each_file_in_pack_dir_fn fn,
> void *data);
>
> base-commit: cfb8a6e9a93adbe81efca66e6110c9b4d2e57169 |
This branch is now known as |
This patch series was integrated into seen via git@7260bd1. |
There was a status update in the "New Topics" section about the branch Typofix. Will merge to 'next'. source: <pull.1614.git.1700226915859.gitgitgadget@gmail.com> |
There was a status update in the "Cooking" section about the branch Typofix. Will merge to 'next'. source: <pull.1614.git.1700226915859.gitgitgadget@gmail.com> |
This patch series was integrated into seen via git@771998d. |
There was a status update in the "Cooking" section about the branch Typofix. Will merge to 'next'. source: <pull.1614.git.1700226915859.gitgitgadget@gmail.com> |
This patch series was integrated into seen via git@771302e. |
This patch series was integrated into next via git@a63406d. |
This patch series was integrated into next via git@3283994. |
This patch series was integrated into seen via git@bad39bd. |
There was a status update in the "Cooking" section about the branch Typofix. Will merge to 'master'. source: <pull.1614.git.1700226915859.gitgitgadget@gmail.com> |
This patch series was integrated into seen via git@13d0e93. |
This patch series was integrated into seen via git@7d9b68c. |
This patch series was integrated into seen via git@428edd4. |
This patch series was integrated into seen via git@19c7128. |
This patch series was integrated into seen via git@f1c5377. |
This patch series was integrated into master via git@f1c5377. |
This patch series was integrated into next via git@f1c5377. |
Closed via f1c5377. |
I stumbled over this typo yesterday. Nothing about this patch is urgent, of course, it can easily wait until v2.43.0 is released.