Skip to content

Re-design how the core.longPaths config setting is read#4031

Merged
dscho merged 2 commits intogit-for-windows:mainfrom
dscho:long-paths-config
Sep 22, 2022
Merged

Re-design how the core.longPaths config setting is read#4031
dscho merged 2 commits intogit-for-windows:mainfrom
dscho:long-paths-config

Conversation

@dscho
Copy link
Copy Markdown
Member

@dscho dscho commented Sep 21, 2022

For years now, we carry a rather large patch that essentially forces all commands to call the default config parser, first thing.

However, this is a bit fragile because too often, code changes, and either config calls are lost, or new locations are missed that would require the same treatment.

Let's overhaul the design to determine the core.longPaths value only when needed, via the cached config. This is much more robust, as it no longer requires this ginormous patch and as no new locations can be missed.

@dscho dscho self-assigned this Sep 21, 2022
@dscho
Copy link
Copy Markdown
Member Author

dscho commented Sep 21, 2022

It might be too late for this PR to be merged before v2.38.0 is due. I'm not sure. Opinions?

Copy link
Copy Markdown

@derrickstolee derrickstolee left a comment

Choose a reason for hiding this comment

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

On one hand, I normally don't like merging something that touches so many files so late in the release cycle.

On the other hand, the change seems clear. I especially like how you removed the global in favor of the method call. I also think that we aren't going to get any more confidence in this except by shipping it, since I doubt we are using long paths anywhere in our CI chain.

Let's avoid requiring `git_config()` to have been called all the time.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This is no longer necessary (and was fragile to begin with, as many code
paths might have been missed).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho merged commit 5d3dbc5 into git-for-windows:main Sep 22, 2022
@dscho dscho deleted the long-paths-config branch September 22, 2022 15:37
@dscho dscho added this to the Next release milestone Sep 22, 2022
@dscho dscho mentioned this pull request Sep 27, 2022
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