fix: exclude CRLF vendor files from line-ending normalization#693
Closed
marcusburghardt wants to merge 1 commit into
Closed
fix: exclude CRLF vendor files from line-ending normalization#693marcusburghardt wants to merge 1 commit into
marcusburghardt wants to merge 1 commit into
Conversation
Three vendor files introduced by sigstore dependencies have CRLF line endings from their upstream sources. The repository-wide '* text eol=lf' rule in .gitattributes causes git to mark these files as modified on checkout, which breaks Packit SRPM builds. The Packit build flow clones main then checks out the PR branch. The eol normalization creates spurious working-tree modifications that block the checkout with: error: Your local changes to the following files would be overwritten by checkout Add '-text' entries for these files, consistent with the existing entries for go-logfmt and oras-go vendor files. Assisted-by: OpenCode (claude-opus-4-6) Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
Member
Author
|
Closing in favor of the more generic implementation in #669 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
All Packit checks (rpm-build and testing-farm across all 5 targets) are
failing with SRPM build failed on every PR, including #669.
The SRPM build log
shows the root cause:
Root Cause
The repository
.gitattributesenforces LF line endings globally(
* text eol=lf). Three vendor files introduced by the sigstoredependencies (#670) have CRLF line endings from their upstream
sources.
When Packit clones the repo and checks out
main, git's eolnormalization marks these files as modified in the working tree. When
Packit then tries to
git checkoutthe PR branch, git refuses becausethe "local changes" would be overwritten.
This is the same issue previously solved for
go-logfmt/README.mdandoras-go/MIGRATION_GUIDE.md, which already have-textentries in.gitattributes.Fix
Add
-textentries for the three affected vendor files, telling git toskip line-ending conversion entirely:
vendor/github.com/cyberphone/json-canonicalization/LICENSEvendor/github.com/digitorus/timestamp/README.mdvendor/github.com/theupdateframework/go-tuf/v2/LICENSEVerification
After the
.gitattributeschange,git statusno longer shows thesefiles as modified, confirming the fix resolves the checkout conflict.
Refs: #669
Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: Marcus Burghardt maburgha@redhat.com