Re: [GSoC][PATCH v6 11/20] rebase -i: rewrite complete_action() in C
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 10, 2018, 19:25 UTC
- Message-ID
- <xmqq4lg281ms.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20180810165147.4779-12-alban.gruin@gmail.com>
Alban Gruin <alban.gruin@gmail.com> writes:
Show 14 quoted lines
> This rewrites complete_action() from shell to C. > > A new mode is added to rebase--helper (`--complete-action`), as well as > a new flag (`--autosquash`). > > Finally, complete_action() is stripped from git-rebase--interactive.sh. > > The original complete_action() would return the code 2 when the todo > list contained no actions. This was a special case for rebase -i and > -p; git-rebase.sh would then apply the autostash, delete the state > directory, and die with the message "Nothing to do". This cleanup is > rewritten in C instead of returning 2. As rebase -i no longer returns > 2, the comment describing this behaviour in git-rebase.sh is updated to > reflect this change.
Hmph. It is easy enough to do the clean-up ourselves in this code, instead of asking the caller to do so. On the other hand, stashing of local changes is done by the caller, so it feels a bit strange way to divide the labor between the two parts.
Other than that design choice, the patch itself looks reasonable and a fairly faithful reimplementation of what the scripted one did.