git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
YCYee Cheng Chin <yeecheng.chin@gmail.com>
Date
Dec 12, 2025, 19:19 UTC
Message-ID
<CAHTeOx-SMLh_idKhGczPKzZNOKy04uYXmUhL8Z79yRuNpmE4eA@mail.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.

Message 1 of 1 in “Git replay: How is it supposed to be used with raw commits?”
  1. Yee Cheng ChinDec 12, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.