Web lists-archives.com

git rebase regression: cannot pass a shell expression directly to --exec

Hi all,

It used to be possible to run a sequence like:

  foo() { echo X; }
  export -f foo
  git rebase --exec foo HEAD~10

Since upgrading to 2.13.0, I had to update my scripts to run:

  git rebase --exec "bash -c foo" HEAD~10

I'm not sure if this was an intended change. Bisecting with the
following script:

  #!/usr/bin/env bash

  make -j8 || exit 3

  function foo() {
          echo OK
  export -f foo

  pushd tmp
  ../git --exec-path=.. rebase --exec foo HEAD^^
  # Cleanup if failure
  ../git --exec-path=.. rebase --abort &> /dev/null
  exit $ret

It points to this commit:

commit 18633e1a22a68bbe8e6311a1039d13ebbf6fd041 (refs/bisect/bad)
Author: Johannes Schindelin <johannes.schindelin@xxxxxx>
Date:   Thu Feb 9 23:23:11 2017 +0100

    rebase -i: use the rebase--helper builtin

    Now that the sequencer learned to process a "normal" interactive rebase,
    we use it. The original shell script is still used for "non-normal"
    interactive rebases, i.e. when --root or --preserve-merges was passed.

    Please note that the --root option (via the $squash_onto variable) needs
    special handling only for the very first command, hence it is still okay
    to use the helper upon continue/skip.

    Also please note that the --no-ff setting is volatile, i.e. when the
    interactive rebase is interrupted at any stage, there is no record of
    it. Therefore, we have to pass it from the shell script to the

    Note: the test t3404 had to be adjusted because the the error messages
    produced by the sequencer comply with our current convention to start with
    a lower-case letter.

    Signed-off-by: Johannes Schindelin <johannes.schindelin@xxxxxx>
    Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx>