Exclude repository-configuration from git-archive #1343
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
tracking repository configuration (like
.gitignore
) and CI-configuration (.github/
,.travis.yml
) within a repository is nice, practical and sometimes unavoidable.however, such configs do not place nicely when downstreams import the archives into their own git-based workflows.
e.g. for the Debian packaging of
python-can
, we definitely do not want to hide any build-artifacts via.gitignore
(our workflow is very different from that of upstream development).we also do not want to accidentally trigger our CI (our CI is supposed to test the packaging, rather than the development).
otoh, we also want to follow the upstream sources as close as possible (that is: without adding/changing/removing any files from the upstream releases).
the typical fix for this is to simply not include the repository-configuration when exporting a snapshot, such as is created automatically by github when downloading a "Release Tarball" (which is really just running
git archive
in the background).the
.gitattributes
file in this PR does exactly this: it excludes a number of repository- and CI-configuration files fromgit archive
.