Skip to content

Update .gitattributes to add exlusion lists. #10267

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

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

minosgalanakis
Copy link
Contributor

@minosgalanakis minosgalanakis commented Jul 2, 2025

Description

We are using git-archive as the standard way to generate tarballs. As part of the tarball creation, the tool, is parsing .gitattributes for context.

This pr is using the export-ignore directive as defined by git-scm manual to remove certain files that do not belong to a flattened product release of a code-base.

The hidden files that I am aiming for are

ls .*
.gitattributes		.gitmodules		.mypy.ini		.readthedocs.yaml	.uncrustify.cfg
.gitignore		.globalrc		.pylintrc		.travis.yml

I have kept the .uncrustify.cfg because there is value in codifying our code-style.

PR checklist

Please remove the segment/s on either side of the | symbol as appropriate, and add any relevant link/s to the end of the line.
If the provided content is part of the present PR remove the # symbol.

This commit adds a list of files that should
be excluded from tarballs when git-archive
is used.

Signed-off-by: Minos Galanakis <[email protected]>
@minosgalanakis minosgalanakis force-pushed the feature/extend_export_attributes branch from 3f0f9ca to 08de808 Compare July 2, 2025 13:36
@minosgalanakis minosgalanakis added needs-design-approval needs-review Every commit must be reviewed by at least two team members, needs-backports Backports are missing or are pending review and approval. needs-reviewer This PR needs someone to pick it up for review size-xs Estimated task size: extra small (a few hours at most) labels Jul 2, 2025
@minosgalanakis minosgalanakis added the priority-medium Medium priority - this can be reviewed as time permits label Jul 2, 2025
.git* export-ignore
.pylintrc export-ignore
.mypy.ini. export-ignore
.globalrc export-ignore
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should keep this: it's for people who browse the source code in some IDEs.

Comment on lines +7 to +8
.pylintrc export-ignore
.mypy.ini. export-ignore
Copy link
Contributor

@gilles-peskine-arm gilles-peskine-arm Jul 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess .pylintrc and .mypy.ini are only useful to contributors, not for people who only consume the source code. So it may be ok to exclude them. But if you exclude them, it means you can't run all.sh on the tarball release.

In any case, I can't think of a reason to exclude those but include .uncrustify.cfg.

.mypy.ini. export-ignore
.globalrc export-ignore
.travis.yml export-ignore
.readthedocs.yaml export-ignore
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why shouldn't it be possible to build a readthedocs version from a tarball release?

.pylintrc export-ignore
.mypy.ini. export-ignore
.globalrc export-ignore
.travis.yml export-ignore
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually we should just remove .travis.yml, it hasn't been used in a couple of years.


# Ignore listed files when creating an archive
.github/** export-ignore
.git* export-ignore
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not keep .gitattributes in the tarball? Other tools such as IDEs and code indexing tools might use it, to recognize *.function files as C (but I don't know of any tool that does so, I'm just speculating).

@minosgalanakis
Copy link
Contributor Author

@gilles-peskine-arm I have no strong preference, as to the files that should be removed. I do believe the .github/* files should not be included in the tarballs. So I could refactor this to be just this

.github/** 
.gitmodules
.travis.yml        export-ignore

Would that be reasonable?

@gilles-peskine-arm
Copy link
Contributor

@minosgalanakis I'd say .github/** are useless but harmless in the tarball. Same with .gitignore.

As for .travis.yml, how about removing it while you're at it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-backports Backports are missing or are pending review and approval. needs-design-approval needs-review Every commit must be reviewed by at least two team members, needs-reviewer This PR needs someone to pick it up for review priority-medium Medium priority - this can be reviewed as time permits size-xs Estimated task size: extra small (a few hours at most)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants