Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Conversation

dscho
Copy link
Member

@dscho dscho commented Nov 17, 2023

I stumbled over this typo yesterday. Nothing about this patch is urgent, of course, it can easily wait until v2.43.0 is released.

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>
@dscho dscho self-assigned this Nov 17, 2023
@dscho
Copy link
Member Author

dscho commented Nov 17, 2023

/submit

Copy link

gitgitgadget bot commented Nov 17, 2023

Submitted as pull.1614.git.1700226915859.gitgitgadget@gmail.com

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git/ pr-1614/dscho/packfile.h-typo-fix-v1

To fetch this version to local tag pr-1614/dscho/packfile.h-typo-fix-v1:

git fetch --no-tags https://github.com/gitgitgadget/git/ tag pr-1614/dscho/packfile.h-typo-fix-v1

Copy link

gitgitgadget bot commented Nov 19, 2023

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

Copy link

gitgitgadget bot commented Nov 20, 2023

This branch is now known as js/packfile-h-typofix.

Copy link

gitgitgadget bot commented Nov 20, 2023

This patch series was integrated into seen via git@7260bd1.

@gitgitgadget gitgitgadget bot added the seen label Nov 20, 2023
Copy link

gitgitgadget bot commented Nov 20, 2023

There was a status update in the "New Topics" section about the branch js/packfile-h-typofix on the Git mailing list:

Typofix.

Will merge to 'next'.
source: <pull.1614.git.1700226915859.gitgitgadget@gmail.com>

Copy link

gitgitgadget bot commented Nov 27, 2023

There was a status update in the "Cooking" section about the branch js/packfile-h-typofix on the Git mailing list:

Typofix.

Will merge to 'next'.
source: <pull.1614.git.1700226915859.gitgitgadget@gmail.com>

Copy link

gitgitgadget bot commented Dec 9, 2023

This patch series was integrated into seen via git@771998d.

Copy link

gitgitgadget bot commented Dec 9, 2023

There was a status update in the "Cooking" section about the branch js/packfile-h-typofix on the Git mailing list:

Typofix.

Will merge to 'next'.
source: <pull.1614.git.1700226915859.gitgitgadget@gmail.com>

Copy link

gitgitgadget bot commented Dec 10, 2023

This patch series was integrated into seen via git@771302e.

Copy link

gitgitgadget bot commented Dec 10, 2023

This patch series was integrated into next via git@a63406d.

@gitgitgadget gitgitgadget bot added the next label Dec 10, 2023
Copy link

gitgitgadget bot commented Dec 11, 2023

This patch series was integrated into next via git@3283994.

Copy link

gitgitgadget bot commented Dec 11, 2023

This patch series was integrated into seen via git@bad39bd.

Copy link

gitgitgadget bot commented Dec 12, 2023

There was a status update in the "Cooking" section about the branch js/packfile-h-typofix on the Git mailing list:

Typofix.

Will merge to 'master'.
source: <pull.1614.git.1700226915859.gitgitgadget@gmail.com>

Copy link

gitgitgadget bot commented Dec 13, 2023

This patch series was integrated into seen via git@13d0e93.

Copy link

gitgitgadget bot commented Dec 13, 2023

This patch series was integrated into seen via git@7d9b68c.

Copy link

gitgitgadget bot commented Dec 14, 2023

This patch series was integrated into seen via git@428edd4.

Copy link

gitgitgadget bot commented Dec 15, 2023

This patch series was integrated into seen via git@19c7128.

Copy link

gitgitgadget bot commented Dec 19, 2023

This patch series was integrated into seen via git@f1c5377.

Copy link

gitgitgadget bot commented Dec 19, 2023

This patch series was integrated into master via git@f1c5377.

Copy link

gitgitgadget bot commented Dec 19, 2023

This patch series was integrated into next via git@f1c5377.

@gitgitgadget gitgitgadget bot added the master label Dec 19, 2023
@gitgitgadget gitgitgadget bot closed this Dec 19, 2023
Copy link

gitgitgadget bot commented Dec 19, 2023

Closed via f1c5377.

@dscho dscho deleted the packfile.h-typo-fix branch December 19, 2023 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant