Skip to content

Initial implementation#1

Draft
chris-peterson wants to merge 1 commit intomainfrom
initial-implementation
Draft

Initial implementation#1
chris-peterson wants to merge 1 commit intomainfrom
initial-implementation

Conversation

@chris-peterson
Copy link
Copy Markdown
Contributor

@chris-peterson chris-peterson commented Mar 27, 2026

Summary

TypeScript implementation of git-fi — a git plugin that maintains a temporary integration branch (fi) for early conflict detection and collaborative testing.

  • Full spec coverage — all 61 requirements in SPEC.md implemented and verified (STATUS.md)
  • Core workflow--add, --remove, --force, --again, --prune, --abort commands with in-place TTY annotation updates
  • GitLab CI integration — pipeline status display, OSC 8 hyperlinks, CI-aware commit messages
  • Interactive branch picker--select mode for add/remove/unified selection
  • Machine-readable output--bare and --json flags for scripting
  • Docsify documentation site with GitHub Pages CI

Diagrams

Command Dispatch

%%{ init: { 'look': 'handDrawn' } }%%
flowchart TD
    A[git fi] --> B{Action flag?}
    B -- none --> L[List branches in fi]
    B -- -a --> ADD[Add branches]
    B -- -r --> REM[Remove branches]
    B -- -f --> FRC[Force-replace branches]
    B -- -g --> AGN[Re-merge current branches]
    B -- -p --> PRN[Prune dead/merged branches]
    B -- -A --> ABT[Re-pull fi from origin]
    B -- -s --> SEL[Interactive picker]
    ADD --> M[Merge Process]
    REM --> M
    FRC --> M
    AGN --> M
    PRN --> M
    SEL --> M
    M --> S{Success?}
    S -- yes --> PUSH[Commit + force-push fi]
    S -- no --> FAIL[Abort + report conflicts]
    PUSH --> CLEAN[Restore original branch]
    FAIL --> CLEAN
Loading

Merge Process

%%{ init: { 'look': 'handDrawn' } }%%
flowchart TD
    PRE[Preflight checks] --> FETCH[Fetch origin]
    FETCH --> FI{origin/fi exists?}
    FI -- no --> BOOT{Bootstrap prompt}
    BOOT -- no --> X[Abort]
    BOOT -- yes --> DEAD
    FI -- yes --> DEAD[Prune dead branches]
    DEAD --> WARN[Warn already-merged]
    WARN --> CO[Checkout -B fi from main]
    CO --> MRG[git merge --no-commit --no-ff]
    MRG --> OK{Merge clean?}
    OK -- yes --> CMT[Commit with branch list]
    CMT --> PSH[git push -f origin fi]
    PSH --> LIST[Print branch table]
    OK -- no --> RST[git reset --hard]
    RST --> RPT[Report failed branches]
    LIST --> FIN[Delete local fi, restore branch]
    RPT --> FIN
Loading

Implementation Notes

Path Description
src/index.ts CLI entry point, flag parsing, dispatch
src/commands.ts list, add, remove, force, again, prune, abort, select
src/merge.ts core merge process (bootstrap, merge, commit, push, cleanup)
src/git.ts git operations (preflight, fetch, branch resolution, parsing)
src/gitlab.ts GitLab API integration (pipelines, CI status table)
src/style.ts terminal styling (ANSI colors, spinners, annotations, tables)
src/ui.ts user prompts (bootstrap confirmation)
src/types.ts shared type definitions
docs/ Docsify documentation site
SPEC.md behavioral specification (61 requirements)
STATUS.md requirement coverage tracker

@chris-peterson chris-peterson self-assigned this Mar 27, 2026
@chris-peterson chris-peterson force-pushed the initial-implementation branch 9 times, most recently from 41e914a to 2651b62 Compare April 2, 2026 17:57
Filter origin/fi from legacy-format branch parsing so it
does not appear as a phantom branch in the list output.
Also stop emitting 'origin/fi' in the empty legacy commit
message to prevent future occurrences.
@chris-peterson chris-peterson force-pushed the initial-implementation branch from 2651b62 to 3f3c4e0 Compare April 2, 2026 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant