Skip to content

Migrate Set-Config: set git config value with ShouldProcess #61

Description

@shmuelie

Part of #52. Depends on the shared git-invocation helper sub-issue.

Goal

Add a command to set a git config value (ObjectiveGit's Set-Config), with
-Location local/global/system — modernized.

Modernize (do not port as-is)

  • ObjectiveGit builds
    "git -C $Repository config --$Location $Property \"$Value\"" and runs it via
    Invoke-Expression — property/value are interpolated into the command string.
    Use the shared helper with a git argument array.
  • Add [CmdletBinding(SupportsShouldProcess)]; honor -WhatIf/-Confirm
    (changes persistent config, possibly --global/--system).
  • Keep the -Location ValidateSet('local','global','system'); the original's
    bespoke exit-code mapping (1/3/4) can be simplified — surface git's
    stderr via the shared helper.
  • Cross-platform path handling.

Acceptance criteria

  • Exported from both the .psm1 and .psd1 export lists.
  • Comment-based help; SupportsShouldProcess honored.
  • Property/value passed as discrete arguments (never interpolated into a command
    string); final command name uses an approved verb.
  • README command table + [Unreleased] CHANGELOG updated.
  • Deterministic Pester tests (temp repo; set + read back a --local value;
    assert -WhatIf writes nothing).
  • build/Test-Modules.ps1 and build/Invoke-Tests.ps1 pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedCannot proceed until another issue or dependency is resolvedenhancementNew feature or requestmodule:gitChanges to Shmuelie.Gittheme:migrationMigration or modernization of an existing implementation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions