From 6ab54d17be3f51153444d8efebb0ae363eb9b7c9 Mon Sep 17 00:00:00 2001 From: Alban Gruin Date: Tue, 28 Aug 2018 14:10:38 +0200 Subject: rebase -i: implement the logic to initialize $revisions in C MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- git-rebase--interactive.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'git-rebase--interactive.sh') 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" \ -- cgit v1.3