Skip to content

git-aware mode (gdf git), difftool support, untracked files#5

Merged
mbarlow merged 2 commits into
mainfrom
feat/git-diff
Jun 7, 2026
Merged

git-aware mode (gdf git), difftool support, untracked files#5
mbarlow merged 2 commits into
mainfrom
feat/git-diff

Conversation

@mbarlow

@mbarlow mbarlow commented Jun 7, 2026

Copy link
Copy Markdown
Owner

Adds a git-aware multi-file diff mode and difftool integration, and fixes a diff-mode crash on missing files.

gdf git — view working changes in one window

  • gdf git [<rev>] [--staged] reads git directly and shows every changed file in one window with a file-list sidebar.
  • Sidebar status badges: M modified, A staged-add, D deleted, R renamed, U untracked. Per-file +/- counts. Sorted by path.
  • Panes labeled by ref: HEAD vs working tree / index.
  • Untracked files (non-ignored, via git ls-files --others --exclude-standard) are included and rendered all-new; --staged skips them.

gdf git — dark
gdf git — untracked, light

difftool support

  • make git-config now also wires difftool.gdf + diff.tool gdf.
  • git difftool works per-file (sequential, like mergetool).

Bug fix

  • Diff mode reads a missing/deleted side as empty instead of erroring. Fixes gdf: open <path>: no such file or directory when difftool hands gdf a deleted file's working path (and the added-file case). Verified end to end.

Tests

  • readSide (missing→empty), add/delete rows, countChanges, git session (M/D/untracked-U, sorted, no-changes, not-a-repo).

All gates green locally: gofmt, vet, race tests.

mbarlow and others added 2 commits June 7, 2026 11:38
…diff

- diff mode now reads a missing/deleted side as empty instead of erroring,
  so `git difftool` works on added/deleted files (fixes "no such file or
  directory" on deletions)
- `gdf git [<rev>] [--staged]`: reads git directly, shows all changed files
  in one window with a file-list sidebar (status M/A/D/R, +/- counts) and
  ref-labeled panes (HEAD vs working tree / index)
- Makefile git-config now also wires difftool.gdf + diff.tool; README gains a
  "View working changes" section and `gdf git` usage
- tests: readSide, add/delete rows, countChanges, git session (M/D/untracked,
  no-changes, not-a-repo)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- gdf git now lists untracked (non-ignored) files via
  `git ls-files --others --exclude-standard`, status "U", rendered all-new;
  --staged skips them. Files sorted by path.
- Sidebar gets a distinct U badge color.
- README: document U status, embed dark/light git-view screenshots.
- tests updated: untracked now expected as U (+sorted-order check).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mbarlow mbarlow merged commit e982d8e into main Jun 7, 2026
1 check passed
@mbarlow mbarlow deleted the feat/git-diff branch June 7, 2026 15:46
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