diff options
author | Brandon Casey <drafnel@gmail.com> | 2010-08-13 15:47:34 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-08-13 14:19:12 -0700 |
commit | 2d6ca6ef55226185b6a093f7fac27f5fecd51fe6 (patch) | |
tree | 444e97b13471f14e7a4a5d690f5edfedc8700771 /git-sh-setup.sh | |
parent | test-lib: user-friendly alternatives to test [-d|-f|-e] (diff) | |
download | tgif-2d6ca6ef55226185b6a093f7fac27f5fecd51fe6.tar.xz |
git-rebase--interactive.sh: rework skip_unnecessary_picks
Commit cd035b1c introduced the exec command to interactive rebase. In
doing so, it modified the way that skip_unnecessary_picks iterates through
the list of rebase commands so that it avoided collapsing multiple spaces
into a single space. This is necessary for example if the argument to the
exec command contains a path with multiple spaces in it.
The way it did this was by reading each line of rebase commands into a
single variable, and then breaking the individual components out using
echo, sed, and cut. It used the individual broken-out components for
decision making, and was still able to write the original line to the
output file from the variable it had saved it in. But, since we only
really need to look at anything other than the first element of the line
when a 'pick' command is encountered, and even that is only necessary when
we are still searching for "unnecessary" picks, and since newer rebase
commands like 'exec' may not even require a sha1 field, let's make our read
statement parse its input into a "command" variable, and a "rest" variable,
and then only break out the sha1 from $rest, and call git-rev-parse, when
absolutely necessary.
I think this future proofs this subroutine, avoids calling git-rev-parse
unnecessarily, and possibly with bogus arguments, and still accomplishes
the goal of not mangling the $rest of the rebase command.
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-sh-setup.sh')
0 files changed, 0 insertions, 0 deletions