Skip to content

ktsu merge: implement batch configuration CRUD (closes #2) #36

@matt-edmondson

Description

@matt-edmondson

Sub-task A of #15.

Note: my original draft of this issue said "closes #2." That was wrong — #2 was already resolved on 2026-05-03 by removing the dead --batch flag rather than wiring it up. This issue re-adds the flag with real CRUD semantics, as called out in #15.

MergeCommand today (KtsuTools/Commands/MergeCommand.cs) takes only <directory> and <filename> positional args. BlastMerge supported saving named batches of merge inputs and re-running them; this issue ports that functionality.

Surface

A "batch" is a saved bundle of merge inputs — at minimum the directory + filename pattern, optionally the diff style flag from sub-task B (#37) once that lands. Subcommand shape:

ktsu merge batch save <name> <directory> <filename> [--diff-style <style>]
ktsu merge batch list
ktsu merge batch show <name>
ktsu merge batch delete <name>
ktsu merge --batch <name>     # runs a saved batch

The existing positional form ktsu merge <directory> <filename> keeps working. --batch <name> re-introduces the option and is mutually exclusive with the positional args.

Storage

Use the existing settings infrastructure at KtsuTools.Core/Services/Settings/. ISettingsService.LoadOrCreate<T>() is generic over AppData<T>. Add a new MergeBatchSettings : AppData<MergeBatchSettings> with a Dictionary<string, MergeBatchEntry>. Don't roll a new persistence layer.

Tests

  • Round-trip: save → list → show → delete.
  • --batch <unknown> → exit non-zero with a clear message.
  • Mutual-exclusion error when both --batch and positional args are passed.
  • A saved batch with a --diff-style value survives a load (only meaningful once ktsu merge: add --diff-style flag (git unified vs side-by-side) #37 is in; until then accept the field but ignore on dispatch).

Out of scope

  • Pre-baked templates (Common Repository Files, Repository Sync Batch). Users save their own.
  • Importing/exporting batches. File separately if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions