Skip to content

doc: Document executable-bit behavior during checkout#2614

Merged
Sebastian Thiel (Byron) merged 1 commit into
GitoxideLabs:mainfrom
shvvkz:docs/overwrite-existing-executable-bit
Jun 19, 2026
Merged

doc: Document executable-bit behavior during checkout#2614
Sebastian Thiel (Byron) merged 1 commit into
GitoxideLabs:mainfrom
shvvkz:docs/overwrite-existing-executable-bit

Conversation

@shvvkz

@shvvkz shvvkz commented May 21, 2026

Copy link
Copy Markdown
Contributor

Reported issue

checkout::Options::overwrite_existing currently documents that existing worktree entries won't be overwritten unless the option is enabled. However, it doesn't mention that in a non-exclusive checkout, pre-existing files may still have their executable bit updated to match the index even when overwrite_existing is false.

This can be surprising because callers may interpret overwrite_existing = false as preventing all changes to existing files, while the current behavior only prevents overwriting file contents.

Closes #1787.

Summary

  • Clarified the documentation for checkout::Options::overwrite_existing.
  • Documented that when destination_is_initially_empty is false, existing files may still receive executable-bit updates even if overwrite_existing is false.
  • Left the checkout behavior unchanged.

Validation

  • cargo fmt

I also tried to run cargo check -p gix-worktree-state, but it failed while compiling gix-hash without hash features, which appears unrelated to this documentation-only change.

Copilot AI review requested due to automatic review settings May 21, 2026 14:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR clarifies the behavior of Options::overwrite_existing during checkout, specifically that metadata (like the executable bit) may still be updated even when file contents are not overwritten.

Changes:

  • Expanded the doc comment for overwrite_existing to document a metadata-update edge case
  • Clarified interaction with destination_is_initially_empty

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread gix-worktree-state/src/checkout/mod.rs

@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: 47fbe95a42

ℹ️ 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/mod.rs
@Byron

Sebastian Thiel (Byron) commented Jun 19, 2026

Copy link
Copy Markdown
Member

Thanks a lot.

Even though my comment here mentioned that it shouldn't touch metadata at all in this case, I think it's good to start with a documentation update.

The prior CI failure is strange and I have a feeling it might be a race condition of sorts, related to packs, gix-odb even. That's not good, but I will dive in next time this happens.

`hyperfine --runs 100 '../target/debug/deps/odb-be2b33301340af5a multi_index_access' didn't reproduce the issue which seems to consistently happen here. Rebasing, maybe it's just a bad commit somehow.

@Byron
Sebastian Thiel (Byron) force-pushed the docs/overwrite-existing-executable-bit branch from 47fbe95 to 2b60381 Compare June 19, 2026 07:09
@Byron
Sebastian Thiel (Byron) merged commit ac4f285 into GitoxideLabs:main Jun 19, 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.

overwrite_existing: false is not documented to let +x be set

3 participants