Skip to content

doc: Document executable-bit behavior during checkout#2614

Open
shvvkz wants to merge 1 commit into
GitoxideLabs:mainfrom
shvvkz:docs/overwrite-existing-executable-bit
Open

doc: Document executable-bit behavior during checkout#2614
shvvkz wants to merge 1 commit into
GitoxideLabs:mainfrom
shvvkz:docs/overwrite-existing-executable-bit

Conversation

@shvvkz
Copy link
Copy Markdown

@shvvkz shvvkz commented May 21, 2026

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
Copy link
Copy Markdown

Copilot AI left a comment

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
Copy link
Copy Markdown
Contributor

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

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
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

2 participants