]> git.ipfire.org Git - thirdparty/git.git/commit - sequencer.c
sequencer: use read_author_script()
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Wed, 31 Oct 2018 10:15:56 +0000 (10:15 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 1 Nov 2018 03:08:06 +0000 (12:08 +0900)
commit4d010a757c40d6e6e478354991bd052ef30cb853
tree474b5f55bdcf47203a50ea4abad396353a15a1d7
parentbcd33ec25f28514776f3b17af6a5a80b1f329f81
sequencer: use read_author_script()

Use the new function added in the last commit to read the author
script, updating read_env_script() and read_author_ident(). We now
have a single code path that reads the author script for am and all
flavors of rebase. This changes the behavior of read_env_script() as
previously it would set any environment variables that were in the
author-script file. Now it is an error if the file contains other
variables or any of GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL and
GIT_AUTHOR_DATE are missing. This is what am and the non interactive
version of rebase have been doing for several years so hopefully it
will not cause a problem for interactive rebase users. The advantage
is that we are reusing existing code from am which uses sq_dequote()
to properly dequote variables. This fixes potential problems with user
edited scripts as read_env_script() which did not track quotes
properly.

This commit also removes the fallback code for checking for a broken
author script after git is upgraded when a rebase is stopped. Now that
the parsing uses sq_dequote() it will reliably return an error if the
quoting is broken and the user will have to abort the rebase and
restart. This isn't ideal but it's a corner case and the detection of
the broken quoting could be confused by user edited author scripts.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c