834
return 1
835
}
836
837
-# __git_commands requires 1 argument:
838
-# 1: the command group, either "all" or "porcelain"
839
-__git_commands () {
840
- case "$1" in
841
- porcelain)
842
- if test -n "$GIT_TESTING_PORCELAIN_COMMAND_LIST"
843
- then
844
- printf "%s" "$GIT_TESTING_PORCELAIN_COMMAND_LIST"
845
- else
846
- git --list-cmds=list-mainporcelain,others,nohelpers,list-complete
847
- fi
848
- ;;
849
- all)
850
- if test -n "$GIT_TESTING_ALL_COMMAND_LIST"
851
- then
852
- printf "%s" "$GIT_TESTING_ALL_COMMAND_LIST"
853
- else
854
- git --list-cmds=main,others,nohelpers
855
- fi
856
- ;;
857
- esac
858
-}
859
-
860
-__git_list_all_commands ()
861
-{
862
- __git_commands all
863
-}
864
-
837
__git_all_commands=
838
__git_compute_all_commands ()
839
{
840
test -n "$__git_all_commands" ||
869
- __git_all_commands=$(__git_list_all_commands)
870
-}
871
-
872
-__git_list_porcelain_commands ()
873
-{
874
- __git_commands porcelain
875
-}
876
-
877
-__git_porcelain_commands=
878
-__git_compute_porcelain_commands ()
879
-{
880
- test -n "$__git_porcelain_commands" ||
881
- __git_porcelain_commands=$(__git_list_porcelain_commands)
841
+ __git_all_commands=$(git --list-cmds=main,others,alias,nohelpers)
842
}
843
844
# Lists all set config variables starting with the given section prefix,
856
__git_get_config_variables "pretty"
857
}
858
899
-__git_aliases ()
900
-{
901
- __git_get_config_variables "alias"
902
-}
903
-
859
# __git_aliased_command requires 1 argument
860
__git_aliased_command ()
861
{
1455
__git_complete_refs
1456
}
1457
1503
-__git_all_guides=
1504
-__git_compute_all_guides ()
1505
-{
1506
- test -n "$__git_all_guides" ||
1507
- __git_all_guides=$(git --list-cmds=list-guide)
1508
-}
1509
-
1458
_git_help ()
1459
{
1460
case "$cur" in
1463
return
1464
;;
1465
esac
1518
- __git_compute_all_commands
1519
- __git_compute_all_guides
1520
- __gitcomp "$__git_all_commands $(__git_aliases) $__git_all_guides
1521
- gitk
1522
- "
1466
+ if test -n "$GIT_TESTING_ALL_COMMAND_LIST"
1467
+ then
1468
+ __gitcomp "$GIT_TESTING_ALL_COMMAND_LIST $(git --list-cmds=alias,list-guide) gitk"
1469
+ else
1470
+ __gitcomp "$(git --list-cmds=main,nohelpers,alias,list-guide) gitk"
1471
+ fi
1472
}
1473
1474
_git_init ()
3007
--help
3008
"
3009
;;
3061
- *) __git_compute_porcelain_commands
3062
- __gitcomp "$__git_porcelain_commands $(__git_aliases)" ;;
3010
+ *)
3011
+ if test -n "$GIT_TESTING_PORCELAIN_COMMAND_LIST"
3012
+ then
3013
+ __gitcomp "$GIT_TESTING_PORCELAIN_COMMAND_LIST"
3014
+ else
3015
+ __gitcomp "$(git --list-cmds=list-mainporcelain,others,nohelpers,alias,list-complete)"
3016
+ fi
3017
+ ;;
3018
esac
3019
return
3020
fi