Skip to content

fix: exclude CRLF vendor files from line-ending normalization#693

Closed
marcusburghardt wants to merge 1 commit into
complytime:mainfrom
marcusburghardt:fix/gitattributes-vendor-crlf
Closed

fix: exclude CRLF vendor files from line-ending normalization#693
marcusburghardt wants to merge 1 commit into
complytime:mainfrom
marcusburghardt:fix/gitattributes-vendor-crlf

Conversation

@marcusburghardt

Copy link
Copy Markdown
Member

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:

error: Your local changes to the following files would be overwritten by checkout:
    vendor/github.com/cyberphone/json-canonicalization/LICENSE
    vendor/github.com/digitorus/timestamp/README.md
    vendor/github.com/theupdateframework/go-tuf/v2/LICENSE
Please commit your changes or stash them before you switch branches.
Aborting

Root Cause

The repository .gitattributes enforces LF line endings globally
(* text eol=lf). Three vendor files introduced by the sigstore
dependencies (#670) have CRLF line endings from their upstream
sources.

When Packit clones the repo and checks out main, git's eol
normalization marks these files as modified in the working tree. When
Packit then tries to git checkout the PR branch, git refuses because
the "local changes" would be overwritten.

This is the same issue previously solved for go-logfmt/README.md and
oras-go/MIGRATION_GUIDE.md, which already have -text entries in
.gitattributes.

Fix

Add -text entries for the three affected vendor files, telling git to
skip line-ending conversion entirely:

  • vendor/github.com/cyberphone/json-canonicalization/LICENSE
  • vendor/github.com/digitorus/timestamp/README.md
  • vendor/github.com/theupdateframework/go-tuf/v2/LICENSE

Verification

After the .gitattributes change, git status no longer shows these
files 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

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>
@marcusburghardt marcusburghardt requested a review from a team as a code owner July 6, 2026 15:26
@marcusburghardt marcusburghardt enabled auto-merge (rebase) July 6, 2026 15:28
@marcusburghardt

Copy link
Copy Markdown
Member Author

Closing in favor of the more generic implementation in #669

auto-merge was automatically disabled July 6, 2026 15:48

Pull request was closed

@marcusburghardt marcusburghardt deleted the fix/gitattributes-vendor-crlf branch July 6, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant