gh-stack icon indicating copy to clipboard operation
gh-stack copied to clipboard

Support gh stack rebase --reset-author-date / --committer-date-is-author-date passthrough

Open Kick-snare opened this issue 7 months ago • 1 comments

Feature request

gh stack rebase currently invokes git rebase without passing through date-related flags. It would be useful to support --reset-author-date and/or --committer-date-is-author-date so users can control how commit timestamps are handled during cascade rebases.

Current behavior

git rebase and git rebase --onto are called with no date flags:

  • internal/git/gitops.go — Rebase(): runSilent("rebase", base)
  • internal/git/gitops.go — RebaseOnto(): runSilent("rebase", "--onto", newBase, oldBase, branch)

Commit timestamps follow git's default rebase behavior. There is no way to pass date-related flags through gh stack rebase.

Proposed behavior

Add optional flags to gh stack rebase:

  • --reset-author-date — forwards --reset-author-date to the underlying git rebase calls
  • --committer-date-is-author-date — forwards --committer-date-is-author-date to the underlying git rebase calls

These should be forwarded to both Rebase() and RebaseOnto() calls throughout the cascade rebase, including --continue flows.

Use case

When rebasing stacked branches, the committer date can become significantly newer than the author date, causing commits to appear out of chronological order in tools that sort by committer date. Having control over date handling during gh stack rebase would keep commit history clean and consistent.

Kick-snare avatar Apr 16 '26 07:04 Kick-snare

This has been implemented in #96

gh stack rebase now supports a --committer-date-is-author-date / --preserve-dates flag

skarim avatar May 28 '26 18:05 skarim