Skip to content

Remove duplicate forward declaration of struct repository #1879

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

Conversation

Ethan0456
Copy link

@Ethan0456 Ethan0456 commented Mar 11, 2025

Summary

While exploring how Git searches for .gitignore files and manages ignored files, I came across dir.h. While reading through the file, I noticed that struct repository; was forward-declared twice. This duplication appears unnecessary, and removing the second declaration compiles cleanly.

The `struct repository;` forward declaration appears twice in `dir.h`:
once at line 10 and again at line 46. This duplication is unnecessary
and likely unintentional.

Removing the second declaration has no impact on compilation, as verified
by a clean build.

Signed-off-by: Abhijeetsingh Meena <abhijeet040403@gmail.com>
@Ethan0456
Copy link
Author

/preview

Copy link

gitgitgadget bot commented Mar 11, 2025

Preview email sent as pull.1879.git.1741705066767.gitgitgadget@gmail.com

@Ethan0456
Copy link
Author

/submit

Copy link

gitgitgadget bot commented Mar 11, 2025

Submitted as pull.1879.git.1741705175922.gitgitgadget@gmail.com

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git/ pr-1879/Ethan0456/cleanup/deduplicate-repo-fwd-decl-v1

To fetch this version to local tag pr-1879/Ethan0456/cleanup/deduplicate-repo-fwd-decl-v1:

git fetch --no-tags https://github.com/gitgitgadget/git/ tag pr-1879/Ethan0456/cleanup/deduplicate-repo-fwd-decl-v1

Copy link

gitgitgadget bot commented Mar 11, 2025

On the Git mailing list, Junio C Hamano wrote (reply to this):

"Abhijeetsingh Meena via GitGitGadget" <gitgitgadget@gmail.com>
writes:

> From: Abhijeetsingh Meena <abhijeet040403@gmail.com>
>
> The `struct repository;` forward declaration appears twice in `dir.h`:
> once at line 10 and again at line 46. This duplication is unnecessary
> and likely unintentional.
>
> Removing the second declaration has no impact on compilation, as verified
> by a clean build.
>
> Signed-off-by: Abhijeetsingh Meena <abhijeet040403@gmail.com>
> ---

Thanks.  Will apply.

>  dir.h | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/dir.h b/dir.h
> index a3a2f00f5d9..e659c47ad77 100644
> --- a/dir.h
> +++ b/dir.h
> @@ -43,7 +43,6 @@ struct repository;
>   *
>   */
>  
> -struct repository;
>  
>  struct dir_entry {
>  	unsigned int len;
>
> base-commit: ef8ce8f3d4344fd3af049c17eeba5cd20d98b69f

Copy link

gitgitgadget bot commented Mar 11, 2025

This patch series was integrated into seen via git@94dfd81.

@gitgitgadget gitgitgadget bot added the seen label Mar 11, 2025
Copy link

gitgitgadget bot commented Mar 12, 2025

This branch is now known as am/dir-dedup-decl-of-repository.

Copy link

gitgitgadget bot commented Mar 12, 2025

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

Copy link

gitgitgadget bot commented Mar 12, 2025

There was a status update in the "New Topics" section about the branch am/dir-dedup-decl-of-repository on the Git mailing list:

Code cleanup.

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

Copy link

gitgitgadget bot commented Mar 13, 2025

This patch series was integrated into seen via git@48e4fa7.

Copy link

gitgitgadget bot commented Mar 14, 2025

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

Copy link

gitgitgadget bot commented Mar 14, 2025

There was a status update in the "Cooking" section about the branch am/dir-dedup-decl-of-repository on the Git mailing list:

Code cleanup.

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

Copy link

gitgitgadget bot commented Mar 14, 2025

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

Copy link

gitgitgadget bot commented Mar 15, 2025

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

Copy link

gitgitgadget bot commented Mar 15, 2025

This patch series was integrated into seen via git@898b000.

Copy link

gitgitgadget bot commented Mar 18, 2025

This patch series was integrated into seen via git@2278c08.

Copy link

gitgitgadget bot commented Mar 18, 2025

This patch series was integrated into seen via git@03e8ba1.

Copy link

gitgitgadget bot commented Mar 18, 2025

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

@gitgitgadget gitgitgadget bot added the next label Mar 18, 2025
Copy link

gitgitgadget bot commented Mar 18, 2025

This patch series was integrated into seen via git@3e03cdb.

Copy link

gitgitgadget bot commented Mar 18, 2025

There was a status update in the "Cooking" section about the branch am/dir-dedup-decl-of-repository on the Git mailing list:

Code cleanup.

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

Copy link

gitgitgadget bot commented Mar 21, 2025

This patch series was integrated into seen via git@1cd5a5b.

Copy link

gitgitgadget bot commented Mar 21, 2025

There was a status update in the "Cooking" section about the branch am/dir-dedup-decl-of-repository on the Git mailing list:

Code cleanup.

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

Copy link

gitgitgadget bot commented Mar 24, 2025

This patch series was integrated into seen via git@055cbd4.

Copy link

gitgitgadget bot commented Mar 25, 2025

This patch series was integrated into seen via git@77f9b97.

Copy link

gitgitgadget bot commented Mar 26, 2025

There was a status update in the "Cooking" section about the branch am/dir-dedup-decl-of-repository on the Git mailing list:

Code cleanup.

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

Copy link

gitgitgadget bot commented Mar 28, 2025

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

Copy link

gitgitgadget bot commented Mar 29, 2025

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

Copy link

gitgitgadget bot commented Mar 29, 2025

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

Copy link

gitgitgadget bot commented Mar 29, 2025

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

@gitgitgadget gitgitgadget bot added the master label Mar 29, 2025
@gitgitgadget gitgitgadget bot closed this Mar 29, 2025
Copy link

gitgitgadget bot commented Mar 29, 2025

Closed via f3db666.

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