author | Junio C Hamano <gitster@pobox.com> | |
Tue, 21 Dec 2010 01:00:36 +0000 (17:00 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 21 Dec 2010 01:45:51 +0000 (17:45 -0800) | ||
commit | 4c28e4ada03f5440251545cf91e0d81bce9b010d | |
tree | f915e6291e3a94d8c67fbbe190b7f5dcb193e84e | tree | snapshot |
parent | 4579bb418c2995a8459de7dba42b63a26006f9a6 | commit | diff |
commit: die before asking to edit the log message
When determine_author_info() returns to the calling prepare_to_commit(),
we already know the pieces of information necessary to determine what
author ident will be used in the final message, but deferred making a call
to fmt_ident() before the final commit_tree(). Most importantly, we would
open the editor to ask the user to compose the log message before it.
As one important side effect of fmt_ident() is to error out when the given
information is malformed, this resulted in us spawning the editor first
and then refusing to commit due to error, even though we had enough
information to detect the error before starting the editor, which was
annoying.
Move the fmt_ident() call to the end of determine_author_info() where we
have final determination of author info to rectify this.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
When determine_author_info() returns to the calling prepare_to_commit(),
we already know the pieces of information necessary to determine what
author ident will be used in the final message, but deferred making a call
to fmt_ident() before the final commit_tree(). Most importantly, we would
open the editor to ask the user to compose the log message before it.
As one important side effect of fmt_ident() is to error out when the given
information is malformed, this resulted in us spawning the editor first
and then refusing to commit due to error, even though we had enough
information to detect the error before starting the editor, which was
annoying.
Move the fmt_ident() call to the end of determine_author_info() where we
have final determination of author info to rectify this.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/commit.c | diff | blob | history |