summaryrefslogtreecommitdiff
path: root/git-rebase--interactive.sh
diff options
context:
space:
mode:
authorAlban Gruin <alban.gruin@gmail.com>2018-08-28 14:10:38 +0200
committerJunio C Hamano <gitster@pobox.com>2018-08-29 13:38:18 -0700
commit6ab54d17be3f51153444d8efebb0ae363eb9b7c9 (patch)
treedda057be5cd6400e10c5e78b0e9063c469824dc0 /git-rebase--interactive.sh
parent91f0d95dcb4dd9c388881b64a7d79a3809927126 (diff)
downloadgit-6ab54d17be3f51153444d8efebb0ae363eb9b7c9.tar.gz
rebase -i: implement the logic to initialize $revisions in C
This rewrites the part of init_revisions_and_shortrevisions() needed by `--make-script` from shell to C. The new version is called get_revision_ranges(), and is a static function inside of rebase--helper.c. As this does not initialize $shortrevision, the original shell version is not yet stripped. Unlike init_revisions_and_shortrevisions(), get_revision_ranges() doesn’t write $squash_onto to the state directory, it’s done by the handler of `--make-script` instead. Finally, this drops the $revision argument passed to `--make-script` in git-rebase--interactive.sh, and rebase--helper is changed accordingly. Signed-off-by: Alban Gruin <alban.gruin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-rebase--interactive.sh')
-rw-r--r--git-rebase--interactive.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 0d66c0f8b8..4ca47aed1e 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -92,7 +92,9 @@ git_rebase__interactive () {
git rebase--helper --make-script ${keep_empty:+--keep-empty} \
${rebase_merges:+--rebase-merges} \
${rebase_cousins:+--rebase-cousins} \
- $revisions ${restrict_revision+^$restrict_revision} >"$todo" ||
+ ${upstream:+--upstream "$upstream"} ${onto:+--onto "$onto"} \
+ ${squash_onto:+--squash-onto "$squash_onto"} \
+ ${restrict_revision:+--restrict-revision ^"$restrict_revision"} >"$todo" ||
die "$(gettext "Could not generate todo list")"
exec git rebase--helper --complete-action "$shortrevisions" "$onto_name" \