Skip to content

feat(feature-domain): use cases for Home and the graph - #142

Merged
dwikiriyadi merged 1 commit into
mainfrom
feat/g1-task8-use-cases
Nov 15, 2026
Merged

dwikiriyadi merged 1 commit into
mainfrom
feat/g1-task8-use-cases

Conversation

@dwikiriyadi

Copy link
Copy Markdown
Member

G1 Task 8 (closes #131).

What

:module:feature:home domain

  • OpenRepositoryUseCase.open(folder) returns one of:
    • Opened: the root (the working tree, or a bare repository's git folder) plus the subfolder pointed at. It's recorded in the recent list by real path.
    • FolderMissing
    • NotARepository: Home offers Init or Clone.
    • Untrusted: git's own spelling of the folder, and the exact git config --global --add safe.directory <path> to show.
    • Failed
  • trustAndOpen writes safe.directory only after that's been shown, then opens the folder again.
  • ScanFolderUseCase: found repositories, marked when Home already lists them, optionally made into a workspace.
  • CloneRepositoryUseCase and InitRepositoryUseCase record the new repository.

:module:feature:graph domain

  • GraphFilter: hidden and solo refs, turned into a LogScope. prunedTo drops refs that no longer exist.
  • LoadGraphUseCase.load(repository, filter).
  • SearchGraphUseCase: matching commit ids in batches, to highlight in the full graph (the author's choice).
  • GraphMatch: hash-prefix and author-type matching.
  • CompareSummaryUseCase: ahead, behind and the merge base.
  • ReflogTimelineUseCase: HEAD's reflog and every local branch's, merged newest first and paged. A move logged in several reflogs appears once with all its refs. Every entry's source is GIT until G2's op log.

:module:data:git (approved additions after the data-layer review)

  • LogScope.All(hidden) / LogScope.Only(refs) for CommitRepository.log and search. Only full ref names reach git; solo refs follow --end-of-options.
  • RepositoryAccessRepository.untrustedFolder(error), because features can't import :module:core:git's exception type.

Tests

  • 8 Home and 11 graph use-case tests, on fakes.
  • 3 new scope tests and an untrustedFolder check, on real git.
  • ./gradlew check passes on Git 2.54. Git 2.38 runs in git-min.

Notes for review

  • GitNexus rates the change critical with 305 flows. About 288 of them credit the new, uncalled untrustedFolder with steps it has nothing to do with.
  • The 17 real flows are the graph load and search paths through GitRunner. With the default scope, git gets the same arguments as before.
  • Rulings are in plans/progress.md.

🤖 Generated with Claude Code

Home: open a folder (root, subfolder, missing, not a repository,
untrusted with the exact safe.directory change shown first), scan a
folder, clone and init, each recorded in the recent list. Graph:
hide and solo refs, search highlighted in the full graph, hash and
author-type matching, the compare summary, and the reflog timeline
merged across HEAD and every branch.

The data layer gains LogScope for log and search, and
untrustedFolder for the dubious-ownership path.

Closes #131

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Dwiki Riyadi <[email protected]>
@dwikiriyadi
dwikiriyadi merged commit cdc6152 into main Nov 15, 2026
6 checks passed
@dwikiriyadi
dwikiriyadi deleted the feat/g1-task8-use-cases branch November 15, 2026 22:51
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.

G1 use cases: open, scan, clone, init, graph filters, compare, reflog

1 participant