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

[PATCH v6 00/11] Introduce git-history(1) command for easy history editing

From
Patrick Steinhardt <ps@pks.im>
Date
Oct 27, 2025, 11:33 UTC
Message-ID
<20251027-b4-pks-history-builtin-v6-0-407dd3f57ad3@pks.im>
In-Reply-To
<20250819-b4-pks-history-builtin-v1-0-9b77c32688fe@pks.im>
Hi,

over recent months I've been playing around with Jujutsu quite frequently. While I still prefer using Git, there's been a couple features in it that I really like and that I'd like to have in Git, as well.

A copule of these features relate to history editing. Most importantly, I really dig the following commands:

  - jj-abandon(1) to drop a specific commit from your history.
  - jj-absorb(1) to take some changes and automatically apply them to
    commits in your history that last modified the respective hunks.
  - jj-split(1) to split a commit into two.
  - jj-new(1) to insert a new commit after or before a specific other
    commit.

Not all of these commands can be ported directly into Git. jj-new(1) for example doesn't really make a ton of sense for us, I'd claim. But some of these commands _do_ make sense.

This patch series is a starting point for such a command. I've significantly slimmed it down from the first couple revisions now following the discussions at the Contributor's Summit yesterday. This was my intent anyway, as I already mentioned on the last iteration.

Changes in v6:
  - I've rebased the patch series again to pull in the latest updates
    from sa/replay-atomic-ref-updates and fix conflicts. It is now based
    on 4e98b730f1 (The twenty-fourth batch, 2025-10-24) with ab661bb1bb
    (replay: add replay.refAction config option, 2025-10-23) merged into
    it.
  - I've dropped the "-m" options for now, so commit messages are always
    asked for via the editor. These can be introduced in a subsequent
    patch series once discussion around them has settled.
  - We don't use the merge machinery anymore to pick the commits.
  - Drop the commit to parse commits in the replay machinery. It didn't
    seem to be necessary in v5 anymore, and now that we don't use the
    merge machinery at all we don't ever take that code path in the
    first place.
  - Link to v5:
    https://lore.kernel.org/r/20251021-b4-pks-history-builtin-v5-0-78d23f578fe6@pks.im
Changes in v5:
  - I've changed the patch series to be based on top of 133d151831 (The
    twenty-first batch, 2025-10-20) with sa/replay-atomic-ref-updates at
    a1c22e627e (SQAUASH??? t0450 band-aid, 2025-10-14) merged into it.
    This is one the one hand to fix a conflict, but also to get some of
    the CI updates to make GitLab CI work again.
  - Some slight commit message improvements.
  - Deduplicate subcommand usage strings by using defines.
  - Fix the desendancy checks to properly verify that HEAD is a
    descendant of the commit to be rewritten. Also add some tests for
    this.
  - Fix the hint that mentions that lines starting with the comment
    character will be tripped after having written the commit message.
  - Move an include to the correct commit.
  - Link to v4: https://lore.kernel.org/r/20251001-b4-pks-history-builtin-v4-0-8e61ddb86317@pks.im
Changes in v4:
  - I've rebuilt the patch series. It is now based on 821f583da6 (The
    thirteenth batcn, 2025-09-29) with sa/replay-atomic-ref-updates
    at 665c66a743 (replay: make atomic ref updates the default behavior,
    2025-09-27) merged into it. This should fix all conflicts with seen.
  - I've reworked this patch series to use the same infra as
    git-replay(1), as discussed during the Contributor's Summit.
  - I've slimmed down the patch series to only tackle those commands
    that cannot result in a conflict to keep it simple. I also learned
    that Elijah has been working on a "git replay edit" command, so I
    dropped that command so that we can instead use his version.
  - During the Contributor's Summit we have agreed that for now, we
    won't care about hook execution just yet. This may be backfilled at
    a later point in time.
  - I dropped "commit.verbose" handling for now, as my understanding of
    it was wrong at first. This is something we should backfill.
  - Link to v3: https://lore.kernel.org/r/20250904-b4-pks-history-builtin-v3-0-509053514755@pks.im
Changes in v3:
  - Add logic to drive the "post-rewrite" hook and add tests to verify
    that all hooks are executed as expected.
  - Deduplicate logic to turn a replay action into a todo command.
  - Move the addition of tests for the top-level git-history(1) command
    to the correct commit.
  - Some smaller commit message fixes.
  - Honor "commit.verbose".
  - Fix copy-paste error with an error message.
  - Link to v2: https://lore.kernel.org/r/20250824-b4-pks-history-builtin-v2-0-964ac12f65bd@pks.im
Changes in v2:
  - Add a new "reword" subcommand.
  - List git-history(1) in "command-list.txt".
  - Add some missing error handling.
  - Simplify calling convention of `apply_commits()` to handle root
    commits internally instead of requiring every caller to do so.
  - Add tests to verify that git-history(1) refuses to work with changes
    in the worktree or index.
  - Mark git-history(1) as experimental.
  - Introduce commands to manage interrupted history edits.
  - A bunch of improvements to the manpage.
  - Link to v1: https://lore.kernel.org/r/20250819-b4-pks-history-builtin-v1-0-9b77c32688fe@pks.im
Thanks!
Patrick
---
Patrick Steinhardt (11):
      wt-status: provide function to expose status for trees
      replay: extract logic to pick commits
      replay: stop using `the_repository`
      builtin: add new "history" command
      builtin/history: implement "reword" subcommand
      add-patch: split out header from "add-interactive.h"
      add-patch: split out `struct interactive_options`
      add-patch: remove dependency on "add-interactive" subsystem
      add-patch: add support for in-memory index patching
      cache-tree: allow writing in-memory index as tree
      builtin/history: implement "split" subcommand
 .gitignore                     |   1 +
 Documentation/git-history.adoc | 111 ++++++++
 Documentation/meson.build      |   1 +
 Makefile                       |   2 +
 add-interactive.c              | 174 +++----------
 add-interactive.h              |  46 +---
 add-patch.c                    | 297 +++++++++++++++++++---
 add-patch.h                    |  64 +++++
 builtin.h                      |   1 +
 builtin/add.c                  |  22 +-
 builtin/checkout.c             |   7 +-
 builtin/commit.c               |  16 +-
 builtin/history.c              | 561 +++++++++++++++++++++++++++++++++++++++++
 builtin/replay.c               | 110 +-------
 builtin/reset.c                |  16 +-
 builtin/stash.c                |  46 ++--
 cache-tree.c                   |   5 +-
 cache-tree.h                   |   3 +-
 command-list.txt               |   1 +
 commit.h                       |   2 +-
 git.c                          |   1 +
 meson.build                    |   2 +
 replay.c                       | 115 +++++++++
 replay.h                       |  23 ++
 t/meson.build                  |   3 +
 t/t3450-history.sh             |  17 ++
 t/t3451-history-reword.sh      | 237 +++++++++++++++++
 t/t3452-history-split.sh       | 432 +++++++++++++++++++++++++++++++
 wt-status.c                    |  24 ++
 wt-status.h                    |   9 +
 30 files changed, 1972 insertions(+), 377 deletions(-)
Range-diff versus v5:
 1:  c351cd9fb34 !  1:  7e32877a47c wt-status: provide function to expose status for trees
    @@ wt-status.h: void wt_status_add_cut_line(struct wt_status *s);
      void wt_status_prepare(struct repository *r, struct wt_status *s);
      void wt_status_print(struct wt_status *s);
      void wt_status_collect(struct wt_status *s);
    ++
    ++/*
    ++ * Collect all changes between the two trees. Changes will be displayed as if
    ++ * they were staged into the index.
    ++ */
     +void wt_status_collect_changes_trees(struct wt_status *s,
     +				     const struct object_id *old_treeish,
     +				     const struct object_id *new_treeish);
    ++
      /*
       * Frees the buffers allocated by wt_status_collect.
       */
 2:  71266f8ed78 !  2:  3688a10ec38 replay: extract logic to pick commits
    @@ builtin/replay.c
      #include "revision.h"
      #include "strmap.h"
      #include <oidset.h>
    - #include <tree.h>
    +@@ builtin/replay.c: enum ref_action_mode {
    + 	REF_ACTION_PRINT
    + };
      
     -static const char *short_commit_name(struct repository *repo,
     -				     struct commit *commit)
    @@ builtin/replay.c: static void determine_replay_mode(struct repository *repo,
     -	return create_commit(repo, result->tree, pickme, replayed_base);
     -}
     -
    - static int handle_ref_update(const char *mode,
    + static int handle_ref_update(enum ref_action_mode mode,
      			     struct ref_transaction *transaction,
      			     const char *refname,
     @@ builtin/replay.c: int cmd_replay(int argc,
    @@ replay.c (new)
     +	return NULL;
     +}
     +
    -+static struct commit *create_commit(struct repository *repo,
    ++struct commit *replay_create_commit(struct repository *repo,
     +				    struct tree *tree,
     +				    struct commit *based_on,
     +				    struct commit *parent)
    @@ replay.c (new)
     +	merge_opt->ancestor = NULL;
     +	if (!result->clean)
     +		return NULL;
    -+	return create_commit(repo, result->tree, pickme, replayed_base);
    ++	return replay_create_commit(repo, result->tree, pickme, replayed_base);
     +}
     
      ## replay.h (new) ##
    @@ replay.h (new)
     +struct commit;
     +struct tree;
     +
    ++struct commit *replay_create_commit(struct repository *repo,
    ++				    struct tree *tree,
    ++				    struct commit *based_on,
    ++				    struct commit *parent);
    ++
     +struct commit *replay_pick_regular_commit(struct repository *repo,
     +					  struct commit *pickme,
     +					  kh_oid_map_t *replayed_commits,
 3:  703fc59d4e1 !  3:  7a5217797a0 replay: stop using `the_repository`
    @@ Commit message
         Signed-off-by: Patrick Steinhardt <ps@pks.im>
     
      ## replay.c ##
    -@@ replay.c: static struct commit *create_commit(struct repository *repo,
    +@@ replay.c: struct commit *replay_create_commit(struct repository *repo,
      	obj = parse_object(repo, &ret);
      
      out:
 4:  f18a8ac67e0 <  -:  ----------- replay: parse commits before dereferencing them
 5:  65892f7da77 !  4:  bc435f62d87 builtin: add new "history" command
    @@ Documentation/git-history.adoc (new)
     +Rewrite history by rearranging or modifying specific commits in the
     +history.
     +
    ++THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE.
    ++
     +This command is similar to linkgit:git-rebase[1] and uses the same
     +underlying machinery. You should use rebases if you want to reapply a range of
     +commits onto a different base, or interactive rebases if you want to edit a
    @@ Documentation/git-history.adoc (new)
     +merges. You should use linkgit:git-rebase[1] with the `--rebase-merges`
     +flag instead.
     +
    -+THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE.
    -+
     +COMMANDS
     +--------
     +
    -+This command requires a subcommand. Several subcommands are available to
    -+rewrite history in different ways:
    ++Several commands are available to rewrite history in different ways:
     +
     +CONFIGURATION
     +-------------
 6:  cefe1dbb847 !  5:  39a21dc2bbd builtin/history: implement "reword" subcommand
    @@ Commit message
         Signed-off-by: Patrick Steinhardt <ps@pks.im>
     
      ## Documentation/git-history.adoc ##
    -@@ Documentation/git-history.adoc: SYNOPSIS
    +@@ Documentation/git-history.adoc: git-history - EXPERIMENTAL: Rewrite history of the current branch
    + SYNOPSIS
      --------
      [synopsis]
    - git history [<options>]
    -+git history reword [<options>] <commit>
    +-git history [<options>]
    ++git history reword <commit>
      
      DESCRIPTION
      -----------
     @@ Documentation/git-history.adoc: COMMANDS
    - This command requires a subcommand. Several subcommands are available to
    - rewrite history in different ways:
      
    -+`reword <commit> [--message=<message>]`::
    + Several commands are available to rewrite history in different ways:
    + 
    ++`reword <commit>`::
     +	Rewrite the commit message of the specified commit. All the other
    -+	details of this commit remain unchanged. If no commit message is
    -+	provided, then this command will spawn an editor with the current
    -+	message of that commit.
    ++	details of this commit remain unchanged. This command will spawn an
    ++	editor with the current message of that commit.
     +
      CONFIGURATION
      -------------
    @@ builtin/history.c
     +#include "tree.h"
     +#include "wt-status.h"
     +
    -+#define GIT_HISTORY_REWORD_USAGE N_("git history reword [<options>] <commit>")
    ++#define GIT_HISTORY_REWORD_USAGE N_("git history reword <commit>")
     +
     +static int collect_commits(struct repository *repo,
     +			   struct commit *old_commit,
    @@ builtin/history.c
     +			 const char *action)
     +{
     +	struct reset_head_opts reset_opts = { 0 };
    -+	struct merge_options merge_opts = { 0 };
    -+	struct merge_result result = { 0 };
     +	struct strbuf buf = STRBUF_INIT;
    -+	kh_oid_map_t *replayed_commits;
     +	int ret;
     +
    -+	replayed_commits = kh_init_oid_map();
    -+
    -+	init_basic_merge_options(&merge_opts, repo);
    -+	merge_opts.show_rename_progress = 0;
    -+
     +	for (size_t i = 0; i < commits->nr; i++) {
     +		struct object_id commit_id;
     +		struct commit *commit;
     +		const char *end;
    -+		int hash_result;
    -+		khint_t pos;
     +
     +		if (parse_oid_hex_algop(commits->v[i], &commit_id, &end,
     +					repo->hash_algo)) {
    @@ builtin/history.c
     +
     +		if (!onto) {
     +			onto = commit;
    -+			result.clean = 1;
    -+			result.tree = repo_get_commit_tree(repo, commit);
     +		} else {
    -+			onto = replay_pick_regular_commit(repo, commit, replayed_commits,
    -+							  onto, &merge_opts, &result);
    ++			struct tree *tree = repo_get_commit_tree(repo, commit);
    ++			onto = replay_create_commit(repo, tree, commit, onto);
     +			if (!onto)
     +				break;
     +		}
    -+
    -+		pos = kh_put_oid_map(replayed_commits, commit->object.oid, &hash_result);
    -+		if (hash_result == 0) {
    -+			ret = error(_("duplicate rewritten commit: %s\n"),
    -+				    oid_to_hex(&commit->object.oid));
    -+			goto out;
    -+		}
    -+		kh_value(replayed_commits, pos) = onto;
    -+	}
    -+
    -+	if (!result.clean) {
    -+		ret = error(_("could not merge"));
    -+		goto out;
     +	}
     +
     +	reset_opts.oid = &onto->object.oid;
    @@ builtin/history.c
     +	ret = 0;
     +
     +out:
    -+	kh_destroy_oid_map(replayed_commits);
    -+	merge_finalize(&merge_opts, &result);
     +	strbuf_release(&buf);
     +	return ret;
     +}
    @@ builtin/history.c
     +			       const struct object_id *old_tree,
     +			       const struct object_id *new_tree,
     +			       const char *default_message,
    -+			       const char *provided_message,
     +			       const char *action,
     +			       struct strbuf *out)
     +{
    -+	if (!provided_message) {
    -+		const char *path = git_path_commit_editmsg();
    -+		const char *hint =
    -+			_("Please enter the commit message for the %s changes."
    -+			  " Lines starting\nwith '%s' will be ignored.\n");
    -+		struct wt_status s;
    -+
    -+		strbuf_addstr(out, default_message);
    -+		strbuf_addch(out, '\n');
    -+		strbuf_commented_addf(out, comment_line_str, hint, action, comment_line_str);
    -+		write_file_buf(path, out->buf, out->len);
    -+
    -+		wt_status_prepare(repo, &s);
    -+		FREE_AND_NULL(s.branch);
    -+		s.ahead_behind_flags = AHEAD_BEHIND_QUICK;
    -+		s.commit_template = 1;
    -+		s.colopts = 0;
    -+		s.display_comment_prefix = 1;
    -+		s.hints = 0;
    -+		s.use_color = 0;
    -+		s.whence = FROM_COMMIT;
    -+		s.committable = 1;
    -+
    -+		s.fp = fopen(git_path_commit_editmsg(), "a");
    -+		if (!s.fp)
    -+			return error_errno(_("could not open '%s'"), git_path_commit_editmsg());
    -+
    -+		wt_status_collect_changes_trees(&s, old_tree, new_tree);
    -+		wt_status_print(&s);
    -+		wt_status_collect_free_buffers(&s);
    -+		string_list_clear_func(&s.change, change_data_free);
    -+
    -+		strbuf_reset(out);
    -+		if (launch_editor(path, out, NULL)) {
    -+			fprintf(stderr, _("Please supply the message using the -m option.\n"));
    -+			return -1;
    -+		}
    -+		strbuf_stripspace(out, comment_line_str);
    -+	} else {
    -+		strbuf_addstr(out, provided_message);
    ++	const char *path = git_path_commit_editmsg();
    ++	const char *hint =
    ++		_("Please enter the commit message for the %s changes."
    ++		  " Lines starting\nwith '%s' will be ignored.\n");
    ++	struct wt_status s;
    ++
    ++	strbuf_addstr(out, default_message);
    ++	strbuf_addch(out, '\n');
    ++	strbuf_commented_addf(out, comment_line_str, hint, action, comment_line_str);
    ++	write_file_buf(path, out->buf, out->len);
    ++
    ++	wt_status_prepare(repo, &s);
    ++	FREE_AND_NULL(s.branch);
    ++	s.ahead_behind_flags = AHEAD_BEHIND_QUICK;
    ++	s.commit_template = 1;
    ++	s.colopts = 0;
    ++	s.display_comment_prefix = 1;
    ++	s.hints = 0;
    ++	s.use_color = 0;
    ++	s.whence = FROM_COMMIT;
    ++	s.committable = 1;
    ++
    ++	s.fp = fopen(git_path_commit_editmsg(), "a");
    ++	if (!s.fp)
    ++		return error_errno(_("could not open '%s'"), git_path_commit_editmsg());
    ++
    ++	wt_status_collect_changes_trees(&s, old_tree, new_tree);
    ++	wt_status_print(&s);
    ++	wt_status_collect_free_buffers(&s);
    ++	string_list_clear_func(&s.change, change_data_free);
    ++
    ++	strbuf_reset(out);
    ++	if (launch_editor(path, out, NULL)) {
    ++		fprintf(stderr, _("Please supply the message using the -m option.\n"));
    ++		return -1;
     +	}
    ++	strbuf_stripspace(out, comment_line_str);
     +
     +	cleanup_message(out, COMMIT_MSG_CLEANUP_ALL, 0);
     +
    @@ builtin/history.c
     +		GIT_HISTORY_REWORD_USAGE,
     +		NULL,
     +	};
    -+	const char *commit_message = NULL;
     +	struct option options[] = {
    -+		OPT_STRING('m', "message", &commit_message, N_("message"), N_("commit message")),
     +		OPT_END(),
     +	};
     +	struct strbuf final_message = STRBUF_INIT;
    @@ builtin/history.c
     +	find_commit_subject(original_message, &original_body);
     +
     +	ret = fill_commit_message(repo, &parent_tree_oid, &original_commit_tree_oid,
    -+				  original_body, commit_message, "reworded", &final_message);
    ++				  original_body, "reworded", &final_message);
     +	if (ret < 0)
     +		goto out;
     +
    @@ builtin/history.c
     +		struct repository *repo)
      {
      	const char * const usage[] = {
    - 		N_("git history [<options>]"),
    +-		N_("git history [<options>]"),
     +		GIT_HISTORY_REWORD_USAGE,
      		NULL,
      	};
    @@ t/t3451-history-reword.sh (new)
     +
     +. ./test-lib.sh
     +
    ++reword_with_message () {
    ++	cat >message &&
    ++	write_script fake-editor.sh <<-EOF &&
    ++	cp "$(pwd)/message" "\$1"
    ++	EOF
    ++	test_set_editor "$(pwd)"/fake-editor.sh &&
    ++	git history reword "$@" &&
    ++	rm fake-editor.sh message
    ++}
    ++
     +test_expect_success 'refuses to work with merge commits' '
     +	test_when_finished "rm -rf repo" &&
     +	git init repo &&
    @@ t/t3451-history-reword.sh (new)
     +		test_commit third &&
     +
     +		git symbolic-ref HEAD >expect &&
    -+		git history reword -m "third reworded" HEAD &&
    ++		reword_with_message HEAD <<-EOF &&
    ++		third reworded
    ++		EOF
     +		git symbolic-ref HEAD >actual &&
     +		test_cmp expect actual &&
     +
    @@ t/t3451-history-reword.sh (new)
     +		test_commit third &&
     +
     +		git symbolic-ref HEAD >expect &&
    -+		git history reword -m "second reworded" HEAD~ &&
    ++		reword_with_message HEAD~ <<-EOF &&
    ++		second reworded
    ++		EOF
     +		git symbolic-ref HEAD >actual &&
     +		test_cmp expect actual &&
     +
    @@ t/t3451-history-reword.sh (new)
     +		test_commit first &&
     +		test_commit second &&
     +		test_commit third &&
    -+		git history reword -m "first reworded" HEAD~2 &&
    ++		reword_with_message HEAD~2 <<-EOF &&
    ++		first reworded
    ++		EOF
     +
     +		cat >expect <<-EOF &&
     +		third
    @@ t/t3451-history-reword.sh (new)
     +# change in the future, and if it does this test here is expected to start
     +# failing. In other words, this test is not an endorsement of the current
     +# status quo.
    -+test_expect_success 'hooks are executed for rewritten commits' '
    ++test_expect_success 'hooks are not executed for rewritten commits' '
     +	test_when_finished "rm -rf repo" &&
     +	git init repo &&
     +	(
    @@ t/t3451-history-reword.sh (new)
     +		touch "$(pwd)/hooks.log
     +		EOF
     +
    -+		git history reword -m "second reworded" HEAD~ &&
    ++		reword_with_message HEAD~ <<-EOF &&
    ++		second reworded
    ++		EOF
     +
     +		cat >expect <<-EOF &&
     +		third
    @@ t/t3451-history-reword.sh (new)
     +		cd repo &&
     +		test_commit first &&
     +
    -+		test_must_fail git history reword -m "" HEAD 2>err &&
    ++		! reword_with_message HEAD 2>err </dev/null &&
     +		test_grep "Aborting commit due to empty commit message." err
     +	)
     +'
    @@ t/t3451-history-reword.sh (new)
     +		echo foo >a &&
     +		echo bar >b &&
     +		git add b &&
    -+		git history reword HEAD -m message &&
    ++		reword_with_message HEAD <<-EOF &&
    ++		message
    ++		EOF
     +		cat >expect <<-\EOF &&
     +		 M a
     +		M  b
 7:  a064a8c7eca =  6:  a1b1e5877bc add-patch: split out header from "add-interactive.h"
 8:  39c231e726f =  7:  4262663aa50 add-patch: split out `struct interactive_options`
 9:  104a42a552f =  8:  c285918281f add-patch: remove dependency on "add-interactive" subsystem
10:  2e60b2b6b48 =  9:  3f6e32241df add-patch: add support for in-memory index patching
11:  52bdbb2ac6a = 10:  c25564e1d16 cache-tree: allow writing in-memory index as tree
12:  052ee5bd58b ! 11:  221dd490af1 builtin/history: implement "split" subcommand
    @@ Commit message
     
      ## Documentation/git-history.adoc ##
     @@ Documentation/git-history.adoc: SYNOPSIS
    + --------
      [synopsis]
    - git history [<options>]
    - git history reword [<options>] <commit>
    -+git history split [<options>] <commit> [--] [<pathspec>...]
    + git history reword <commit>
    ++git history split <commit> [--] [<pathspec>...]
      
      DESCRIPTION
      -----------
    -@@ Documentation/git-history.adoc: rewrite history in different ways:
    - 	provided, then this command will spawn an editor with the current
    - 	message of that commit.
    +@@ Documentation/git-history.adoc: Several commands are available to rewrite history in different ways:
    + 	details of this commit remain unchanged. This command will spawn an
    + 	editor with the current message of that commit.
      
    -+`split [--message=<message>] <commit> [--] [<pathspec>...]`::
    ++`split <commit> [--] [<pathspec>...]`::
     +	Interactively split up <commit> into two commits by choosing
     +	hunks introduced by it that will be moved into the new split-out
     +	commit. These hunks will then be written into a new commit that
    @@ Documentation/git-history.adoc: rewrite history in different ways:
     +	commit.
     ++
     +The commit message of the new commit will be asked for by launching the
    -+configured editor, unless it has been specified with the `-m` option.
    -+Authorship of the commit will be the same as for the original commit.
    ++configured editor. Authorship of the commit will be the same as for the
    ++original commit.
     ++
     +If passed, _<pathspec>_ can be used to limit which changes shall be split out
     +of the original commit. Files not matching any of the pathspecs will remain
    @@ Documentation/git-history.adoc: include::includes/cmd-config-section-all.adoc[]
     + foo | 1 +
     + 2 files changed, 2 insertions(+)
     +
    -+$ git history split HEAD --message="split-out commit"
    ++$ git history split HEAD
     +diff --git a/bar b/bar
     +new file mode 100644
     +index 0000000..5716ca5
    @@ builtin/history.c
      #include "tree.h"
      #include "wt-status.h"
      
    - #define GIT_HISTORY_REWORD_USAGE N_("git history reword [<options>] <commit>")
    -+#define GIT_HISTORY_SPLIT_USAGE  N_("git history split [<options>] <commit> [--] [<pathspec>...]")
    + #define GIT_HISTORY_REWORD_USAGE N_("git history reword <commit>")
    ++#define GIT_HISTORY_SPLIT_USAGE  N_("git history split <commit> [--] [<pathspec>...]")
      
      static int collect_commits(struct repository *repo,
      			   struct commit *old_commit,
    @@ builtin/history.c: static int cmd_history_reword(int argc,
     +static int split_commit(struct repository *repo,
     +			struct commit *original_commit,
     +			struct pathspec *pathspec,
    -+			const char *commit_message,
     +			struct object_id *out)
     +{
     +	struct interactive_options interactive_opts = INTERACTIVE_OPTIONS_INIT;
    @@ builtin/history.c: static int cmd_history_reword(int argc,
     +		original_author = xmemdupz(ptr, len);
     +
     +	ret = fill_commit_message(repo, &parent_tree_oid, &split_tree->object.oid,
    -+				  "", commit_message, "split-out", &split_message);
    ++				  "", "split-out", &split_message);
     +	if (ret < 0)
     +		goto out;
     +
    @@ builtin/history.c: static int cmd_history_reword(int argc,
     +		GIT_HISTORY_SPLIT_USAGE,
     +		NULL,
     +	};
    -+	const char *commit_message = NULL;
     +	struct option options[] = {
    -+		OPT_STRING('m', "message", &commit_message, N_("message"), N_("commit message")),
     +		OPT_END(),
     +	};
     +	struct oidmap rewritten_commits = OIDMAP_INIT;
    @@ builtin/history.c: static int cmd_history_reword(int argc,
     +	 * Then we split up the commit and replace the original commit with the
     +	 * new ones.
     +	 */
    -+	ret = split_commit(repo, original_commit, &pathspec,
    -+			   commit_message, split_commits);
    ++	ret = split_commit(repo, original_commit, &pathspec, split_commits);
     +	if (ret < 0)
     +		goto out;
     +
    @@ builtin/history.c: static int cmd_history_reword(int argc,
      		const char **argv,
      		const char *prefix,
     @@ builtin/history.c: int cmd_history(int argc,
    + {
      	const char * const usage[] = {
    - 		N_("git history [<options>]"),
      		GIT_HISTORY_REWORD_USAGE,
     +		GIT_HISTORY_SPLIT_USAGE,
      		NULL,
    @@ t/t3452-history-split.sh (new)
     +. ./test-lib.sh
     +
     +set_fake_editor () {
    -+	write_script fake-editor.sh <<-\EOF &&
    -+	echo "split-out commit" >"$1"
    ++	write_script fake-editor.sh <<-EOF &&
    ++	echo "$@" >"\$1"
     +	EOF
     +	test_set_editor "$(pwd)"/fake-editor.sh
     +}
    @@ t/t3452-history-split.sh (new)
     +		git commit -m split-me &&
     +
     +		git symbolic-ref HEAD >expect &&
    -+		set_fake_editor &&
    ++		set_fake_editor "split-out commit" &&
     +		git history split HEAD <<-EOF &&
     +		y
     +		n
    @@ t/t3452-history-split.sh (new)
     +		git commit -m root &&
     +		test_commit tip &&
     +
    -+		set_fake_editor &&
    ++		set_fake_editor "split-out commit" &&
     +		git history split HEAD~ <<-EOF &&
     +		y
     +		n
    @@ t/t3452-history-split.sh (new)
     +		git commit -m split-me &&
     +		test_commit tip &&
     +
    -+		set_fake_editor &&
    ++		set_fake_editor "split-out commit" &&
     +		git history split HEAD~ <<-EOF &&
     +		y
     +		n
    @@ t/t3452-history-split.sh (new)
     +		git add . &&
     +		git commit -m split-me &&
     +
    -+		git history split HEAD -m "split-out commit" <<-EOF &&
    ++		set_fake_editor "split-out-commit" &&
    ++		git history split HEAD <<-EOF &&
     +		y
     +		n
     +		y
    @@ t/t3452-history-split.sh (new)
     +		git add . &&
     +		git commit -m split-me &&
     +
    -+		git history split HEAD -m "split-out commit" <<-EOF &&
    ++		set_fake_editor "split-out commit" &&
    ++		git history split HEAD <<-EOF &&
     +		n
     +		y
     +		EOF
    @@ t/t3452-history-split.sh (new)
     +		git add . &&
     +		git commit -m split-me &&
     +
    -+		test_must_fail git history split HEAD -m "" <<-EOF 2>err &&
    ++		set_fake_editor "" &&
    ++		test_must_fail git history split HEAD <<-EOF 2>err &&
     +		y
     +		n
     +		EOF
    @@ t/t3452-history-split.sh (new)
     +	)
     +'
     +
    -+test_expect_success 'can specify message via option' '
    -+	test_when_finished "rm -rf repo" &&
    -+	git init repo &&
    -+	(
    -+		cd repo &&
    -+		touch bar foo &&
    -+		git add . &&
    -+		git commit -m split-me &&
    -+
    -+		git history split HEAD -m "message option" <<-EOF &&
    -+		y
    -+		n
    -+		EOF
    -+
    -+		expect_log <<-EOF
    -+		split-me
    -+		message option
    -+		EOF
    -+	)
    -+'
    -+
     +test_expect_success 'commit message editor sees split-out changes' '
     +	test_when_finished "rm -rf repo" &&
     +	git init repo &&
    @@ t/t3452-history-split.sh (new)
     +		git add . &&
     +		git commit -m split-me &&
     +
    -+		git history split HEAD -m "message option" -- foo <<-EOF &&
    ++		set_fake_editor "split-out commit" &&
    ++		git history split HEAD -- foo <<-EOF &&
     +		y
     +		EOF
     +
    @@ t/t3452-history-split.sh (new)
     +		touch "$(pwd)/hooks.log"
     +		EOF
     +
    -+		set_fake_editor &&
    ++		set_fake_editor "split-out commit" &&
     +		git history split HEAD <<-EOF &&
     +		y
     +		n
    @@ t/t3452-history-split.sh (new)
     +		echo a-modified >a &&
     +		echo b-modified >b &&
     +		git add b &&
    -+		git history split HEAD -m a-only <<-EOF &&
    ++		set_fake_editor "a-only" &&
    ++		git history split HEAD <<-EOF &&
     +		y
     +		n
     +		EOF
    @@ t/t3452-history-split.sh (new)
     +		M  b
     +		?? actual
     +		?? expect
    ++		?? fake-editor.sh
     +		EOF
     +		git status --porcelain >actual &&
     +		test_cmp expect actual

--- base-commit: a912335e972768e607159eb74a4c7b62f86ee38e change-id: 20250819-b4-pks-history-builtin-83398f9a05f0

Previous: Junio C HamanoNext: Patrick Steinhardt
Message 202 of 325 in “Introduce git-history(1) command for easy history editing”
  1. 00/11 Introduce git-history(1) command for easy history editingPatrick Steinhardt, Aug 19, 2025
  2. 01/11 sequencer: optionally skip printing commit summaryPatrick Steinhardt, Aug 19, 2025
  3. 02/11 sequencer: add option to rewind HEAD after picking commitsPatrick Steinhardt, Aug 19, 2025
  4. 03/11 cache-tree: allow writing in-memory index as treePatrick Steinhardt, Aug 19, 2025
  5. 04/11 builtin: add new "history" commandPatrick Steinhardt, Aug 19, 2025
  6. 05/11 builtin/history: implement "drop" subcommandPatrick Steinhardt, Aug 19, 2025
  7. Ben KnobleAug 20, 2025
  8. Patrick SteinhardtAug 22, 2025
  9. Jean-Noël AVILAAug 23, 2025
  10. Patrick SteinhardtAug 24, 2025
  11. 06/11 builtin/history: implement "reorder" subcommandPatrick Steinhardt, Aug 19, 2025
  12. Jean-Noël AVILAAug 23, 2025
  13. Kristoffer HaugsbakkAug 24, 2025
  14. Patrick SteinhardtAug 24, 2025
  15. 07/11 add-patch: split out header from "add-interactive.h"Patrick Steinhardt, Aug 19, 2025
  16. 08/11 add-patch: split out `struct interactive_options`Patrick Steinhardt, Aug 19, 2025
  17. 09/11 add-patch: remove dependency on "add-interactive" subsystemPatrick Steinhardt, Aug 19, 2025
  18. 10/11 add-patch: add support for in-memory index patchingPatrick Steinhardt, Aug 19, 2025
  19. D. Ben KnobleAug 20, 2025
  20. Patrick SteinhardtAug 22, 2025
  21. 11/11 builtin/history: implement "split" subcommandPatrick Steinhardt, Aug 19, 2025
  22. D. Ben KnobleAug 20, 2025
  23. Patrick SteinhardtAug 22, 2025
  24. Junio C HamanoAug 22, 2025
  25. Patrick SteinhardtAug 24, 2025
  26. Jean-Noël AVILAAug 23, 2025
  27. Patrick SteinhardtAug 24, 2025
  28. D. Ben KnobleAug 19, 2025
  29. Patrick SteinhardtAug 20, 2025
  30. Ben KnobleAug 20, 2025
  31. Junio C HamanoAug 20, 2025
  32. Ben KnobleAug 20, 2025
  33. Patrick SteinhardtAug 22, 2025
  34. Junio C HamanoAug 22, 2025
  35. Sergey OrganovAug 21, 2025
  36. Ben KnobleAug 21, 2025
  37. Sergey OrganovAug 21, 2025
  38. Martin von ZweigbergkAug 24, 2025
  39. Patrick SteinhardtAug 24, 2025
  40. SZEDER GáborSep 17, 2025
  41. Matthias BeyerDec 3, 2025
  42. Phillip WoodDec 10, 2025
  43. Matthias BeyerDec 10, 2025
  44. Phillip WoodDec 10, 2025
  45. Junio C HamanoDec 10, 2025
  46. Patrick SteinhardtDec 19, 2025
  47. SZEDER GáborDec 19, 2025
  48. Patrick SteinhardtDec 19, 2025
  49. Elijah NewrenDec 19, 2025
  50. Elijah NewrenDec 20, 2025
  51. Patrick SteinhardtJan 6, 2026
  52. Phillip WoodDec 22, 2025
  53. Patrick SteinhardtJan 6, 2026
  54. D. Ben KnobleDec 22, 2025
  55. Martin von ZweigbergkDec 10, 2025
  56. Elijah NewrenDec 10, 2025
  57. Martin von ZweigbergkDec 10, 2025
  58. Elijah NewrenDec 10, 2025
  59. Kristoffer HaugsbakkDec 15, 2025
  60. Kristoffer HaugsbakkAug 24, 2025
  61. Patrick SteinhardtAug 24, 2025
  62. 00/16 Introduce git-history(1) command for easy history editingPatrick Steinhardt, Aug 24, 2025
  63. 01/16 sequencer: optionally skip printing commit summaryPatrick Steinhardt, Aug 24, 2025
  64. 02/16 sequencer: add option to rewind HEAD after picking commitsPatrick Steinhardt, Aug 24, 2025
  65. 03/16 sequencer: introduce new history editing modePatrick Steinhardt, Aug 24, 2025
  66. D. Ben KnobleAug 26, 2025
  67. Patrick SteinhardtSep 3, 2025
  68. 04/16 sequencer: stop using `the_repository` in `sequencer_remove_state()`Patrick Steinhardt, Aug 24, 2025
  69. 05/16 cache-tree: allow writing in-memory index as treePatrick Steinhardt, Aug 24, 2025
  70. Junio C HamanoAug 25, 2025
  71. Patrick SteinhardtSep 3, 2025
  72. 06/16 builtin: add new "history" commandPatrick Steinhardt, Aug 24, 2025
  73. 07/16 builtin/history: introduce subcommands to manage interrupted rewritesPatrick Steinhardt, Aug 24, 2025
  74. 08/16 builtin/history: implement "drop" subcommandPatrick Steinhardt, Aug 24, 2025
  75. 09/16 builtin/history: implement "reorder" subcommandPatrick Steinhardt, Aug 24, 2025
  76. D. Ben KnobleAug 26, 2025
  77. Patrick SteinhardtSep 3, 2025
  78. 10/16 add-patch: split out header from "add-interactive.h"Patrick Steinhardt, Aug 24, 2025
  79. Junio C HamanoAug 25, 2025
  80. 11/16 add-patch: split out `struct interactive_options`Patrick Steinhardt, Aug 24, 2025
  81. 12/16 add-patch: remove dependency on "add-interactive" subsystemPatrick Steinhardt, Aug 24, 2025
  82. Junio C HamanoAug 25, 2025
  83. 13/16 add-patch: add support for in-memory index patchingPatrick Steinhardt, Aug 24, 2025
  84. 14/16 wt-status: provide function to expose status for treesPatrick Steinhardt, Aug 24, 2025
  85. 15/16 builtin/history: implement "split" subcommandPatrick Steinhardt, Aug 24, 2025
  86. Kristoffer HaugsbakkAug 24, 2025
  87. Patrick SteinhardtSep 3, 2025
  88. D. Ben KnobleAug 26, 2025
  89. Patrick SteinhardtSep 3, 2025
  90. D. Ben KnobleSep 3, 2025
  91. Patrick SteinhardtSep 4, 2025
  92. D. Ben KnobleSep 12, 2025
  93. Patrick SteinhardtSep 15, 2025
  94. Ben KnobleSep 15, 2025
  95. 16/16 builtin/history: implement "reword" subcommandPatrick Steinhardt, Aug 24, 2025
  96. Kristoffer HaugsbakkAug 24, 2025
  97. Patrick SteinhardtSep 3, 2025
  98. D. Ben KnobleSep 3, 2025
  99. Patrick SteinhardtSep 4, 2025
  100. 00/18 Introduce git-history(1) command for easy history editingPatrick Steinhardt, Sep 4, 2025
  101. 01/18 sequencer: optionally skip printing commit summaryPatrick Steinhardt, Sep 4, 2025
  102. Phillip WoodSep 10, 2025
  103. Patrick SteinhardtSep 15, 2025
  104. 02/18 sequencer: add option to rewind HEAD after picking commitsPatrick Steinhardt, Sep 4, 2025
  105. Phillip WoodSep 10, 2025
  106. Patrick SteinhardtSep 15, 2025
  107. Phillip WoodSep 15, 2025
  108. 03/18 sequencer: introduce new history editing modePatrick Steinhardt, Sep 4, 2025
  109. 04/18 sequencer: stop using `the_repository` in `sequencer_remove_state()`Patrick Steinhardt, Sep 4, 2025
  110. 05/18 sequencer: wire up "rewritten-hook" for REPLAY_HISTORY_EDITPatrick Steinhardt, Sep 4, 2025
  111. 06/18 cache-tree: allow writing in-memory index as treePatrick Steinhardt, Sep 4, 2025
  112. 07/18 builtin: add new "history" commandPatrick Steinhardt, Sep 4, 2025
  113. 08/18 builtin/history: introduce subcommands to manage interrupted rewritesPatrick Steinhardt, Sep 4, 2025
  114. 09/18 builtin/history: implement "drop" subcommandPatrick Steinhardt, Sep 4, 2025
  115. 10/18 builtin/history: implement "reorder" subcommandPatrick Steinhardt, Sep 4, 2025
  116. 11/18 add-patch: split out header from "add-interactive.h"Patrick Steinhardt, Sep 4, 2025
  117. 12/18 add-patch: split out `struct interactive_options`Patrick Steinhardt, Sep 4, 2025
  118. 13/18 add-patch: remove dependency on "add-interactive" subsystemPatrick Steinhardt, Sep 4, 2025
  119. 14/18 add-patch: add support for in-memory index patchingPatrick Steinhardt, Sep 4, 2025
  120. 15/18 wt-status: provide function to expose status for treesPatrick Steinhardt, Sep 4, 2025
  121. 16/18 sequencer: allow callers to provide mappings for the old commitPatrick Steinhardt, Sep 4, 2025
  122. 17/18 builtin/history: implement "split" subcommandPatrick Steinhardt, Sep 4, 2025
  123. Phillip WoodSep 10, 2025
  124. Patrick SteinhardtSep 15, 2025
  125. 18/18 builtin/history: implement "reword" subcommandPatrick Steinhardt, Sep 4, 2025
  126. Phillip WoodSep 10, 2025
  127. Patrick SteinhardtSep 15, 2025
  128. Phillip WoodSep 15, 2025
  129. Patrick SteinhardtSep 16, 2025
  130. Phillip WoodSep 16, 2025
  131. Kristoffer HaugsbakkSep 5, 2025
  132. Patrick SteinhardtSep 5, 2025
  133. Elijah NewrenSep 7, 2025
  134. Phillip WoodSep 10, 2025
  135. Phillip WoodSep 10, 2025
  136. Patrick SteinhardtSep 15, 2025
  137. Oswald BuddenhagenSep 16, 2025
  138. Junio C HamanoSep 10, 2025
  139. Patrick SteinhardtSep 15, 2025
  140. 00/12 Introduce git-history(1) command for easy history editingPatrick Steinhardt, Oct 1, 2025
  141. 01/12 wt-status: provide function to expose status for treesPatrick Steinhardt, Oct 1, 2025
  142. Karthik NayakOct 14, 2025
  143. Patrick SteinhardtOct 21, 2025
  144. 02/12 replay: extract logic to pick commitsPatrick Steinhardt, Oct 1, 2025
  145. 03/12 replay: stop using `the_repository`Patrick Steinhardt, Oct 1, 2025
  146. Karthik NayakOct 14, 2025
  147. 04/12 replay: parse commits before dereferencing themPatrick Steinhardt, Oct 1, 2025
  148. Karthik NayakOct 14, 2025
  149. 05/12 builtin: add new "history" commandPatrick Steinhardt, Oct 1, 2025
  150. Kristoffer HaugsbakkOct 2, 2025
  151. Karthik NayakOct 14, 2025
  152. Patrick SteinhardtOct 21, 2025
  153. Junio C HamanoOct 22, 2025
  154. Karthik NayakOct 22, 2025
  155. 06/12 builtin/history: implement "reword" subcommandPatrick Steinhardt, Oct 1, 2025
  156. Karthik NayakOct 14, 2025
  157. Patrick SteinhardtOct 21, 2025
  158. 07/12 add-patch: split out header from "add-interactive.h"Patrick Steinhardt, Oct 1, 2025
  159. 08/12 add-patch: split out `struct interactive_options`Patrick Steinhardt, Oct 1, 2025
  160. Kristoffer HaugsbakkOct 2, 2025
  161. Karthik NayakOct 14, 2025
  162. Patrick SteinhardtOct 21, 2025
  163. 09/12 add-patch: remove dependency on "add-interactive" subsystemPatrick Steinhardt, Oct 1, 2025
  164. 10/12 add-patch: add support for in-memory index patchingPatrick Steinhardt, Oct 1, 2025
  165. Kristoffer HaugsbakkOct 2, 2025
  166. Patrick SteinhardtOct 2, 2025
  167. Karthik NayakOct 14, 2025
  168. 11/12 cache-tree: allow writing in-memory index as treePatrick Steinhardt, Oct 1, 2025
  169. 12/12 builtin/history: implement "split" subcommandPatrick Steinhardt, Oct 1, 2025
  170. Karthik NayakOct 14, 2025
  171. Patrick SteinhardtOct 21, 2025
  172. D. Ben KnobleOct 21, 2025
  173. Patrick SteinhardtOct 27, 2025
  174. Karthik NayakOct 14, 2025
  175. Junio C HamanoOct 14, 2025
  176. 00/12 Introduce git-history(1) command for easy history editingPatrick Steinhardt, Oct 21, 2025
  177. 01/12 wt-status: provide function to expose status for treesPatrick Steinhardt, Oct 21, 2025
  178. Junio C HamanoOct 21, 2025
  179. 02/12 replay: extract logic to pick commitsPatrick Steinhardt, Oct 21, 2025
  180. Junio C HamanoOct 21, 2025
  181. 03/12 replay: stop using `the_repository`Patrick Steinhardt, Oct 21, 2025
  182. Junio C HamanoOct 21, 2025
  183. Junio C HamanoOct 21, 2025
  184. 04/12 replay: parse commits before dereferencing themPatrick Steinhardt, Oct 21, 2025
  185. Junio C HamanoOct 21, 2025
  186. Patrick SteinhardtOct 27, 2025
  187. 05/12 builtin: add new "history" commandPatrick Steinhardt, Oct 21, 2025
  188. Junio C HamanoOct 21, 2025
  189. Patrick SteinhardtOct 27, 2025
  190. 06/12 builtin/history: implement "reword" subcommandPatrick Steinhardt, Oct 21, 2025
  191. Junio C HamanoOct 21, 2025
  192. D. Ben KnobleOct 21, 2025
  193. Patrick SteinhardtOct 27, 2025
  194. Patrick SteinhardtOct 27, 2025
  195. 07/12 add-patch: split out header from "add-interactive.h"Patrick Steinhardt, Oct 21, 2025
  196. 08/12 add-patch: split out `struct interactive_options`Patrick Steinhardt, Oct 21, 2025
  197. 09/12 add-patch: remove dependency on "add-interactive" subsystemPatrick Steinhardt, Oct 21, 2025
  198. 10/12 add-patch: add support for in-memory index patchingPatrick Steinhardt, Oct 21, 2025
  199. 11/12 cache-tree: allow writing in-memory index as treePatrick Steinhardt, Oct 21, 2025
  200. 12/12 builtin/history: implement "split" subcommandPatrick Steinhardt, Oct 21, 2025
  201. Junio C HamanoOct 21, 2025
  202. 00/11 Introduce git-history(1) command for easy history editingPatrick Steinhardt, Oct 27, 2025
  203. 01/11 wt-status: provide function to expose status for treesPatrick Steinhardt, Oct 27, 2025
  204. 02/11 replay: extract logic to pick commitsPatrick Steinhardt, Oct 27, 2025
  205. Phillip WoodNov 17, 2025
  206. Elijah NewrenNov 20, 2025
  207. 03/11 replay: stop using `the_repository`Patrick Steinhardt, Oct 27, 2025
  208. Elijah NewrenNov 20, 2025
  209. Patrick SteinhardtDec 2, 2025
  210. 04/11 builtin: add new "history" commandPatrick Steinhardt, Oct 27, 2025
  211. Phillip WoodNov 17, 2025
  212. Patrick SteinhardtDec 2, 2025
  213. Elijah NewrenNov 20, 2025
  214. Patrick SteinhardtDec 2, 2025
  215. D. Ben KnobleDec 2, 2025
  216. Patrick SteinhardtDec 3, 2025
  217. 05/11 builtin/history: implement "reword" subcommandPatrick Steinhardt, Oct 27, 2025
  218. Phillip WoodNov 17, 2025
  219. Patrick SteinhardtDec 2, 2025
  220. Phillip WoodDec 10, 2025
  221. Elijah NewrenNov 20, 2025
  222. Patrick SteinhardtDec 2, 2025
  223. SZEDER GáborNov 25, 2025
  224. Patrick SteinhardtDec 2, 2025
  225. 06/11 add-patch: split out header from "add-interactive.h"Patrick Steinhardt, Oct 27, 2025
  226. Elijah NewrenNov 20, 2025
  227. 07/11 add-patch: split out `struct interactive_options`Patrick Steinhardt, Oct 27, 2025
  228. Elijah NewrenNov 20, 2025
  229. Phillip WoodNov 20, 2025
  230. Patrick SteinhardtDec 2, 2025
  231. 08/11 add-patch: remove dependency on "add-interactive" subsystemPatrick Steinhardt, Oct 27, 2025
  232. Elijah NewrenNov 20, 2025
  233. Phillip WoodNov 20, 2025
  234. 09/11 add-patch: add support for in-memory index patchingPatrick Steinhardt, Oct 27, 2025
  235. Elijah NewrenNov 20, 2025
  236. Phillip WoodNov 20, 2025
  237. Patrick SteinhardtDec 2, 2025
  238. 10/11 cache-tree: allow writing in-memory index as treePatrick Steinhardt, Oct 27, 2025
  239. Elijah NewrenNov 20, 2025
  240. 11/11 builtin/history: implement "split" subcommandPatrick Steinhardt, Oct 27, 2025
  241. Elijah NewrenNov 20, 2025
  242. Patrick SteinhardtDec 2, 2025
  243. Phillip WoodNov 21, 2025
  244. Patrick SteinhardtDec 2, 2025
  245. Phillip WoodDec 10, 2025
  246. Patrick SteinhardtDec 19, 2025
  247. Sergey OrganovNov 12, 2025
  248. Elijah NewrenNov 20, 2025
  249. Junio C HamanoNov 20, 2025
  250. Elijah NewrenNov 20, 2025
  251. Junio C HamanoNov 20, 2025
  252. Elijah NewrenNov 20, 2025
  253. Phillip WoodNov 21, 2025
  254. Junio C HamanoNov 21, 2025
  255. Elijah NewrenNov 23, 2025
  256. Patrick SteinhardtDec 2, 2025
  257. Elijah NewrenDec 5, 2025
  258. Patrick SteinhardtDec 9, 2025
  259. Martin von ZweigbergkDec 9, 2025
  260. Phillip WoodDec 10, 2025
  261. Elijah NewrenDec 10, 2025
  262. Kristoffer HaugsbakkDec 9, 2025
  263. Working on top of mega mergesD. Ben Knoble, Dec 12, 2025
  264. Elijah NewrenNov 23, 2025
  265. Phillip WoodNov 24, 2025
  266. Elijah NewrenNov 25, 2025
  267. 00/12 Introduce git-history(1) command for easy history editingPatrick Steinhardt, Dec 3, 2025
  268. 01/12 wt-status: provide function to expose status for treesPatrick Steinhardt, Dec 3, 2025
  269. 02/12 replay: extract logic to pick commitsPatrick Steinhardt, Dec 3, 2025
  270. 03/12 replay: stop using `the_repository`Patrick Steinhardt, Dec 3, 2025
  271. 04/12 builtin: add new "history" commandPatrick Steinhardt, Dec 3, 2025
  272. Kristoffer HaugsbakkDec 22, 2025
  273. Patrick SteinhardtJan 6, 2026
  274. 05/12 builtin/history: implement "reword" subcommandPatrick Steinhardt, Dec 3, 2025
  275. 06/12 add-patch: split out header from "add-interactive.h"Patrick Steinhardt, Dec 3, 2025
  276. 07/12 add-patch: split out `struct interactive_options`Patrick Steinhardt, Dec 3, 2025
  277. 08/12 add-patch: remove dependency on "add-interactive" subsystemPatrick Steinhardt, Dec 3, 2025
  278. 09/12 add-patch: add support for in-memory index patchingPatrick Steinhardt, Dec 3, 2025
  279. 10/12 add-patch: allow disabling editing of hunksPatrick Steinhardt, Dec 3, 2025
  280. 11/12 cache-tree: allow writing in-memory index as treePatrick Steinhardt, Dec 3, 2025
  281. 12/12 builtin/history: implement "split" subcommandPatrick Steinhardt, Dec 3, 2025
  282. 0/7 Introduce git-history(1) command for easy history editingPatrick Steinhardt, Jan 9, 2026
  283. 1/7 builtin/replay: extract core logic to replay revisionsPatrick Steinhardt, Jan 9, 2026
  284. Elijah NewrenJan 10, 2026
  285. Patrick SteinhardtJan 12, 2026
  286. 2/7 builtin/replay: move core logic into "libgit.a"Patrick Steinhardt, Jan 9, 2026
  287. Elijah NewrenJan 10, 2026
  288. Patrick SteinhardtJan 12, 2026
  289. Elijah NewrenJan 13, 2026
  290. Patrick SteinhardtJan 13, 2026
  291. 3/7 replay: small set of cleanupsPatrick Steinhardt, Jan 9, 2026
  292. 4/7 replay: yield the object ID of the final rewritten commitPatrick Steinhardt, Jan 9, 2026
  293. Elijah NewrenJan 10, 2026
  294. Patrick SteinhardtJan 12, 2026
  295. 5/7 wt-status: provide function to expose status for treesPatrick Steinhardt, Jan 9, 2026
  296. 6/7 builtin: add new "history" commandPatrick Steinhardt, Jan 9, 2026
  297. Elijah NewrenJan 10, 2026
  298. Patrick SteinhardtJan 12, 2026
  299. 7/7 builtin/history: implement "reword" subcommandPatrick Steinhardt, Jan 9, 2026
  300. Elijah NewrenJan 10, 2026
  301. SZEDER GáborJan 10, 2026
  302. Patrick SteinhardtJan 12, 2026
  303. 0/2 SomeElijah Newren, Jan 11, 2026
  304. 8/7 SQUASH ME: FixupsElijah Newren, Jan 11, 2026
  305. 9/7 history: fix detached HEAD handlingElijah Newren, Jan 11, 2026
  306. Elijah NewrenJan 11, 2026
  307. Patrick SteinhardtJan 12, 2026
  308. 0/8 Introduce git-history(1) command for easy history editingPatrick Steinhardt, Jan 13, 2026
  309. 1/8 builtin/replay: extract core logic to replay revisionsPatrick Steinhardt, Jan 13, 2026
  310. 2/8 builtin/replay: move core logic into "libgit.a"Patrick Steinhardt, Jan 13, 2026
  311. 3/8 replay: small set of cleanupsPatrick Steinhardt, Jan 13, 2026
  312. 4/8 replay: support empty commit rangesPatrick Steinhardt, Jan 13, 2026
  313. 5/8 replay: support updating detached HEADPatrick Steinhardt, Jan 13, 2026
  314. 6/8 wt-status: provide function to expose status for treesPatrick Steinhardt, Jan 13, 2026
  315. 7/8 builtin: add new "history" commandPatrick Steinhardt, Jan 13, 2026
  316. 8/8 builtin/history: implement "reword" subcommandPatrick Steinhardt, Jan 13, 2026
  317. SZEDER GáborJan 16, 2026
  318. Elijah NewrenJan 17, 2026
  319. Junio C HamanoJan 18, 2026
  320. Junio C HamanoFeb 3, 2026
  321. Patrick SteinhardtFeb 5, 2026
  322. Elijah NewrenJan 16, 2026
  323. Junio C HamanoJan 16, 2026
  324. SZEDER GáborJan 16, 2026
  325. Junio C HamanoJan 21, 2026

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.