Skip to content

pr-388/phillipwood/wip/rebase-commit-hooks-v2

When I converted the sequencer to avoid forking git commit i forgot about
the post-commit hook. These patches are based on
pw/rebase-i-show-HEAD-to-reword, otherwise the new test fails as that branch
changes the number of commits we make.

Thanks to Dscho & Junio for their comments on V1. I've made the following
changes:

Patches 1-3 These are new patches in response to Dscho's request to set
$EDITOR in a subshell. There were ~80 other tests that weren't doing that
and they are fixed in these patches. Patch 2 contains the main action,
unfortunately due to a combination of having to remove the trailing ' &&'
from the last line moved into the subshell and re-wrapping some lines due to
the increased indentation --color-moved and --color-moved-ws are of limited
use when viewing this patch.

Patch 4 (was 1) Unchanged

Patch 5 (was 2) I've moved the function definition to commit.c rather than
sequencer.c as suggested. I've also removed an unused struct argv_array from
run_prepare_commit_msg_hook() (There wasn't a compiler warning as it was
still calling argv_array_clear() at the end of the function) and reworded
the commit message.

Patch 6 (was 3) I've tided up the test and removed the wrapper function for
running the post-commit hook as suggested.

Phillip Wood (6):
  t3404: remove unnecessary subshell
  t3404: set $EDITOR in subshell
  t3404: remove uneeded calls to set_fake_editor
  sequencer.h fix placement of #endif
  move run_commit_hook() to libgit and use it there
  sequencer: run post-commit hook

 builtin/commit.c              |  22 --
 commit.c                      |  24 ++
 sequencer.c                   |  24 +-
 sequencer.h                   |   3 +-
 t/lib-rebase.sh               |  28 ++
 t/t3404-rebase-interactive.sh | 596 +++++++++++++++++++++-------------
 6 files changed, 432 insertions(+), 265 deletions(-)

base-commit: b0a3186140dbc7bd64cbc6ef733386a0f1eb6a4d

Submitted-As: https://public-inbox.org/git/pull.388.v2.git.1571135132.gitgitgadget@gmail.com
In-Reply-To: https://public-inbox.org/git/pull.388.git.gitgitgadget@gmail.com
Assets 2