replay: make it a minimal server side command
commit81613be31e0bedf8709fa0962f1b6f85dcb053a2
authorElijah Newren <newren@gmail.com>
Fri, 24 Nov 2023 11:10:39 +0000 (24 12:10 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sun, 26 Nov 2023 01:10:49 +0000 (26 10:10 +0900)
tree64c78614a8076b11664c765dcaf3dc7db2aa9533
parentfda7dea7c95a7958d36ead75116c1ffbf1791cc0
replay: make it a minimal server side command

We want this command to be a minimal command that just does server side
picking of commits, displaying the results on stdout for higher level
scripts to consume.

So let's simplify it:
  * remove the worktree and index reading/writing,
  * remove the ref (and reflog) updating,
  * remove the assumptions tying us to HEAD, since (a) this is not a
    rebase and (b) we want to be able to pick commits in a bare repo,
    i.e. to/from branches that are not checked out and not the main
    branch,
  * remove unneeded includes,
  * handle rebasing multiple branches by printing on stdout the update
    ref commands that should be performed.

The output can be piped into `git update-ref --stdin` for the ref
updates to happen.

In the future to make it easier for users to use this command
directly maybe an option can be added to automatically pipe its output
into `git update-ref`.

Co-authored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-replay.txt
builtin/replay.c
t/t3650-replay-basics.sh
t/t6429-merge-sequence-rename-caching.sh