feat: define target alias/default resolution for the new :Forge CLI #147
Labels
No labels
bug
documentation
duplicate
enhancement
fugitive
good first issue
help wanted
invalid
question
v0.1.0
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
barrettruth/forge.nvim#147
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Prerequisites
Problem
Issue #142 defines a canonical Ex-style
:Forgecommand language, and #144 defines explicit repo/revision/location target parsing. But parsing explicit targets is only half of the problem.Forge still needs a canonical policy for what happens when users do not specify a target.
This is where the real fork/upstream behavior is decided:
repo=upstreammeansci listshould target by defaultpr createshould use for defaulthead=andbase=Without an explicit defaults/alias policy, the new CLI will still feel ambiguous even if the syntax is better.
Proposed solution
Define a dedicated target resolution policy for the new
:Forgecommand language.1. Alias resolution order
Resolve
repo=and repo-bearing targets in this order:This should be documented and tested.
2. Configurable aliases
Add user config for explicit target aliases.
Example shape:
The exact config shape can change, but the concept should be explicit and documented.
3. Explicit default policies
Define and document default target policy per command family.
At minimum:
head=base=4. Initial default recommendations
Recommended initial policy:
upstream, elseoriginpr list/issue list/release listdefault to collaboration repoci listdefaults to current branch revision with configurable repo policypr create headdefaults to current branch in the current push contextpr create basedefaults to collaboration repo default branch5. Clear override model
Defaults are policy only. Any explicit address (
repo=...,target=...,head=...,base=...) must override default policy cleanly.Acceptance criteria
originAlternatives considered
upstream-first behavior without config. This is simple, but too rigid for users with different remote layouts or self-hosted forges.Implemented in #151.