Skip to content

Migrate Backup-Changes: git stash push (fix --include-untracked & -Message bugs) #58

Description

@shmuelie

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

Goal

Add a command to stash changes (git stash push) — ObjectiveGit's
Backup-Changes — with -KeepIndex, -IncludeUntracked, -All, and
-Message, modernized.

Modernize (do not port as-is)

  • ObjectiveGit builds the command string and runs it via Invoke-Expression.
    Use the shared helper with a git argument array.
  • Add [CmdletBinding(SupportsShouldProcess)]; honor -WhatIf/-Confirm.
  • Fix latent bugs while porting:
    • The -IncludeUntracked flag is built as --include--untracked (double dash,
      wrong flag) — should be --include-untracked.
    • -Message is a [string] tested with -ne $null; use an
      empty/whitespace check and pass -m <message> properly.
  • Prefer git stash push over the deprecated git stash save.
  • Cross-platform repository path handling; drop the magic exit-code / bug branch.

Acceptance criteria

  • Exported from both the .psm1 and .psd1 export lists.
  • Comment-based help; SupportsShouldProcess honored.
  • Final command name uses an approved verb and fits the module surface.
  • README command table + [Unreleased] CHANGELOG updated.
  • Deterministic Pester tests (temp repo with a dirty working tree).
  • 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