feat(commit): add commit group (+list, +recent, +diff, +files) #387

Closed
Taoyouce wants to merge 0 commits from Taoyouce/gitlink-cli:feat/commit-group into master
Contributor

What

The CLI had no way to read commit history at all — no group, no subcommand. This adds a commit group wrapping Api::V1::Projects::CommitsController:

# Paged commit list, optionally from a branch/tag/SHA
gitlink-cli commit +list --owner Gitlink --repo forgeplus -s develop

# Recent commits filtered by keyword
gitlink-cli commit +recent --owner Gitlink --repo forgeplus -k fix

# Diff and changed files of a commit
gitlink-cli commit +diff --owner Gitlink --repo forgeplus -s <sha>
gitlink-cli commit +files --owner Gitlink --repo forgeplus -s <sha> -f app/models/user.rb

All four subcommands mirror the server contract exactly: sha/page/limit for index, keyword for recent, and the filepath variant of files (which dispatches to a different hat-client call server-side).

Validation

  • Production-verified on gitlink.org.cn against a 6700+-commit repo: list totals, keyword-filtered recent, and diff/files on a real SHA.
  • 3 unit tests (paths, query forwarding); register test updated for the new group; go test ./..., go vet, gofmt all clean.
  • README section and bilingual i18n keys included.
## What The CLI had no way to read commit history at all — no group, no subcommand. This adds a `commit` group wrapping `Api::V1::Projects::CommitsController`: ```bash # Paged commit list, optionally from a branch/tag/SHA gitlink-cli commit +list --owner Gitlink --repo forgeplus -s develop # Recent commits filtered by keyword gitlink-cli commit +recent --owner Gitlink --repo forgeplus -k fix # Diff and changed files of a commit gitlink-cli commit +diff --owner Gitlink --repo forgeplus -s <sha> gitlink-cli commit +files --owner Gitlink --repo forgeplus -s <sha> -f app/models/user.rb ``` All four subcommands mirror the server contract exactly: `sha`/`page`/`limit` for index, `keyword` for recent, and the `filepath` variant of files (which dispatches to a different hat-client call server-side). ## Validation - Production-verified on gitlink.org.cn against a 6700+-commit repo: list totals, keyword-filtered recent, and diff/files on a real SHA. - 3 unit tests (paths, query forwarding); register test updated for the new group; `go test ./...`, `go vet`, `gofmt` all clean. - README section and bilingual i18n keys included.
Taoyouce added 4 commits 2026-07-08 22:55:00 +08:00
1bd6e667a7 feat(commit): add commit group (+list, +recent, +diff, +files)
The CLI had no way to read commit history at all. New group wrapping
Api::V1::Projects::CommitsController:

- commit +list [-s ref]: paged commit list, optionally from a
  branch/tag/SHA
- commit +recent [-k keyword]: recent commits with keyword filter
- commit +diff -s <sha>: full diff of a commit
- commit +files -s <sha> [-f filepath]: files changed by a commit,
  optionally restricted to one path

Production-verified on gitlink.org.cn against a 6700+-commit repo
(list totals, keyword-filtered recent, real SHA diff/files). 3 unit
tests, README section, bilingual i18n keys.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
wbtiger closed this pull request 2026-07-14 22:56:11 +08:00
wbtiger reopened this pull request 2026-07-14 23:01:52 +08:00
wbtiger closed this pull request 2026-07-14 23:04:39 +08:00

Pull request closed

Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Gitlink/gitlink-cli#387
No description provided.