Skip to content

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

@Kick-snare

Description

@Kick-snare

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.goRebase(): runSilent("rebase", base)
  • internal/git/gitops.goRebaseOnto(): 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions