Skip to content

Releases: hemandev/codeowners-git

v2.2.0

02 Mar 12:53
57d2709

Choose a tag to compare

Minor Changes

  • 1c9ecc7: Add --source flag to branch and multi-branch commands to split changes directly from an existing branch or PR without manual staging. Add --pr-body flag to branch and multi-branch for custom PR body text that overrides the repo's PR template.

v2.1.0

27 Feb 07:46
4c471a9

Choose a tag to compare

Minor Changes

  • 9dab921: Add --dry-run and --json flags for all major commands

    New Features

    • --dry-run flag — Available on branch, multi-branch, and extract commands. Shows a complete preview of what would happen (files, branches, commit messages, settings) without performing any git operations.

    • --json flag — Available on list, branch, multi-branch, and extract commands. Outputs machine-readable JSON to stdout and suppresses all human-readable log messages. Works with both normal execution and --dry-run mode.

    Details

    • list --json: Outputs { command, files, filters } or { command, grouped, filters } when used with --group
    • branch --dry-run: Shows owner, branch name, branch existence, commit message, matched/excluded files, and push/PR/flag settings
    • branch --json: Outputs branch result with success status, files, push state, and PR info
    • multi-branch --dry-run: Shows per-owner breakdown (branch, message, files), uncovered files, unowned files, and summary totals
    • multi-branch --json: Outputs aggregate results with per-owner success/failure details
    • extract --dry-run: Shows source, compare target, files to extract, excluded files, and filter settings
    • extract --json: Outputs extracted file list and source metadata
    • Silent mode suppresses all console.log/warn/error output when --json is active; JSON is written via saved original console.log
    • pushBranch in git.ts supports a silent option to switch stdio from "inherit" to "pipe", preventing output leaks during JSON mode
    • recover command is intentionally excluded from both flags (interactive with prompts)

v2.0.2

13 Jan 05:10
1948f4c

Choose a tag to compare

Patch Changes

  • 0390ed2: fix: branch command incorrectly pushes all files

v2.0.1

08 Dec 06:38

Choose a tag to compare

Patch Changes

v2.0.0

08 Dec 06:17
00c05be

Choose a tag to compare

Major Changes

  • 3b6a133: list and recover command enhancements

    Breaking Changes

    • All commands: Now work on staged files instead of unstaged files. Stage your changes with git add before running commands.
    • list command: Removed -o, --owner flag - use --include instead for owner filtering
    • branch command: Renamed -o, --owner to -i, --include for consistency with other commands
    • extract command: Renamed -o, --owner to -i, --include for consistency with other commands
    • Path patterns: Changed from comma-separated to micromatch brace expansion syntax
      • Before: packages,apps (comma-separated)
      • After: {packages,apps} (brace expansion)

    New Features

    • list command: Added [pattern] positional argument for path filtering (consistent with branch and multi-branch)
    • list command: Added --group, -g flag to group files by code owner
    • list, branch, multi-branch, extract commands: Added --exclusive, -e flag to only include files where the owner is the sole owner (excludes co-owned files)
    • list, branch, multi-branch, extract commands: Added --co-owned, -c flag to only include files with multiple owners (co-owned files)
    • extract command: Added [pattern] positional argument for path filtering (consistent with other commands)
    • Path patterns: Full micromatch/glob syntax support including *, **, ?, [...], {...}

Minor Changes

  • c51b9c0: Add path filtering support for branch and multi-branch commands

    • New optional [pattern] positional argument for branch and multi-branch commands
    • Filter files using micromatch patterns (e.g., packages, src/**/*.tsx, packages,apps)
    • Directory names automatically expand to include all files (e.g., packagespackages/**)
    • Supports comma-separated patterns for multiple directories

v1.8.0

09 Nov 17:37
acdaefb

Choose a tag to compare

Minor Changes

  • fca1a4d: Add graceful error handling with state tracking and recovery

    This release introduces a comprehensive error handling system that prevents users from being stuck in a limbo state when operations fail:

    New Features:

    • State Tracking: Every operation is tracked with a unique UUID in ~/.codeowners-git/state/ (user's home directory)
    • Recovery Command: New recover command to clean up and return to original state after failures
      • recover --list: List all incomplete operations
      • recover --auto: Automatically recover most recent operation
      • recover --id <uuid>: Recover specific operation
      • recover --keep-branches: Keep created branches during recovery
    • Graceful Shutdown: Signal handlers (SIGINT/SIGTERM) provide recovery instructions on interruption
    • Enhanced Error Messages: Clear recovery instructions shown when operations fail

    Improvements:

    • Operations tracked through all stages (creating-branch, committing, pushing, creating-pr)
    • Automatic cleanup on success (state files deleted)
    • Smart cleanup on failure (return to original branch, optional branch deletion)
    • State persists across crashes for reliable recovery
    • Detailed per-branch status tracking (created, committed, pushed, PR created, errors)

    Breaking Changes: None

    Users can now confidently recover from any error scenario (network failures, process crashes, user interruptions) using the new recover command.

  • fca1a4d: Add extract command to copy file changes from source branches/commits

    New extract command allows you to:

    • Extract changed files from any branch or commit to your working directory (unstaged)
    • Filter extracted files by codeowner using micromatch patterns (@team-*)
    • Automatically detect merge-base or compare against main branch
    • Review and modify extracted files before committing

    Common workflow:

    # Extract files from another branch
    cg extract -s feature/other-team -o "@my-team"
    
    # Then use branch command to commit
    cg branch -o @my-team -b my-branch -m "Extracted changes" -p --pr

    This is useful for cherry-picking changes from colleague's branches or copying work between feature branches.

v1.7.0

22 Aug 06:09
376d60d

Choose a tag to compare

Minor Changes

  • 598ce89: fix --draft-pr when body is empty

v1.6.0

22 Aug 05:42
dbe26ad

Choose a tag to compare

Minor Changes

  • 41a5d2c: Add GitHub PR integration and CLI alias

    • Add --pr and --draft-pr flags to branch and multi-branch commands for automatic pull request creation
    • Integrate with GitHub API to create pull requests with customizable templates
    • Add cg as a convenient CLI alias alongside codeowners-git
    • Improve workflow automation for team-based code review processes

v1.5.0

23 Jun 08:52
dfa163b

Choose a tag to compare

Minor Changes

  • 9be188f: - Add --append flag which allows reuse the same branch for further changes later

v1.4.2

22 Jun 05:35
5dd9841

Choose a tag to compare

Patch Changes

  • ebfceed: fix: --defaultOwners not working correctly