@@ -756,6 +756,19 @@ __git_compute_porcelain_commands ()
756
756
: ${__git_porcelain_commands:= $(__git_list_porcelain_commands)}
757
757
}
758
758
759
+ __git_pretty_aliases ()
760
+ {
761
+ local i IFS=$' \n '
762
+ for i in $( git --git-dir=" $( __gitdir) " config --get-regexp " pretty\..*" 2> /dev/null) ; do
763
+ case " $i " in
764
+ pretty.* )
765
+ i=" ${i# pretty.} "
766
+ echo " ${i/ */ } "
767
+ ;;
768
+ esac
769
+ done
770
+ }
771
+
759
772
__git_aliases ()
760
773
{
761
774
local i IFS=$' \n '
@@ -913,12 +926,16 @@ _git_bisect ()
913
926
local subcommands=" start bad good skip reset visualize replay log run"
914
927
local subcommand=" $( __git_find_on_cmdline " $subcommands " ) "
915
928
if [ -z " $subcommand " ]; then
916
- __gitcomp " $subcommands "
929
+ if [ -f " $( __gitdir) " /BISECT_START ]; then
930
+ __gitcomp " $subcommands "
931
+ else
932
+ __gitcomp " replay start"
933
+ fi
917
934
return
918
935
fi
919
936
920
937
case " $subcommand " in
921
- bad|good|reset|skip)
938
+ bad|good|reset|skip|start )
922
939
__gitcomp " $( __git_refs) "
923
940
;;
924
941
* )
@@ -1374,12 +1391,12 @@ _git_log ()
1374
1391
fi
1375
1392
case " $cur " in
1376
1393
--pretty=* )
1377
- __gitcomp " $__git_log_pretty_formats
1394
+ __gitcomp " $__git_log_pretty_formats $( __git_pretty_aliases )
1378
1395
" " " " ${cur## --pretty=} "
1379
1396
return
1380
1397
;;
1381
1398
--format=* )
1382
- __gitcomp " $__git_log_pretty_formats
1399
+ __gitcomp " $__git_log_pretty_formats $( __git_pretty_aliases )
1383
1400
" " " " ${cur## --format=} "
1384
1401
return
1385
1402
;;
@@ -1474,18 +1491,50 @@ _git_name_rev ()
1474
1491
1475
1492
_git_notes ()
1476
1493
{
1477
- local subcommands=" edit show"
1478
- if [ -z " $( __git_find_on_cmdline " $subcommands " ) " ]; then
1479
- __gitcomp " $subcommands "
1480
- return
1481
- fi
1494
+ local subcommands=' add append copy edit list prune remove show'
1495
+ local subcommand=" $( __git_find_on_cmdline " $subcommands " ) "
1496
+ local cur=" ${COMP_WORDS[COMP_CWORD]} "
1482
1497
1483
- case " ${COMP_WORDS[COMP_CWORD-1]} " in
1484
- -m|-F)
1485
- COMPREPLY=()
1498
+ case " $subcommand ,$cur " in
1499
+ ,--* )
1500
+ __gitcomp ' --ref'
1501
+ ;;
1502
+ ,* )
1503
+ case " ${COMP_WORDS[COMP_CWORD-1]} " in
1504
+ --ref)
1505
+ __gitcomp " $( __git_refs) "
1506
+ ;;
1507
+ * )
1508
+ __gitcomp " $subcommands --ref"
1509
+ ;;
1510
+ esac
1511
+ ;;
1512
+ add,--reuse-message=* |append,--reuse-message=* )
1513
+ __gitcomp " $( __git_refs) " " " " ${cur## --reuse-message=} "
1514
+ ;;
1515
+ add,--reedit-message=* |append,--reedit-message=* )
1516
+ __gitcomp " $( __git_refs) " " " " ${cur## --reedit-message=} "
1517
+ ;;
1518
+ add,--* |append,--* )
1519
+ __gitcomp ' --file= --message= --reedit-message=
1520
+ --reuse-message='
1521
+ ;;
1522
+ copy,--* )
1523
+ __gitcomp ' --stdin'
1524
+ ;;
1525
+ prune,--* )
1526
+ __gitcomp ' --dry-run --verbose'
1527
+ ;;
1528
+ prune,* )
1486
1529
;;
1487
1530
* )
1488
- __gitcomp " $( __git_refs) "
1531
+ case " ${COMP_WORDS[COMP_CWORD-1]} " in
1532
+ -m|-F)
1533
+ ;;
1534
+ * )
1535
+ __gitcomp " $( __git_refs) "
1536
+ ;;
1537
+ esac
1489
1538
;;
1490
1539
esac
1491
1540
}
@@ -2106,12 +2155,12 @@ _git_show ()
2106
2155
local cur=" ${COMP_WORDS[COMP_CWORD]} "
2107
2156
case " $cur " in
2108
2157
--pretty=* )
2109
- __gitcomp " $__git_log_pretty_formats
2158
+ __gitcomp " $__git_log_pretty_formats $( __git_pretty_aliases )
2110
2159
" " " " ${cur## --pretty=} "
2111
2160
return
2112
2161
;;
2113
2162
--format=* )
2114
- __gitcomp " $__git_log_pretty_formats
2163
+ __gitcomp " $__git_log_pretty_formats $( __git_pretty_aliases )
2115
2164
" " " " ${cur## --format=} "
2116
2165
return
2117
2166
;;
0 commit comments