Skip to content

Conversation

@isuffix
Copy link
Contributor

@isuffix isuffix commented Dec 5, 2025

After resolving jj-vcs/jj#3949 via jj-vcs/jj#7484, I realized that jj git init differs from git init and still causes issues with executable bits.

The problem is that jj git init sets up the .git/config file with core.filemode = true, despite file modes not being modifiable. Following the code, the reason is that jj uses the default file capabilities from gitoxide when initializing the repo, and gitoxide sets the capabilities by probing the filesystem. However, the probe for executable bits only tests whether the executable bit can be set when a file is created, but not whether it can be modified.

This PR changes the filemode probe to also verify that the executable bit can be modified. I tried to do so by changing as little surrounding code as possible.

The equivalent test by git itself for git init is here:
https://github.com/git/git/blob/f0ef5b6d9bcc258e4cbef93839d1b7465d5212b9/setup.c#L2367-L2379

@Byron Byron force-pushed the fix-exec-bit-probe branch from 5c7bde7 to d8ac7f8 Compare December 6, 2025 03:31
Copy link
Member

@Byron Byron left a comment

Choose a reason for hiding this comment

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

Thanks a lot, great work!

I particularly like the reference to the relevant code in Git, and of course the motivation coming from JJ along with references.

It also usually makes me a little sad that GitHub de-emphasises commits to the point where PRs have all the interesting background information, but the commit has not. Maybe next time :).

@Byron Byron enabled auto-merge December 6, 2025 03:34
@Byron Byron merged commit 9f49dd3 into GitoxideLabs:main Dec 6, 2025
28 checks passed
@isuffix isuffix deleted the fix-exec-bit-probe branch December 6, 2025 05:55
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.

2 participants