Skip to content

Conversation

@bitfehler
Copy link
Contributor

The billy package contains a Change interface type, which seems to have gone unused for several years now, presumably due to the difficulty of implementing most of the required methods for all supported platforms.

This commit splits out a Chmod interface from it, which is supported on all platforms. The interface is implemented in all applicable abstractions.

Supporting chmod in billy would help with issues such as go-git/go-git#588

This is a backport of commit 601c531 on main (#157).

@bitfehler
Copy link
Contributor Author

@pjbgf as hinted at in #157, I'd love to see this backported 🙂

Differences to the version on main are the usage of os.FileMode instead of fs.FileMode (the library switched to the latter on main, but still uses os everywhere on this branch) and the potentially panicing cast in ChrootHelper.Chmod (because on this branch, that's what similar functions do, it was also just changed recently on main branch.

Copy link
Member

@pjbgf pjbgf left a comment

Choose a reason for hiding this comment

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

Thanks for backporting this @bitfehler. Just a nit, otherwise LGTM:

The billy package contains a `Change` interface type, which seems to
have gone unused for several years now, presumably due to the difficulty
of implementing most of the required methods for all supported
platforms.

This commit splits out a `Chmod` interface from it, which is supported
on all platforms. The interface is implemented in all applicable
abstractions.

Supporting `chmod` in billy would help with issues such as
go-git/go-git#588

This is a backport of commit 601c531 on main (go-git#157).

Signed-off-by: Conrad Hoffmann <[email protected]>
Copy link
Member

@pjbgf pjbgf left a comment

Choose a reason for hiding this comment

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

@bitfehler thanks for working on this. 🙇

@pjbgf pjbgf merged commit 9263834 into go-git:releases/v5.x Dec 4, 2025
11 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