Skip to content

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

Merged
mjcheetham merged 1 commit intogit-ecosystem:masterfrom
mjcheetham:downlevel-git-parse
Mar 24, 2021
Merged

Drop the git config --show-scope option usage#318
mjcheetham merged 1 commit intogit-ecosystem:masterfrom
mjcheetham:downlevel-git-parse

Conversation

@mjcheetham
Copy link
Copy Markdown
Contributor

@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 derrickstolee, dscho and jeffhostetler and removed request for dscho March 24, 2021 09:22
Copy link
Copy Markdown
Contributor

@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