Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-11-13 16:37:28 +0300
committerJunio C Hamano <gitster@pobox.com>2018-11-13 16:37:28 +0300
commit95182c65d844e799e80a8f8997e357cdf8a3c7a6 (patch)
tree1049911c1f6bc8a8af9523b7745e3926d6ca1fa8
parent1e4a714e689e14726982941d8e61db06c6c7d58d (diff)
parent13374987dd889858758afef458bd8a8cbf15bb4d (diff)
Merge branch 'nd/complete-format-patch'
The support for format-patch (and send-email) by the command-line completion script (in contrib/) has been simplified a bit. * nd/complete-format-patch: completion: use __gitcomp_builtin for format-patch
-rw-r--r--contrib/completion/git-completion.bash16
-rwxr-xr-xgit-send-email.perl8
2 files changed, 14 insertions, 10 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index e9647a103a..9e8ec95c3c 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1521,13 +1521,9 @@ _git_fetch ()
__git_complete_remote_or_refspec
}
-__git_format_patch_options="
- --stdout --attach --no-attach --thread --thread= --no-thread
- --numbered --start-number --numbered-files --keep-subject --signoff
- --signature --no-signature --in-reply-to= --cc= --full-index --binary
- --not --all --cover-letter --no-prefix --src-prefix= --dst-prefix=
- --inline --suffix= --ignore-if-in-upstream --subject-prefix=
- --output-directory --reroll-count --to= --quiet --notes
+__git_format_patch_extra_options="
+ --full-index --not --all --no-prefix --src-prefix=
+ --dst-prefix= --notes
"
_git_format_patch ()
@@ -1540,7 +1536,7 @@ _git_format_patch ()
return
;;
--*)
- __gitcomp "$__git_format_patch_options"
+ __gitcomp_builtin format-patch "$__git_format_patch_extra_options"
return
;;
esac
@@ -2070,7 +2066,7 @@ _git_send_email ()
return
;;
--*)
- __gitcomp "--annotate --bcc --cc --cc-cmd --chain-reply-to
+ __gitcomp_builtin send-email "--annotate --bcc --cc --cc-cmd --chain-reply-to
--compose --confirm= --dry-run --envelope-sender
--from --identity
--in-reply-to --no-chain-reply-to --no-signed-off-by-cc
@@ -2079,7 +2075,7 @@ _git_send_email ()
--smtp-server-port --smtp-encryption= --smtp-user
--subject --suppress-cc= --suppress-from --thread --to
--validate --no-validate
- $__git_format_patch_options"
+ $__git_format_patch_extra_options"
return
;;
esac
diff --git a/git-send-email.perl b/git-send-email.perl
index 4b9d3ad1bd..8eb63b5a2f 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -122,6 +122,11 @@ EOT
exit(1);
}
+sub completion_helper {
+ print Git::command('format-patch', '--git-completion-helper');
+ exit(0);
+}
+
# most mail servers generate the Date: header, but not all...
sub format_2822_time {
my ($time) = @_;
@@ -314,6 +319,7 @@ $SIG{INT} = \&signal_handler;
# needing, first, from the command line:
my $help;
+my $git_completion_helper;
my $rc = GetOptions("h" => \$help,
"dump-aliases" => \$dump_aliases);
usage() unless $rc;
@@ -377,9 +383,11 @@ $rc = GetOptions(
"no-xmailer" => sub {$use_xmailer = 0},
"batch-size=i" => \$batch_size,
"relogin-delay=i" => \$relogin_delay,
+ "git-completion-helper" => \$git_completion_helper,
);
usage() if $help;
+completion_helper() if $git_completion_helper;
unless ($rc) {
usage();
}