Git development
 help / color / mirror / Atom feed
* [PATCH] git-format-patch: add a new format.cc configuration variable
@ 2008-04-26 21:19 Miklos Vajna
  2008-04-26 22:31 ` Johannes Schindelin
  0 siblings, 1 reply; 17+ messages in thread
From: Miklos Vajna @ 2008-04-26 21:19 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Some projects prefer to always CC patches to a given mailing list. In
these cases, it's handy to configure that address once.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
---
 Documentation/git-format-patch.txt |    1 +
 builtin-log.c                      |    7 +++++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt
index b5207b7..b2bdcb2 100644
--- a/Documentation/git-format-patch.txt
+++ b/Documentation/git-format-patch.txt
@@ -168,6 +168,7 @@ and file suffix, and number patches when outputting more than one.
         subjectprefix = CHANGE
         suffix = .txt
         numbered = auto
+        cc = <email>
 ------------
 
 
diff --git a/builtin-log.c b/builtin-log.c
index 1670d0b..d7907c9 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -485,6 +485,13 @@ static int git_format_config(const char *var, const char *value)
 		fmt_patch_suffix = xstrdup(value);
 		return 0;
 	}
+	if (!strcmp(var, "format.cc")) {
+		if (!value)
+			return config_error_nonbool(var);
+		ALLOC_GROW(extra_cc, extra_cc_nr + 1, extra_cc_alloc);
+		extra_cc[extra_cc_nr++] = xstrdup(value);
+		return 0;
+	}
 	if (!strcmp(var, "diff.color") || !strcmp(var, "color.diff")) {
 		return 0;
 	}
-- 
1.5.5.1.91.g499fc.dirty

^ permalink raw reply related	[flat|nested] 17+ messages in thread
* [PATCH] bash: Add long option completion for 'git send-email'
@ 2008-07-14  8:21 Teemu Likonen
  2008-07-15  4:38 ` Shawn O. Pearce
  0 siblings, 1 reply; 17+ messages in thread
From: Teemu Likonen @ 2008-07-14  8:21 UTC (permalink / raw)
  To: git; +Cc: spearce, gitster

Add the following long options to be completed with 'git send-email':

    --bcc --cc --cc-cmd --chain-reply-to --compose --dry-run
    --envelope-sender --from --identity --in-reply-to
    --no-chain-reply-to --no-signed-off-by-cc --no-suppress-from
    --no-thread --quiet --signed-off-by-cc --smtp-pass --smtp-server
    --smtp-server-port --smtp-ssl --smtp-user --subject --suppress-cc
    --suppress-from --thread --to

Short ones like --to and --cc are not usable for actual completion
because of the shortness itself and because there are longer ones which
start with same letters (--thread, --compose). It's still useful to have
these shorter options _listed_ when user presses TAB key after typing
two dashes. It gives user an idea what options are available (and --to
and --cc are probably the most commonly used).

Signed-off-by: Teemu Likonen <tlikonen@iki.fi>
---
 contrib/completion/git-completion.bash |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index d268e6f..b15f3a9 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -905,6 +905,24 @@ _git_rebase ()
 	__gitcomp "$(__git_refs)"
 }
 
+_git_send_email ()
+{
+	local cur="${COMP_WORDS[COMP_CWORD]}"
+	case "$cur" in
+	--*)
+		__gitcomp "--bcc --cc --cc-cmd --chain-reply-to --compose
+			--dry-run --envelope-sender --from --identity
+			--in-reply-to --no-chain-reply-to --no-signed-off-by-cc
+			--no-suppress-from --no-thread --quiet
+			--signed-off-by-cc --smtp-pass --smtp-server
+			--smtp-server-port --smtp-ssl --smtp-user --subject
+			--suppress-cc --suppress-from --thread --to"
+		return
+		;;
+	esac
+	__git_complete_file
+}
+
 _git_config ()
 {
 	local cur="${COMP_WORDS[COMP_CWORD]}"
@@ -1376,6 +1394,7 @@ _git ()
 	rebase)      _git_rebase ;;
 	remote)      _git_remote ;;
 	reset)       _git_reset ;;
+	send-email)  _git_send_email ;;
 	shortlog)    _git_shortlog ;;
 	show)        _git_show ;;
 	show-branch) _git_log ;;
@@ -1435,6 +1454,7 @@ complete -o default -o nospace -F _git_rebase git-rebase
 complete -o default -o nospace -F _git_config git-config
 complete -o default -o nospace -F _git_remote git-remote
 complete -o default -o nospace -F _git_reset git-reset
+complete -o default -o nospace -F _git_send_email git-send-email
 complete -o default -o nospace -F _git_shortlog git-shortlog
 complete -o default -o nospace -F _git_show git-show
 complete -o default -o nospace -F _git_stash git-stash
-- 
1.5.6.3.316.g01fc

^ permalink raw reply related	[flat|nested] 17+ messages in thread
* [PATCH] bash: Add long option completion for 'git send-email'
@ 2008-03-25 19:15 Teemu Likonen
  0 siblings, 0 replies; 17+ messages in thread
From: Teemu Likonen @ 2008-03-25 19:15 UTC (permalink / raw)
  To: git; +Cc: gitster, spearce, Teemu Likonen

Add the following long options to be completed with 'git send-email':

--bcc --cc --cc-cmd --chain-reply-to --compose --dry-run
--envelope-sender --from --identity --in-reply-to --no-chain-reply-to
--no-signed-off-by-cc --no-suppress-from --no-thread --quiet
--signed-off-by-cc --smtp-pass --smtp-server --smtp-server-port
--smtp-ssl --smtp-user --subject --suppress-cc --suppress-from
--thread --to

Signed-off-by: Teemu Likonen <tlikonen@iki.fi>
---

The shorter options like '--to' and '--cc' are not useful for actual
completion because there are longer options which start with same
letters (--thread, --cc-cmd). It's still useful to have these shorter
ones shown when user presses TAB key after typing two dashes (--).


 contrib/completion/git-completion.bash |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 5046f69..38a5cdc 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -871,6 +871,24 @@ _git_rebase ()
 	__gitcomp "$(__git_refs)"
 }
 
+_git_send_email ()
+{
+	local cur="${COMP_WORDS[COMP_CWORD]}"
+	case "$cur" in
+	--*)
+		__gitcomp "--bcc --cc --cc-cmd --chain-reply-to --compose
+			--dry-run --envelope-sender --from --identity
+			--in-reply-to --no-chain-reply-to --no-signed-off-by-cc
+			--no-suppress-from --no-thread --quiet
+			--signed-off-by-cc --smtp-pass --smtp-server
+			--smtp-server-port --smtp-ssl --smtp-user --subject
+			--suppress-cc --suppress-from --thread --to"
+		return
+		;;
+	esac
+	__git_complete_file
+}
+
 _git_config ()
 {
 	local cur="${COMP_WORDS[COMP_CWORD]}"
@@ -1325,6 +1343,7 @@ _git ()
 	rebase)      _git_rebase ;;
 	remote)      _git_remote ;;
 	reset)       _git_reset ;;
+	send-email)  _git_send_email ;;
 	shortlog)    _git_shortlog ;;
 	show)        _git_show ;;
 	show-branch) _git_log ;;
@@ -1377,6 +1396,7 @@ complete -o default -o nospace -F _git_rebase git-rebase
 complete -o default -o nospace -F _git_config git-config
 complete -o default -o nospace -F _git_remote git-remote
 complete -o default -o nospace -F _git_reset git-reset
+complete -o default -o nospace -F _git_send_email git-send-email
 complete -o default -o nospace -F _git_shortlog git-shortlog
 complete -o default -o nospace -F _git_show git-show
 complete -o default -o nospace -F _git_stash git-stash
-- 
1.5.5.rc1.6.g5cc8f

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2008-07-15  4:59 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-26 21:19 [PATCH] git-format-patch: add a new format.cc configuration variable Miklos Vajna
2008-04-26 22:31 ` Johannes Schindelin
2008-04-26 23:27   ` Miklos Vajna
2008-04-27 11:53     ` Johannes Schindelin
2008-04-27 12:14       ` [PATCH] git-send-email: add a new sendemail.cc " Miklos Vajna
2008-04-27 20:26         ` Junio C Hamano
2008-04-27 22:42           ` Miklos Vajna
2008-04-27 23:51             ` Jeff King
2008-04-29 10:56           ` [PATCH] Add tests for " Miklos Vajna
2008-04-29 17:21       ` [PATCH] git-format-patch: add a new format.cc " Jay Soffian
2008-04-27  0:14   ` Junio C Hamano
2008-04-27  5:09     ` [PATCH] bash: Add long option completion for 'git send-email' Teemu Likonen
  -- strict thread matches above, loose matches on Subject: below --
2008-07-14  8:21 Teemu Likonen
2008-07-15  4:38 ` Shawn O. Pearce
2008-07-15  4:49   ` Junio C Hamano
2008-07-15  4:58     ` Shawn O. Pearce
2008-03-25 19:15 Teemu Likonen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox