Skip to content

feat: per-commit branch label and --project filter#8

Merged
ashishxcode merged 1 commit into
mainfrom
feat/commit-branch-and-project-filter
Jun 3, 2026
Merged

feat: per-commit branch label and --project filter#8
ashishxcode merged 1 commit into
mainfrom
feat/commit-branch-and-project-filter

Conversation

@ashishxcode

Copy link
Copy Markdown
Owner

What

Two related additions to make worklogs branch-aware and scopeable to a single project.

Per-commit branch label

  • model.Item gains a Branch field.
  • collect: git log now uses --all --source and captures %S, the ref each commit was reached from; shortRef() strips refs/heads/, refs/remotes/<remote>/, and refs/tags/ prefixes to a clean branch name.
  • render: the commit markdown line now leads with the branch (linked to the commit) and keeps the repo as context, dropping the bare @hash. JSON output gains a branch field.
  • tui picker: new branch column, and branch is included in the / filter haystack.

Markdown example:

- feat: add agency customization fields  _([feat/agency-customization/02-06](…/commit/2d4b0ca) · saas-super-admin)_

--project filter

  • New --project <name> flag narrows the resolved repos to a single one by directory name (case-insensitive), erroring clearly if no configured repo matches.
commit-chronicle --project saas-super-admin --since "7 days ago"

Notes

  • Branch is resolved from git's source ref, so after a feature branch is merged/squashed into an integration branch, those commits may report the integration branch (e.g. development) rather than the original feature branch. Follow-up could prefer feature branches when a commit exists on both.

Test plan

  • go build ./..., go vet ./..., go test ./... all pass.
  • Verified end-to-end (markdown + json + picker) against real repos: branch resolves per commit, --project filters correctly, unknown project name errors cleanly.

Resolve the branch each commit was reached from (git log --all --source,
%S) and surface it everywhere a commit is listed:

- model.Item gains a Branch field
- collect: capture %S, strip refs/{heads,remotes/<remote>,tags}/ prefixes
- render: commit markdown leads with the branch (linked to the commit)
  and keeps the repo as context, dropping the bare @hash; JSON gains a
  branch field
- tui picker: new branch column, branch added to the filter haystack

Add a --project <name> flag that narrows the resolved repos to a single
one by directory name (case-insensitive), erroring clearly if none match.
@ashishxcode ashishxcode merged commit 5424676 into main Jun 3, 2026
5 checks passed
@ashishxcode ashishxcode deleted the feat/commit-branch-and-project-filter branch June 3, 2026 06:23
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