Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bugfix] fix wsl mode bits error in subdir #4660

Merged
merged 1 commit into from
Aug 7, 2024
Merged

Conversation

swigger
Copy link

@swigger swigger commented Oct 27, 2023

Support for wsl mode bits was previously added to git, but there was a bug because the filenames provided by fscache did not contain paths.

This commit fixes the issue.

The previous feature is added in PR #4438,
but at that time I didn't tested so much.
Sorry to have this bug.

To test this feature, set core.wslcompat to ture and core.filemode to true and make sure repo is on NTFS.

@swigger
Copy link
Author

swigger commented Oct 27, 2023

Please ignore the 2 ci errors, it seems they are not related with the modified code

memcpy(buf + off, fse->dirent.d_name, fse->len);
buf[off + fse->len] = '\0';
if (xutftowcs_long_path(wpath, buf) >= 0)
copy_wsl_mode_bits_from_disk(wpath, -1, &fse->st_mode);
Copy link
Member

Choose a reason for hiding this comment

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

fix wsl mode bits bug in subdir

Support for wsl mode bits was previously added to git,
but there was a bug because the filenames provided by
fscache did not contain paths.

This commit fixes the issue.

I am sorry, but this commit message does nothing at all to help me to understand while the previous fdata->FileName would not be enough.

Please review https://github.blog/2022-06-30-write-better-commits-build-better-projects/ and improve the commit message accordingly.

Copy link
Author

Choose a reason for hiding this comment

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

sorry, now commit updated.

Ex: fdata->FileName is only foo.sh while we need path/to/foo.sh to open the file.

@swigger
Copy link
Author

swigger commented Aug 7, 2024

I don't know why no progress in months, I have just rebased and pushed again, if there is something should be fixed, please let me know.

fix wsl mode bits bug in subdir

Support for wsl mode bits was previously added to git,
but there was a bug because the filenames provided by
fdata did not contain paths. Ex: fdata->FileName is only
foo.sh while we need path/to/foo.sh to open the file.

This commit fixes the issue.

Signed-off-by: lixungeng <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
@dscho
Copy link
Member

dscho commented Aug 7, 2024

why no progress in months

Various reasons, among others that I had briefly lost support to work on this as part of my day job, but things are back on track!

@dscho dscho added this to the Next release milestone Aug 7, 2024
@dscho
Copy link
Member

dscho commented Aug 7, 2024

/add relnote bug The support code enabled via core.WSLCompat did not work well with files stored in subdirectories of the worktree, which has been fixed.

The workflow run was started

github-actions bot pushed a commit to git-for-windows/build-extra that referenced this pull request Aug 7, 2024
The support code enabled via `core.WSLCompat` did not work well with
files stored in subdirectories of the worktree, which [has been
fixed](git-for-windows/git#4660).

Signed-off-by: gitforwindowshelper[bot] <[email protected]>
@dscho dscho merged commit 28481d4 into git-for-windows:main Aug 7, 2024
13 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.

2 participants