aboutsummaryrefslogtreecommitdiff
path: root/git-send-email.perl
Commit message (Collapse)AuthorAge
* Git.pm: config_boolean() -> config_bool()Petr Baudis2007-05-10
| | | | | | | | | This patch renames config_boolean() to config_bool() for consistency with the commandline interface and because it is shorter but still obvious. ;-) It also changes the return value from some obscure string to real Perl boolean, allowing for clean user code. Signed-off-by: Petr Baudis <pasky@suse.cz>
* Merge branch 'maint'Junio C Hamano2007-04-25
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * maint: Start preparing for 1.5.1.3 Sanitize @to recipients. git-svn: Ignore usernames in URLs in find_by_url Document --dry-run and envelope-sender for git-send-email. Allow users to optionally specify their envelope sender. Ensure clean addresses are always used with Net::SMTP Validate @recipients before using it for sendmail and Net::SMTP. Perform correct quoting of recipient names. Change the scope of the $cc variable as it is not needed outside of send_message. Debugging cleanup improvements Prefix Dry- to the message status to denote dry-runs. Document --dry-run parameter to send-email. git-svn: Don't rely on $_ after making a function call Fix handle leak in write_tree Actually handle some-low memory conditions Conflicts: RelNotes git-send-email.perl
| * Sanitize @to recipients.Robin H. Johnson2007-04-25
| | | | | | | | | | | | | | We need to sanitize @to as well to ensure that names are properly quoted. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * Allow users to optionally specify their envelope sender.Robin H. Johnson2007-04-25
| | | | | | | | | | | | | | | | | | | | | | | | | | If your normal user is not the same user you are subscribed to a list with, then the default envelope sender used will cause your messages to bounce or silently vanish into the ether. This patch provides an optional parameter to set the envelope sender. To use it with the sendmail binary, you must have privileges to use the -f parameter! Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * Ensure clean addresses are always used with Net::SMTPRobin H. Johnson2007-04-25
| | | | | | | | | | | | | | | | Always pass in clean addresses to Net::SMTP for the MAIL FROM, and use them on the SMTP non-quiet output as well. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * Validate @recipients before using it for sendmail and Net::SMTP.Robin H. Johnson2007-04-25
| | | | | | | | | | | | | | | | | | Ensure that @recipients is only raw addresses when it is handed to the sendmail binary OR Net::SMTP, otherwise BCC cases might get an extra <, or wierd stuff might be passed to the exec. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * Perform correct quoting of recipient names.Robin H. Johnson2007-04-25
| | | | | | | | | | | | | | | | | | Always perform quoting of the recipient names if they contain periods, previously only the author's address was treated this way. This stops sendmail binaries from exploding the name into bad addresses. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * Change the scope of the $cc variable as it is not needed outside of ↵Robin H. Johnson2007-04-25
| | | | | | | | | | | | | | | | | | send_message. $cc is only used inside the send_message scope, so lets clean it out of the global scope. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * Debugging cleanup improvementsRobin H. Johnson2007-04-25
| | | | | | | | | | | | | | | | | | The debug output is much more helpful if it has the parameters that were used. Pull the sendmail parameters into a seperate array for that, and also include similar data during the Net::SMTP case. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * Prefix Dry- to the message status to denote dry-runs.Robin H. Johnson2007-04-25
| | | | | | | | | | | | | | | | While doing testing, it's useful to see that a dry run was actually done, instead of a real one. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * Document --dry-run parameter to send-email.Robin H. Johnson2007-04-25
| | | | | | | | | | | | | | Looks like --dry-run was added to the code, but never to the --help output. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | send-email: do not leave an empty CC: line if no cc is present.Junio C Hamano2007-04-16
|/ | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* Avoid composing too long "References" header.YOSHIFUJI Hideaki / 吉藤英明2007-04-06
| | | | | | | | | The number of characters in a line MUST be no more than 998 characters, and SHOULD be no more than 78 characters (RFC2822). It is much safer to fold the header by ourselves. Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Make git-send-email aware of Cc: lines.J. Bruce Fields2007-03-18
| | | | | | | | | | In the Linux kernel, for example, it's common to include Cc: lines for cases when you want to remember to cc someone on a patch without necessarily claiming they signed off on it. Make git-send-email aware of these. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-send-email: configurable bcc and chain-reply-toAvi Kivity2007-03-11
| | | | | | | | | | | Chain-reply-to is a personal perference, and is unlikely to change from patchset to patchset. Similarly, bcc is likely to have the same values every invocation is one likes to bcc oneself. So, allow both to be set via configuration variables. Signed-off-by: Avi Kivity <avi@qumranet.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-send-email: abort/usage on bad optionMichael Coleman2007-02-27
| | | | | | | Instead of proceeding, abort and give usage message when a bad option is seen. Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-send-email: remove debugging output.Junio C Hamano2007-01-30
| | | | | | | rfc2047 unquoter spitted out an annoying "- unquoted" which was added during debugging but I forgot to remove. Signed-off-by: Junio C Hamano <junkio@cox.net>
* send-email: work around double encoding of in-body From field.Jürgen Rühle2007-01-10
| | | | | | | | | | | | | | | git-send-email sends out the message taken from format-patch output without quoting nor encoding. When copying the From: line to form in-body From: field, it should not copy it verbatim, because the From: for the header is quoted according to RFC 2047 when not ASCII. The original came from Jürgen Rühle, but I moved the string munging into a separate function so that later other people can tweak it more easily. Bugs introduced during the translation are mine. Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-send-email: default value for "From:" field.Quy Tonthat2006-12-27
| | | | | | | | | If user hits enter at the prompt for "Who should the emails appear to be from?", the value for "From:" field was emptied instead of GIT_COMMITER_IDENT. Signed-off-by: Quy Tonthat <qtonthat@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-send-email: Read the default SMTP server from the GIT config fileSergey Vlasov2006-10-29
| | | | | | | | | Make the default value for --smtp-server configurable through the 'sendemail.smtpserver' option in .git/config (or $HOME/.gitconfig). Signed-off-by: Sergey Vlasov <vsu@altlinux.ru> Acked-by: Ryan Anderson <rda@google.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-send-email: do not pass custom Date: headerEric Wong2006-10-23
| | | | | | | | | | | | | | | We already generate a Date: header based on when the patch was emailed. git-format-patch includes the Date: header of the patch. Having two Date: headers is just confusing, so we just use the current Date: Often the mailed patches in a patch series are created over a series of several hours or days, so the Date: header from the original commit is incorrect for email, and often far off enough for spam filters to complain. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Don't use $author_name undefined when $from contains no /\s</.Jim Meyering2006-10-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I noticed a case not handled in a recent patch. Demonstrate it like this: $ touch new-file $ git-send-email --dry-run --from j --to k new-file 2>err new-file OK. Log says: Date: Thu, 19 Oct 2006 10:26:24 +0200 Sendmail: /usr/sbin/sendmail From: j Subject: Cc: To: k Result: OK $ cat err Use of uninitialized value in pattern match (m//) at /p/bin/git-send-email line 416. Use of uninitialized value in concatenation (.) or string at /p/bin/git-send-email line 420. Use of uninitialized value in concatenation (.) or string at /p/bin/git-send-email line 468. There's a patch for the $author_name part below. The example above shows that $subject may also be used uninitialized. That should be easy to fix, too. Signed-off-by: Jim Meyering <jim@meyering.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Merge branch 'jc/send-email'Junio C Hamano2006-10-18
|\ | | | | | | | | | | | | * jc/send-email: Make git-send-email detect mbox-style patches more readily git-send-email: real name with period need to be dq-quoted on From: line git-send-email: do not drop custom headers the user prepared
| * Make git-send-email detect mbox-style patches more readilyJunio C Hamano2006-10-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Earlier we insisted that mbox file to begin with "From ". That is fine as long as you feed format-patch output, but if you handcraft the input file, this is unnecessary burden. We should detect lines that look like e-mail headers and say that is also a mbox file. The other input file format is traditional "send lots of email", whose first line would never look like e-mail headers, so this is a safe change. The original patch was done by Matthew Wilcox, which checked explicitly for headers the script pays attention to. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * git-send-email: real name with period need to be dq-quoted on From: lineJunio C Hamano2006-10-05
| | | | | | | | | | | | | | | | An author name like 'A. U. Thor <a.u.thor@example.com>" is not a valid RFC 2822 address; when placing it on From: line, we would need to quote it, like this: Signed-off-by: "Junio C. Hamano" <junkio@cox.net>
| * git-send-email: do not drop custom headers the user preparedJunio C Hamano2006-10-05
| | | | | | | | | | | | | | | | | | | | | | | | The command picked up only Subject, CC, and From headers in the incoming mbox text. Sending out patches prepared by git-format-patch with user's custom headers was impossible with that. Just keep the ones it does not need to look at and add them to the header of the message when sending it out. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Add --dry-run option to git-send-emailMatthew Wilcox2006-10-11
|/ | | | | | | | | Add a --dry-run option to git-send-email due to having made too many mistakes with it in the past week. I like having a safety catch on my machine gun. Signed-off-by: Matthew @ilcox <matthew@wil.cx> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-send-email: avoid uninitialized variable warning.Junio C Hamano2006-10-05
| | | | | | | The code took length of $reply_to when it was not even defined, causing -w to warn. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Merge branch 'jc/gitpm'Junio C Hamano2006-09-30
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jc/gitpm: (52 commits) Remove -fPIC which was only needed for Git.xs Git.pm: Kill Git.xs for now Revert "Make it possible to set up libgit directly (instead of from the environment)" Revert "Git.pm: Introduce fast get_object() method" Revert "Convert git-annotate to use Git.pm" Fix compilation with Sun CC pass DESTDIR to the generated perl/Makefile Eliminate Scalar::Util usage from private-Error.pm Convert git-annotate to use Git.pm Git.pm: Introduce fast get_object() method Make it possible to set up libgit directly (instead of from the environment) Work around sed and make interactions on the backslash at the end of line. Git.pm: Introduce ident() and ident_person() methods Convert git-send-email to use Git.pm Git.pm: Add config() method Use $GITPERLLIB instead of $RUNNING_GIT_TESTS and centralize @INC munging INSTALL: a tip for running after building but without installing. Perly Git: make sure we do test the freshly built one. Git.pm: Don't #define around die Git.xs: older perl do not know const char * ...
| * Merge branch 'master' into pb/gitpmJunio C Hamano2006-08-07
| |\ | | | | | | | | | This is to resolve the conflicts with Ryan's annotate updates early.
| * | Git.pm: Introduce ident() and ident_person() methodsPetr Baudis2006-07-03
| | | | | | | | | | | | | | | | | | | | | These methods can retrieve/parse the author/committer ident. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | Convert git-send-email to use Git.pmPetr Baudis2006-07-03
| | | | | | | | | | | | | | | Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | git-send-email: Don't set author_not_sender from Cc: linesHaavard Skinnemoen2006-08-23
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an mbox-style patch contains a Cc: line in the header, git-send-email will check the address against the sender specified on the command line. If they don't match, sender_not_author will be set to the address obtained from the Cc line. When this happens, git-send-email inserts a From: line at the beginning of the message body with the address obtained from the Cc line in the header, and the sender might be accused of forging patch authors. This patch fixes this by only updating sender_not_author when processing From: lines, not when processing Cc: lines. Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | git-send-email: Remove redundant Reply-To headerAlp Toker2006-07-11
| | | | | | | | | | | | | | | | There is no sense in duplicating the sender address in Reply-To as it's already provided in the From header. Signed-off-by: Alp Toker <alp@atoker.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Fix more typos, primarily in the codePavel Roskin2006-07-10
| | | | | | | | | | | | | | | | | | The only visible change is that git-blame doesn't understand "--compability" anymore, but it does accept "--compatibility" instead, which is already documented. Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | send-email: format 2822 datestring ourselves.Jakub Narebski2006-07-07
| | | | | | | | | | | | | | | | | | | | | | It is not worth trying to force C locale (and failing) just to format the 2822 datestring. This code was borrowed from /usr/bin/822-date (Ian Jackson and Klee Dienes, both in public domain), per suggestion by Eric Wong. Signed-off-by: Junio C Hamano <junkio@cox.net> Acked-by: Jakub Narebski <jnareb@gmail.com>
* | send-email: do not barf when Term::ReadLine does not like your terminalJunio C Hamano2006-07-03
|/ | | | | | | | | | | | | As long as we do not need to readline from the terminal, we should not barf when starting up the program. Without this patch, t9001 test on Cygwin occasionally died with the following error message: Unable to get Terminal Size. The TIOCGWINSZ ioctl didn't work. The COLUMNS and LINES environment variables didn't work. The resize program didn't work. at /usr/lib/perl5/vendor_perl/5.8/cygwin/Term/ReadKey.pm line 362. Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8/Term/ReadLine/Perl.pm line 58. Acked-by: Ryan Anderson <ryan@michonline.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Check and document the options to prevent mistakes.Eric W. Biederman2006-06-22
| | | | | | | | | | | | | | | | | | | | | When multiple recipients are given to git-send-email on the same --cc line the code does not properly handle it. Full and proper parsing of the email addresses so I can detect which commas mean a new email address is more than I care to implement. In particular this email address: "bibo,mao" <bibo.mao@intel.com> must not be treated as two email addresses. So this patch simply treats all commas in recipient lists as an error and fails if one is given. At the same time it documents that git-send-email wants multiple instances of --cc specified on the command line if you want to cc multiple recipients. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* send-email: a bit more careful domain regexp.Junio C Hamano2006-06-06
| | | | | | This tightens the regexp a bit to make sure there is no double dots. Signed-off-by: Junio C Hamano <junkio@cox.net>
* send-email: be more lenient and just catch obvious mistakes.Junio C Hamano2006-06-06
| | | | | | | | | | | | | | This cleans up the pattern matching subroutine by introducing two variables to hold regexp to approximately match local-part and domain in the e-mail address. It is meant to catch obvious mistakes with a cheap check. The patch also moves "scalar" to force Email::Valid->address() to work in !wantarray environment to extract_valid_address; earlier it was in the caller of the subroutine, which was way too error prone. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Cleanup git-send-email.perl:extract_valid_emailHorst H. von Brand2006-06-04
| | | | | | | | - Fix the regular expressions for local addresses - Fix the fallback regexp for non-local addresses, simplify the logic Signed-off-by: Horst H. von Brand <vonbrand@inf.utfsm.cl> Signed-off-by: Junio C Hamano <junkio@cox.net>
* send-email: only 'require' instead of 'use' Net::SMTPJohannes Schindelin2006-05-31
| | | | | | | | | This was proposed by Eric Wong and fixes the test. (Of course, git-send-email does not work, if there is no Net::SMTP here, but it will say what is wrong when you actually try to use send-email.) Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* send-email: do not pass bogus address to local sendmail binaryJunio C Hamano2006-05-30
| | | | | | | This makes t9001 test happy. Also fixes the warning on uninitialized $references variable again. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Fix a bug in email extraction used in git-send-email.Ryan Anderson2006-05-29
| | | | | | | (Also, kill off an accidentally created warning.) Signed-off-by: Ryan Anderson <rda@google.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Add support for --bcc to git-send-email.Ryan Anderson2006-05-29
| | | | | Signed-off-by: Ryan Anderson <rda@google.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-send-email: Add References: headers to emails, in addition to In-Reply-To:Ryan Anderson2006-05-29
| | | | | Signed-off-by: Ryan Anderson <rda@google.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* send-email: quiet some warnings, reject invalid addressesEric Wong2006-05-15
| | | | | | | | | | | | | | | I'm not sure why we never actually rejected invalid addresses in the first place. We just seemed to be using our email validity checkers to kill duplicates. Now we just drop invalid email addresses completely and warn the user about it. Since we support local sendmail, we'll also accept username-only addresses. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* send-email: allow sendmail binary to be used instead of SMTPEric Wong2006-05-15
| | | | | | | | | | | | | This should make local mailing possible for machines without a connection to an SMTP server. It'll default to using /usr/sbin/sendmail or /usr/lib/sendmail if no SMTP server is specified (the default). If it can't find either of those paths, it'll fall back to connecting to an SMTP server on localhost. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* send-email: address expansion for common mailersEric Wong2006-05-14
| | | | | | | | | | | | | | | | | | | | | | | mutt, gnus, pine, mailrc formats should be supported. Testing and feedback for correctness and completeness of all formats and support for additional formats would be good. Nested expansions are also supported. More than one alias file to be used. All alias file formats must still of be the same type, though. Two git repo-config keys are required for this (as suggested by Ryan Anderson): sendemail.aliasesfile = <filename of aliases file> sendemail.aliasfiletype = (mutt|gnus|pine|mailrc) Signed-off-by: Eric Wong <normalperson@yhbt.net> Acked-by: Ryan Anderson <ryan@michonline.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-send-email: fix version string to be valid perlMartin Langhoff2006-05-02
| | | | | | | This makes git-send-email easier to develop and debug, skipping the need to `make git-send-email` every time. Signed-off-by: Junio C Hamano <junkio@cox.net>