Derive PR title and body from commits with --fill / --fill-first #174
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/165-pr-create-fill"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #165.
fj pr createmade you retype a title and body the branch's commits already carry.--fillderives both fromgit log base..headand--fill-firstuses only the first commit, mirroringgh pr create --fill/--fill-first. Removes the most common create friction and makes one-command PRs viable in scripts.What changed:
git::log_commits(base, head)readsbase..headoldest-first with a record/unit-separated--format, so any subject or body byte parses back cleanly. No new API call; purely client-side.cli::pr_fillresolves the title and body from the commit list: a single commit fills the title from its subject and the body from its message; multiple commits use the first subject as the title and a bullet list of subjects as the body.--fill-firsttakes the first (oldest) commit only. Kept pure so #172's--templatepath can reuse it.pr createwires in--fill/--fill-first(mutually exclusive). Precedence: an explicit--title/--body/-Falways overrides the filled value; with no commits in range it errors instead of opening an empty editor.owner:branchhead is stripped to the bare branch beforegit log, since the commits live under the local name.Tests: 7 unit tests over the pure fill resolver (single/multi/first, empty-range error) and the log-record parser (multi-line bodies, empty range), plus CLI parse tests for the flags and their conflict. Full suite green (540), clippy and fmt clean. Verified the
git logformat string against real git separators.