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

Drop the git config --show-scope option usage #318

Merged
merged 1 commit into from
Mar 24, 2021

Conversation

mjcheetham
Copy link
Collaborator

@mjcheetham mjcheetham commented Mar 24, 2021

The Git config --show-scope option was only introduced in Git from
version 2.26 onwards. The latest version of Git available in some
distributions of Linux (or macOS) is often older.

We only needed to know the scope of configuration values in one
particular call site: reading all Azure Repos user bindinds.

Replace the single IGitConfiguration::Enumerate call with two calls to
Enumerate, one for the global scope, and one for the local one.

Drop the --show-scope option parsing.

Fixes: #313

The Git config `--show-scope` option was only introduced in Git from
version 2.26 onwards. The latest version of Git available in some
distributions of Linux (or macOS) is often older.

We only needed to know the scope of configuration values in one
particular call site: reading all Azure Repos user bindinds.

Replace the single `IGitConfiguration::Enumerate` call with two calls to
`Enumerate`, one for the global scope, and one for the local one.

Drop the --show-scope option parsing.
@mjcheetham mjcheetham changed the title Drop te config --show-scope option usage Drop the git config --show-scope option usage Mar 24, 2021
@mjcheetham mjcheetham requested review from dscho, derrickstolee and jeffhostetler and removed request for dscho March 24, 2021 09:22
Copy link
Collaborator

@dscho dscho left a comment

Choose a reason for hiding this comment

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

That's quite elegant! No unnecessary parsing because you simply use the scope that you wanted to have in the first place. I like it.

@mjcheetham mjcheetham merged commit 0b5d180 into git-ecosystem:master Mar 24, 2021
@mjcheetham mjcheetham deleted the downlevel-git-parse branch March 24, 2021 09:38
@mjcheetham mjcheetham mentioned this pull request May 6, 2021
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.

fatal: Failed to enumerate all Git configuration entries [129] error: unknown option `show-scope'
2 participants