File tree Expand file tree Collapse file tree 3 files changed +20
-17
lines changed Expand file tree Collapse file tree 3 files changed +20
-17
lines changed Original file line number Diff line number Diff line change @@ -169,7 +169,8 @@ foo.bar= ...`) sets `foo.bar` to the empty string which `git config
169
169
groups are: builtins, parseopt (builtin commands that use
170
170
parse-options), main (all commands in libexec directory),
171
171
others (all other commands in `$PATH` that have git- prefix),
172
- list-<category> (see categories in command-list.txt)
172
+ list-<category> (see categories in command-list.txt),
173
+ nohelpers (exclude helper commands).
173
174
174
175
GIT COMMANDS
175
176
------------
Original file line number Diff line number Diff line change @@ -843,35 +843,23 @@ __git_commands () {
843
843
then
844
844
printf " %s" " $GIT_TESTING_PORCELAIN_COMMAND_LIST "
845
845
else
846
- git --list-cmds=list-mainporcelain,others,list-complete
846
+ git --list-cmds=list-mainporcelain,others,nohelpers, list-complete
847
847
fi
848
848
;;
849
849
all)
850
850
if test -n " $GIT_TESTING_ALL_COMMAND_LIST "
851
851
then
852
852
printf " %s" " $GIT_TESTING_ALL_COMMAND_LIST "
853
853
else
854
- git --list-cmds=main,others
854
+ git --list-cmds=main,others,nohelpers
855
855
fi
856
856
;;
857
857
esac
858
858
}
859
859
860
- __git_list_commands ()
861
- {
862
- local i IFS=" " $' \n '
863
- for i in $( __git_commands $1 )
864
- do
865
- case $i in
866
- * --* ) : helper pattern;;
867
- * ) echo $i ;;
868
- esac
869
- done
870
- }
871
-
872
860
__git_list_all_commands ()
873
861
{
874
- __git_list_commands all
862
+ __git_commands all
875
863
}
876
864
877
865
__git_all_commands=
@@ -883,7 +871,7 @@ __git_compute_all_commands ()
883
871
884
872
__git_list_porcelain_commands ()
885
873
{
886
- __git_list_commands porcelain
874
+ __git_commands porcelain
887
875
}
888
876
889
877
__git_porcelain_commands=
Original file line number Diff line number Diff line change @@ -39,6 +39,18 @@ static int use_pager = -1;
39
39
40
40
static void list_builtins (struct string_list * list , unsigned int exclude_option );
41
41
42
+ static void exclude_helpers_from_list (struct string_list * list )
43
+ {
44
+ int i = 0 ;
45
+
46
+ while (i < list -> nr ) {
47
+ if (strstr (list -> items [i ].string , "--" ))
48
+ unsorted_string_list_delete_item (list , i , 0 );
49
+ else
50
+ i ++ ;
51
+ }
52
+ }
53
+
42
54
static int match_token (const char * spec , int len , const char * token )
43
55
{
44
56
int token_len = strlen (token );
@@ -61,6 +73,8 @@ static int list_cmds(const char *spec)
61
73
list_all_main_cmds (& list );
62
74
else if (match_token (spec , len , "others" ))
63
75
list_all_other_cmds (& list );
76
+ else if (match_token (spec , len , "nohelpers" ))
77
+ exclude_helpers_from_list (& list );
64
78
else if (len > 5 && !strncmp (spec , "list-" , 5 )) {
65
79
struct strbuf sb = STRBUF_INIT ;
66
80
You can’t perform that action at this time.
0 commit comments