[PATCH v5 10/10] add--interactive.perl: use add--helper --show-help for help_cmd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Slavica Djukic <slawica92@xxxxxxxxxxx>

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@xxxxxx>
Signed-off-by: Slavica Djukic <slawica92@xxxxxxxxxxx>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx>
---
 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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux