Skip to content

Fix config show: Correctly label config type and prevent duplication - #118

Merged
thomas-vilte merged 1 commit into
masterfrom
dev
Jul 30, 2026
Merged

thomas-vilte merged 1 commit into
masterfrom
dev

Conversation

@thomas-vilte

@thomas-vilte thomas-vilte commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Description

The config show command previously always printed "Global Configuration" initially, and then, if a local repository configuration existed, it would load and print it again under a "Local Configuration" header. This led to incorrect labeling (showing "Global" when a local config was active) and duplication of configuration details.

I've modified internal/commands/config/show.go to correctly identify if the active configuration is local (when inside a Git repository) or global, and print the appropriate header only once. This also removes the redundant logic that re-loaded and re-printed the local configuration.

Fixes # (issue)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

A new unit test labels the resolved config as local (not global) when run inside a repo, with no duplicate section was added in internal/commands/config/show_test.go. This test verifies that the output correctly identifies the configuration as "Local Configuration" when applicable, does not show "Global Configuration" in that scenario, and ensures that configuration details (like fallback identity) are printed exactly once.

  • Unit tests
  • Integration tests
  • Manual test: (describe below)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Test Plan & Evidence

Suggested Manual Verification

  • Unit Tests: Run go test ./... and ensure all tests pass
  • No Regressions: Verify that related features still work as expected

@thomas-vilte thomas-vilte changed the title placeholder Fix config show: Correctly label config type and prevent duplication Jul 30, 2026
@thomas-vilte thomas-vilte added fix Bug fixes test Testing, trials, and coverage labels Jul 30, 2026
@thomas-vilte
thomas-vilte merged commit 53cbd57 into master Jul 30, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fixes test Testing, trials, and coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant