# Git replay: How is it supposed to be used with raw commits?

1 messages from 2025-12-12 to 2025-12-12. Participants: Yee Cheng Chin.
Thread: https://gitlist.dev/t/64617

## Yee Cheng Chin, 2025-12-12 19:19

Subject: Git replay: How is it supposed to be used with raw commits?
Message-ID: <CAHTeOx-SMLh_idKhGczPKzZNOKy04uYXmUhL8Z79yRuNpmE4eA@mail.gmail.com>
URL: https://gitlist.dev/e/CAHTeOx-SMLh_idKhGczPKzZNOKy04uYXmUhL8Z79yRuNpmE4eA%40mail.gmail.com

```
The new `git replay` command allows replaying commits without checking
them out in the worktree, but it only updates/prints out the result
commit (in handle_ref_update) if the commit you are replaying is tied
to a local branch (DECORATION_REF_LOCAL). If you just pass a raw
commit hash, git replay will happily replay the commits and create new
commits in the objects database, but doesn't print anything out. Is
there any way to recover the created commit? Right now it feels
confusing as the command succeeded, doesn't complain, and yet doesn't
print / update anything either, while silently creating new commits.

Just for reference, I mean doing something like:

    git replay --onto master master..45ab67bc

or

    git replay --onto master master..HEAD~

This could be useful when I'm playing around and don't want to
accidentally update an important branch, or scripting (where I don't
really really want branch names for intermediary commits).

It feels to me that there could be another display mode that just
prints all the new commits created and lets the user handle it.
Otherwise perhaps an error is better to inform the user that they are
supposed to be passing in a branch name.

```
