[PATCH v5 10/10] add--interactive.perl: use add--helper --show-help for help_cmd
- From
- Slavica Djukic via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Feb 20, 2019, 11:41 UTC
- Message-ID
- <2b4bdce7300f3b6ba70f00a9eb524f5fa1ceff8f.1550662887.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.103.v5.git.gitgitgadget@gmail.com>
From: Slavica Djukic <slawica92@hotmail.com>
Change help_cmd sub in git-add--interactive.perl to use show-help command from builtin add--helper.
If an error occurs, it will be reported, but the Perl script will not exit, since the add--helper is called within an eval block.
Just like the change where the Perl script calls the add--helper to print the numstat, also here we forgo adding a regression test: the Perl script is on its way out (and this patch is part of that journey).
Mentored-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Slavica Djukic <slawica92@hotmail.com> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> --- git-add--interactive.perl | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/git-add--interactive.perl b/git-add--interactive.perl index c2c6b4d5e3..88b7be6602 100755 --- a/git-add--interactive.perl +++ b/git-add--interactive.perl @@ -1718,16 +1718,8 @@ sub quit_cmd { } sub help_cmd { -# TRANSLATORS: please do not translate the command names -# 'status', 'update', 'revert', etc. - print colored $help_color, __ <<'EOF' ; -status - show paths with changes -update - add working tree state to the staged set of changes -revert - revert staged set of changes back to the HEAD version -patch - pick hunks and update selectively -diff - view diff between HEAD and index -add untracked - add contents of untracked files to the staged set of changes -EOF + my @help_cmd = ("git", "add--helper", "--show-help"); + !system(@help_cmd) or die "@help_cmd exited with code $?"; } sub process_args {
-- gitgitgadget