-
-
Notifications
You must be signed in to change notification settings - Fork 390
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
worktreeConfig capitalization problem #1285
Comments
Temporary fix to get the docs CI to run again from GitTools/actions#1115. Also see jelmer/dulwich#1285.
After some more testing, I found that git itself is insensitive to the capitalization of config entries. So I think the issue is that dulwich is treating the config entry as it is in the file rather without lower casing it first and that #1262 would be the right solution. |
Could you create a new PR, ideally with a unit test that reproduces the issue? |
I think the easiest, less intrusive fix is to change this: for extension, _value in config.items((b"extensions",)):
if extension not in (b"worktreeconfig",):
raise UnsupportedExtension(extension) to something like: for extension, _value in config.items((b"extensions",)):
if extension.lower() not in (b"worktreeconfig",):
raise UnsupportedExtension(extension)
It would be great to see if |
|
This comment was marked as outdated.
This comment was marked as outdated.
@jelmer would a simple fix like in #1285 (comment) work? can we merge it (add test and merge)? |
Yeah, just calling .lower() seems fine |
`extensions.worktreeconfig` was checked in a way that was not case-insensitive, but git config settings should be case insensitive. This behavior led to problems since the documentation describes the setting as `worktreeConfig` and GitHub Actions started setting the option with this casing. Fixes jelmer#1285
Here is my attempt: #1286 |
ConfigFile doesn't know about the fields and their supported values. We can't just lowercase all values returned from ConfigFile since that would also impact fields where case matters such as user.name |
It's not about converting values to lowercase, but keys, which as per the Git documentation should be case-insensitive; see #1285 (comment). |
|
Case insensitive is not the same as has no case, it just means comparisons should ignore case. |
@jelmer, some of the methods of Please take a look to these two alternative solutions, depending of whether you'd prefer to normalize keys to lowercase everywhere or just allow case-insensitive comparison:
If you deem #1286 enough, feel free to close both of my pull requests. Still, please keep in mind that this issue might arise again in the future with other configuration keys if we don't write an universal solution. |
`extensions.worktreeconfig` was checked in a way that was not case-insensitive, but git config settings should be case insensitive. This behavior led to problems since the documentation describes the setting as `worktreeConfig` and GitHub Actions started setting the option with this casing. Fixes #1285
So I think you're right that consistently returning lowercase section and variable names is probably the best approach here long-term. I've merged the lowercasing (#1286) since it addresses the immediate issue. CaseInsensitiveOrderedMultiDict tries to specifically preserve case today though - it keeps two copies, which it wouldn't need to do if all it cared about was lowercase keys. |
Besides consistency between Lines 91 to 102 in ed1a145
|
dulwich only tests for
extensions.worktreeconfig
but in the git documentation it is written asextensions.worktreeConfig
. Recently, we started seeing dulwich error in GitHub Actions withdulwich.repo.UnsupportedExtension: b'worktreeConfig'
. I tested locally and confirmed thatextensions.worktreeconfig
does not lead to an error from dulwich butextensions.worktreeConfig
does.I am not sure what is going on with GitHub Actions. I see that someone was affected by this in #1262 but then closed it as "fixed by git". Also, some other users have been having the opposite problem with GitHub Actions it seems: GitTools/actions#1115. It seems like this setting is not consistent across GitHub Actions runs recently.
The text was updated successfully, but these errors were encountered: