Skip to content

fix: continue checkout with unavailable encodings#2737

Merged
Sebastian Thiel (Byron) merged 5 commits into
mainfrom
encoding-fallback-pony
Jul 22, 2026
Merged

fix: continue checkout with unavailable encodings#2737
Sebastian Thiel (Byron) merged 5 commits into
mainfrom
encoding-fallback-pony

Conversation

@Byron

@Byron Sebastian Thiel (Byron) commented Jul 22, 2026

Copy link
Copy Markdown
Member

Tasks

This section is for Byron only. Models continuing this PR must not add, remove, check, uncheck, rename, or reorder checkboxes here.

  • refackiew

Everything below this line was generated by Codex GPT-5.

Created by Codex on behalf of Byron. Byron will review before this is ready to merge.

Fixes #1798

Summary

  • let checkout continue when working-tree-encoding names an unavailable encoding
  • preserve earlier ident/EOL conversions and emit a warning
  • keep add, diff, merge, archive, and cat conversion strict by default

This follows Git behavior introduced by 107642fe2661236f48b912480e090799e339c512: checkout re-encoding failures are non-fatal and retain the current content.

Validation

  • cargo test -p gix-filter --test filter pipeline::convert_to_worktree -- --nocapture
  • cargo test -p gix-filter --test filter pipeline::convert_to_git -- --nocapture
  • cargo test -p gix-worktree-state --test worktree-state checkout --no-default-features --features parallel
  • cargo check -p gix -p gix-worktree-state
  • cargo fmt --all -- --check
  • Codex review of bdb29d41f385 found no actionable regression

Codex (codex) and others added 2 commits July 22, 2026 14:36
Repositories can declare working-tree encodings unsupported by encoding_rs, such as UTF-32. Checkout previously rejected these declarations before writing any content, causing non-bare clones to fail.

Add regression coverage for an unknown encoding with CRLF conversion. Checkout now warns and preserves the output of earlier conversions when the requested encoding is unavailable, while other filter users remain strict by default.

This matches Git convert.c encode_to_worktree() and entry.c checkout_entry_ca(): since 107642f (Git 2.18), failed checkout re-encoding is non-fatal and the current blob content is written.

Validated with focused gix-filter conversion tests, gix-worktree-state checkout tests, cargo fmt, and cargo check for gix and gix-worktree-state.
…ail on unknown encodings

This makes it more obvious, and makes it more likely that tooling using this function
won't fail for the same reason, but instead act like Git, while still supporting strict
writers or those who want to act differently.
Previously it claimed delay is forbidden, even though it's allowed.
@Byron
Sebastian Thiel (Byron) marked this pull request as ready for review July 22, 2026 13:36

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2965ab5bf3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

Comment thread gix-worktree-state/src/checkout/entry.rs
…res.

Previously it would only ignore unknown filter names in this mode.

Co-authored-by: GPT 5.6 <codex@openai.com>
@Byron
Sebastian Thiel (Byron) merged commit 2315ede into main Jul 22, 2026
32 checks passed
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.

UTF-32 missing encoding for ansible.git @ salsa

2 participants