Skip to content

feat: resolve stack base from forge CLI when config omits repo.base - #73

Merged
hokwangchoi merged 1 commit into
hokwangchoi:masterfrom
simtel12:pgit/gregorios-leach/feat--resolve-stack-base-from-forge-cli-when-confi
May 1, 2026
Merged

feat: resolve stack base from forge CLI when config omits repo.base#73
hokwangchoi merged 1 commit into
hokwangchoi:masterfrom
simtel12:pgit/gregorios-leach/feat--resolve-stack-base-from-forge-cli-when-confi

Conversation

@simtel12

@simtel12 simtel12 commented May 1, 2026

Copy link
Copy Markdown

Add stack_base_hint::try_from_forge_cli as the extension point for hosting defaults; implement GitHub via gh repo view defaultBranchRef (origin/ or local branch when present).

Precedence remains: explicit [repo].base, forge CLI hint, then git heuristics. Pass forge type from repo_loader into resolve_base.

@simtel12
simtel12 force-pushed the pgit/gregorios-leach/feat--resolve-stack-base-from-forge-cli-when-confi branch 2 times, most recently from 2635227 to 78c7952 Compare May 1, 2026 09:44
Comment thread src/forge/stack_base_hint.rs Outdated
Comment thread src/forge/stack_base_hint.rs Outdated
"github" => super::github::try_cli_default_stack_base(repo),
// Future: "gitlab" => super::gitlab::try_cli_default_stack_base(repo),
// Future: "gitea" => super::gitea::try_cli_default_stack_base(repo),
_ => None,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please leave them as unimplemented!() for now instead of silent passthrough

@simtel12 simtel12 May 1, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't that break things for any non-github users? The current path falls through to previous behavior/attempting to use heuristics to determine the base.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, this is not the last resolution. Then, it's fine to leave it as is.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Order is:

  1. Config file
  2. CLI default (this)
  3. git heuristics (main | master)

Add stack_base_hint::try_from_forge_cli as the extension point for
hosting defaults; implement GitHub via gh repo view defaultBranchRef
(origin/<name> or local branch when present).

Precedence remains: explicit [repo].base, forge CLI hint, then git
heuristics. Pass forge type from repo_loader into resolve_base.

Made-with: Cursor
@simtel12
simtel12 force-pushed the pgit/gregorios-leach/feat--resolve-stack-base-from-forge-cli-when-confi branch from 28376fe to 1b16216 Compare May 1, 2026 17:36
@hokwangchoi
hokwangchoi merged commit 27cac7e into hokwangchoi:master May 1, 2026
1 check passed
@simtel12
simtel12 deleted the pgit/gregorios-leach/feat--resolve-stack-base-from-forge-cli-when-confi branch May 1, 2026 18:17
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.

3 participants