summaryrefslogtreecommitdiff
path: root/git-send-email.perl
Commit message (Collapse)AuthorAgeFilesLines
* send-email: futureproof split_addrs() subJunio C Hamano2008-12-211-1/+1
| | | | | | | | Matt Kraai points out that calling parse_line() assuming that the caller ever passes only one argument is a bug waiting to happen, and he is right. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'maint' to sync with GIT 1.6.0.6Junio C Hamano2008-12-191-3/+8
|\ | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * git-send-email: handle email address with quoted commaWu Fengguang2008-12-191-3/+8
| | | | | | | | | | | | | | | | | | | | | | Correctly handle email addresses containing quoted commas, e.g. "Zhu, Yi" <yi.zhu@intel.com>, "Li, Shaohua" <shaohua.li@intel.com> The commas inside the double quotes are not separators. Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | send-email: do not reverse the command line argumentsJunio C Hamano2008-11-301-1/+1
| | | | | | | | | | | | | | | | | | | | The loop picks elements from @ARGV one by one, sifts them into arguments meant for format-patch and the script itself, and pushes them to @files and @rev_list_opts arrays. Pick elements from @ARGV starting at the beginning using shift, instead of at the end using pop, as push appends them to the end of the array. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'ph/send-email'Junio C Hamano2008-11-271-74/+172
|\ \ | | | | | | | | | | | | | | | | | | | | | * ph/send-email: git send-email: ask less questions when --compose is used. git send-email: add --annotate option git send-email: interpret unknown files as revision lists git send-email: make the message file name more specific.
| * | git send-email: ask less questions when --compose is used.Pierre Habouzit2008-11-111-73/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When --compose is used, we can grab the From/Subject/In-Reply-To from the edited summary, let it be so and don't ask the user silly questions. The summary templates gets quite revamped, and includes the list of patches subjects that are going to be sent with this batch. When having a body full of empty lines, the summary isn't sent. Document that in the git-send-email manpage fully. Note: It doesn't deal with To/Cc/Bcc yet. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | git send-email: add --annotate optionPierre Habouzit2008-11-111-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows to review every patch (and fix various aspects of them, or comment them) in an editor just before being sent. Combined to the fact that git send-email can now process revision lists, this makes git send-email and efficient way to review and send patches interactively. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | git send-email: interpret unknown files as revision listsPierre Habouzit2008-11-111-5/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Filter out all the arguments git-send-email doesn't like to a git format-patch command, that dumps its content to a safe directory. Barf when a file/revision conflict occurs, allow it to be overriden --[no-]format-patch. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | git send-email: make the message file name more specific.Pierre Habouzit2008-11-111-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This helps editors choosing their syntax hilighting properly. Also make the file live under the git directory. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | send-email: Fix Pine address book parsingTrent Piepho2008-11-261-3/+6
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | See: http://www.washington.edu/pine/tech-notes/low-level.html Entries with a fcc or comment field after the address weren't parsed correctly. Continuation lines, identified by leading spaces, were also not handled. Distribution lists which had ( ) around a list of addresses did not have the parenthesis removed. Signed-off-by: Trent Piepho <tpiepho@freescale.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'maint'Junio C Hamano2008-11-021-2/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | * maint: Start 1.6.0.4 cycle add instructions on how to send patches to the mailing list with Gmail Documentation/gitattributes: Add subsection header for each attribute git send-email: avoid leaking directory file descriptors. send-pack: do not send out single-level refs such as refs/stash fix overlapping memcpy in normalize_absolute_path pack-objects: avoid reading uninitalized data correct cache_entry allocation Conflicts: RelNotes
| * git send-email: avoid leaking directory file descriptors.Pierre Habouzit2008-11-011-2/+1
| | | | | | | | | | Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | send-email: signedoffcc -> signedoffbycc, but handle bothMichael Witten2008-10-011-4/+5
| | | | | | | | | | | | | | | | | | | | | | The documentation now mentions sendemail.signedoffbycc instead of sendemail.signedoffcc in order to match with the options --signed-off-by-cc; the code has been updated to reflect this as well, but sendemail.signedoffcc is still handled. Signed-off-by: Michael Witten <mfwitten@mit.edu> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Docs: send-email: Create logical groupings for --help textMichael Witten2008-10-011-27/+34
| | | | | | | | | | | | | | | | The options are partitioned into more digestible groups. Signed-off-by: Michael Witten <mfwitten@mit.edu> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | send-email: change --no-validate to boolean --[no-]validateMichael Witten2008-10-011-4/+5
| | | | | | | | | | | | | | | | | | | | There is also now a configuration variable: sendemail[.<identity>].validate Signed-off-by: Michael Witten <mfwitten@mit.edu> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Docs: send-email usage text much sexierMichael Witten2008-10-011-68/+26
| | | | | | | | | | | | | | | | | | | | All of the descriptions are aligned, shorter, better arranged, and no line is greater than 78 columns. Signed-off-by: Michael Witten <mfwitten@mit.edu> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Docs: send-email's usage text and man page mention same optionsMichael Witten2008-10-011-4/+4
|/ | | | | | | | | | | | | | Specifically, boolean options are now listed in the form --[no-]option and both forms of documentation now consistently use --[no-]signed-off-by-cc Signed-off-by: Michael Witten <mfwitten@mit.edu> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Merge branch 'maint'Junio C Hamano2008-07-251-1/+1
|\ | | | | | | | | | | | | | | * maint: Makefile: fix shell quoting tests: propagate $(TAR) down from the toplevel Makefile index-pack.c: correctly initialize appended objects send-email: find body-encoding correctly
| * send-email: find body-encoding correctlyPeter Valdemar Mørch2008-07-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | In 8291db6 (git-send-email: add charset header if we add encoded 'From', 2007-11-16), "$1" is used from a regexp without using () to capture anything in $1. Later, when that value was used, it causes a warning about a variable being undefined, instead of using the correct value for comparison (not that it makes difference in the current code that does not do actual re-encoding). Signed-off-by: Peter Valdemar Mørch <peter@morch.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Make usage strings dash-lessStephan Beyer2008-07-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When you misuse a git command, you are shown the usage string. But this is currently shown in the dashed form. So if you just copy what you see, it will not work, when the dashed form is no longer supported. This patch makes git commands show the dash-less version. For shell scripts that do not specify OPTIONS_SPEC, git-sh-setup.sh generates a dash-less usage string now. Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-send-email: Fix authenticating on some servers when using TLS.Robert Shearman2008-07-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Send HELO again after a successful STARTTLS command to refresh the list of extensions. These may be different to what is returned over a clear connection (for example the AUTH command may be accepted over a secure connection, but not over a clear connection). Furthermore, this behaviour is recommended by RFC 2487 (http://www.ietf.org/rfc/rfc2487.txt). Signed-off-by: Robert Shearman <robertshearman@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-send-email: Do not attempt to STARTTLS more than onceThomas Rast2008-07-021-0/+1
| | | | | | | | | | | | | | | | | | With the previous TLS patch, send-email would attempt to STARTTLS at the beginning of every mail, despite reusing the last connection. We simply skip further encryption checks after successful TLS initiation. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'kb/send-email-fifo'Junio C Hamano2008-07-011-3/+5
|\ \ | | | | | | | | | | | | * kb/send-email-fifo: git-send-email: Accept fifos as well as files
| * | git-send-email: Accept fifos as well as filesKevin Ballard2008-06-251-3/+5
| |/ | | | | | | | | | | | | | | | | | | When a fifo is given, validation must be skipped because we can't read the fifo twice. Ideally git-send-email would cache the read data instead of attempting to read twice, but for now just skip validation. Signed-off-by: Kevin Ballard <kevin@sb.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-send-email: prevent undefined variable warnings if no encryption is setThomas Rast2008-06-281-0/+3
| | | | | | | | | | | | | | | | | | With the previous patch, not configuring any encryption (either on or off) would leave $smtp_encryption undefined. We simply set it to the empty string in that case. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-send-email: add support for TLS via Net::SMTP::SSLThomas Rast2008-06-251-5/+28
|/ | | | | | | | | We do this by handing over the Net::SMTP instance to Net::SMTP::SSL, which avoids Net::SMTP::TLS and its weird error checking. This trick is due to Brian Evins. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-send-email: allow whitespace in addressee listPieter de Bie2008-06-081-1/+1
| | | | | | | | | | | When interactively supplying addresses to send an email to with send-email, whitespace after the separation comma (as in 'list, jc') wasn't ignored. This meant that resolving of the alias ' jc' would fail, sending an email only to list. With this patch, the optional trailing whitespace is ignored. Signed-off-by: Pieter de Bie <pdebie@ai.rug.nl> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* send-email: Allow the envelope sender to be set via configurationAsk Bjørn Hansen2008-06-081-0/+1
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'jk/maint-send-email-compose'Junio C Hamano2008-05-211-2/+41
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jk/maint-send-email-compose: send-email: rfc2047-quote subject lines with non-ascii characters send-email: specify content-type of --compose body Conflicts: t/t9001-send-email.sh Due to 065096c (git-send-email.perl: Handle shell metacharacters in $EDITOR properly, 2008-05-04) which is a backward incompatible change (but it makes handling of EDITOR consistent with other parts of the system), the test script t9001 had to be adjusted. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * send-email: rfc2047-quote subject lines with non-ascii charactersJeff King2008-05-211-2/+17
| | | | | | | | | | | | | | | | | | | | | | We always use 'utf-8' as the encoding, since we currently have no way of getting the information from the user. This also refactors the quoting of recipient names, since both processes can share the rfc2047 quoting code. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * send-email: specify content-type of --compose bodyJeff King2008-05-211-0/+24
| | | | | | | | | | | | | | | | | | | | | | If the compose message contains non-ascii characters, then we assume it is in utf-8 and include the appropriate MIME headers. If the user has already included a MIME-Version header, then we assume they know what they are doing and don't add any headers. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'hb/maint-send-email-quote-recipients'Junio C Hamano2008-05-211-1/+1
|\ \ | | | | | | | | | | | | * hb/maint-send-email-quote-recipients: Fix recipient santitization
| * | Fix recipient santitizationHorst H. von Brand2008-05-211-1/+1
| |/ | | | | | | | | | | | | Need to quote all special characters, not just the first one Signed-off-by: Horst H. von Brand <vonbrand@inf.utfsm.cl> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'bd/tests'Junio C Hamano2008-05-141-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bd/tests: Rename the test trash directory to contain spaces. Fix tests breaking when checkout path contains shell metacharacters Don't use the 'export NAME=value' in the test scripts. lib-git-svn.sh: Fix quoting issues with paths containing shell metacharacters test-lib.sh: Fix some missing path quoting Use test_set_editor in t9001-send-email.sh test-lib.sh: Add a test_set_editor function to safely set $VISUAL git-send-email.perl: Handle shell metacharacters in $EDITOR properly config.c: Escape backslashes in section names properly git-rebase.sh: Fix --merge --abort failures when path contains whitespace Conflicts: t/t9115-git-svn-dcommit-funky-renames.sh
| * | git-send-email.perl: Handle shell metacharacters in $EDITOR properlyBryan Donlan2008-05-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the git-send-perl semantics for launching an editor when $GIT_EDITOR (or friends) contains shell metacharacters to match launch_editor() in builtin-tag.c. If we use the current approach (sh -c '$0 $@' "$EDITOR" files ...), we see it fails when $EDITOR has shell metacharacters: $ sh -x -c '$0 $@' "$VISUAL" "foo" + "$FAKE_EDITOR" foo "$FAKE_EDITOR": 1: "$FAKE_EDITOR": not found Whereas builtin-tag.c will invoke sh -c "$EDITOR \"$@\"". Thus, this patch changes git-send-email.perl to use the same method as the C utilities, and additionally updates t/t9001-send-email.sh to test for this bug. Signed-off-by: Bryan Donlan <bdonlan@fushizen.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | git-send-email: add a new sendemail.cc configuration variableMiklos Vajna2008-04-291-0/+1
|/ / | | | | | | | | | | | | | | 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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | send-email: Don't require to be called in a repositoryFrank Lichtenheld2008-03-151-9/+11
|/ | | | | | | | | We might not have some configuration variables available, but if the user doesn't care about that, neither should we. Still use the repository if it is available, though. Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* send-email: --no-signed-off-cc should suppress 'sob' ccJunio C Hamano2008-03-071-1/+2
| | | | | | | | | | | | | | | | The logic to countermand suppression of Cc to the signers with a more explicit --signed-off-by option done in 6564828 (git-send-email: Generalize auto-cc recipient mechanism) suffers from a double-negation error. A --signed-off-cc option, when false, should actively suppress CC: to be generated out of S-o-b lines, and it should refrain from suppressing when it is true. It also fixes "(sob) Adding cc:" status output; earlier it included the line terminator LF inside '%s', which was totally bogus. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* send-email: fix In-Reply-To regressionJay Soffian2008-02-211-3/+6
| | | | | | | | | | | | | | | | | Fix a regression introduced by 1ca3d6e (send-email: squelch warning due to comparing undefined $_ to "") where if the user was prompted for an initial In-Reply-To and didn't provide one, messages would be sent out with an invalid In-Reply-To of "<>" Also add test cases for the regression and the fix. A small modification was needed to allow send-email to take its replies from stdin if the environment variable GIT_SEND_EMAIL_NOTTY is set. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'maint'Junio C Hamano2008-02-201-1/+1
|\ | | | | | | | | | | | | | | * maint: Clarified the meaning of git-add -u in the documentation git-clone.sh: properly configure remote even if remote's head is dangling Documentation/git-stash: document options for git stash list send-email: squelch warning due to comparing undefined $_ to ""
| * send-email: squelch warning due to comparing undefined $_ to ""Jay Soffian2008-02-201-1/+1
| | | | | | | | | | | | | | | | | | | | The check to see if initial_reply_to is defined was also comparing $_ to "" for a reason I cannot ascertain (looking at the commit which made the change didn't provide enlightenment), but if $_ is undefined, perl generates a warning. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'mw/send-email'Junio C Hamano2008-02-111-22/+72
|\ \ | | | | | | | | | | | | | | | | | | * mw/send-email: git-send-email: Better handling of EOF git-send-email: SIG{TERM,INT} handlers git-send-email: ssh/login style password requests
| * | git-send-email: Better handling of EOFMichael Witten2008-02-051-16/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before, when the user sent the EOF control character, the prompts would be repeated on the same line as the previous prompt. Now, repeat prompts display on separate lines. Signed-off-by: Michael Witten <mfwitten@mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | git-send-email: SIG{TERM,INT} handlersMichael Witten2008-02-051-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A single signal handler is used for both SIGTERM and SIGINT in order to clean up after an uncouth termination of git-send-email. In particular, the handler resets the text color (this cleanup was already present), turns on tty echoing (in case termination occurrs during a masked Password prompt), and informs the user of of any temporary files created by --compose. Signed-off-by: Michael Witten <mfwitten@mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | git-send-email: ssh/login style password requestsMichael Witten2008-02-051-4/+21
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Whilst convenient, it is most unwise to record passwords in any place but one's brain. Moreover, it is especially foolish to store them in configuration files, even with access permissions set accordingly. git-send-email has been amended, so that if it detects an smtp username without a password, it promptly prompts for the password and masks the input for privacy. Furthermore, the argument to --smtp-pass has been rendered optional. The documentation has been updated to reflect these changes. Signed-off-by: Michael Witten <mfwitten@mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-send-email: Generalize auto-cc recipient mechanism.David Brown2008-02-051-7/+49
|/ | | | | | | | | | | | | | | | | | | | | | | | There are a few options to git-send-email to suppress the automatic generation of 'Cc' fields: --suppress-from, and --signed-off-cc. However, there are other times that git-send-email automatically includes Cc'd recipients. This is not desirable for all development environments. Add a new option --suppress-cc, which can be specified one or more times to list the categories of auto-cc fields that should be suppressed. If not specified, it defaults to values to give the same behavior as specified by --suppress-from, and --signed-off-cc. The categories are: self - patch sender. Same as --suppress-from. author - patch author. cc - cc lines mentioned in the patch. cccmd - avoid running the cccmd. sob - signed off by lines. all - all non-explicit recipients Signed-off-by: David Brown <git@davidb.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* send-email, fix breakage in combination with --composeGustaf Hendeby2008-01-211-1/+1
| | | | | | | | | | | This fixes the subtile bug in git send-email that was introduced into git send-email with aa54892f5ada8282643dc7387b33261c7135d784 (send-email: detect invocation errors earlier), which caused no patches to be sent out if the --compose flag was used. Signed-off-by: Gustaf Hendeby <hendeby@isy.liu.se> Tested-by: Seth Falcon <seth@userprimary.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* send-email: add no-validate optionJeff King2008-01-181-3/+9
| | | | | | | | | | Since we are now sanity-checking the contents of patches and refusing to send ones with long lines, this knob provides a way for the user to override the new behavior (if, e.g., he knows his SMTP path will handle it). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* send-email: validate patches before sending anythingJeff King2008-01-181-0/+17
| | | | | | | | | | | | | | We try to catch errors early so that we don't end up sending half of a broken patch series. Right now the only validation is checking that line-lengths are under the SMTP-mandated limit of 998. The validation parsing is very crude (it just checks each line length without understanding the mailbox format) but should work fine for this simple check. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* send-email: detect invocation errors earlierJeff King2008-01-181-28/+27
| | | | | | | | | | | | We never even look at the command line arguments until after we have prompted the user for some information. So running "git send-email" without arguments would prompt for "from" and "to" headers, only to then die with "No patch files specified." Instead, let's try to do as much error checking as possible before getting user input. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>