Skip to content

fix(rebase): Run --exec commands also if the stack base does not change#639

Merged
jpgrayson merged 1 commit into
stacked-git:masterfrom
mriemensberger:638-rebase-base-exec-executes-commands
Jun 22, 2026
Merged

fix(rebase): Run --exec commands also if the stack base does not change#639
jpgrayson merged 1 commit into
stacked-git:masterfrom
mriemensberger:638-rebase-base-exec-executes-commands

Conversation

@mriemensberger

@mriemensberger mriemensberger commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

stg rebase --exec is modeled after git rebase --exec. However, stg rebase --exec cmd {base} short-circuits the rebase entirely since the stack base does not change. This diverges from git rebase behavior which execute commands in a similar scenario git rebase --onto $(stg id {base}) $(stg id {base}) mybranch. Make stgit behave like git by removing the short-ciruiting if --exec is specified.

Fixes: #638

@mriemensberger mriemensberger force-pushed the 638-rebase-base-exec-executes-commands branch from 088a99c to 09ef0fa Compare June 21, 2026 11:55
`stg rebase --exec` is modeled after `git rebase --exec`. However,
`stg rebase --exec cmd {base}` short-circuits the rebase entirely since
the stack base does not change.  This diverges from `git rebase`
behavior which execute commands in a similar scenario
`git rebase --onto $(stg id {base}) $(stg id {base}) mybranch`.  Make
stgit behave like git by removing the short-ciruiting if `--exec` is
specified.

Fixes: stacked-git#638
Signed-off-by: Maximilian Riemensberger <riemensberger@cadami.net>
@mriemensberger mriemensberger force-pushed the 638-rebase-base-exec-executes-commands branch from 09ef0fa to ac3316e Compare June 21, 2026 12:05
@jpgrayson jpgrayson merged commit c02ebb8 into stacked-git:master Jun 22, 2026
@jpgrayson

Copy link
Copy Markdown
Collaborator

Thank you for this contribution, @mriemensberger.

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.

stg rebase {base} --exec cmd does nothing

2 participants