aboutsummaryrefslogtreecommitdiff
path: root/mailinfo.c
Commit message (Collapse)AuthorAge
* Make git-mailinfo a builtinLukas Sandström2006-06-18
| | | | | | | [jc: with a bit of constness tightening] Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
* mailinfo: ignore blanks after in-body headers.Junio C Hamano2006-06-17
| | | | | | | [jc: this is based on Eric's patch but also fixes up the parsed subject headers]. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Don't parse any headers in the real body of an email message.Eric W. Biederman2006-06-17
| | | | | | | | | | It was pointed out that the current behaviour might mispart a patch comment so remove this behaviour for now. [jc: this fixes "From: line in the middle" check in t5100 test.] Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Merge branch 'jc/mailinfo'Junio C Hamano2006-05-28
|\ | | | | | | | | * jc/mailinfo: mailinfo: skip bogus UNIX From line inside body
| * mailinfo: skip bogus UNIX From line inside bodyJunio C Hamano2006-05-21
| | | | | | | | | | | | | | Sometimes people just include the whole format-patch output in the commit e-mail. Detect it and skip the bogus ">From " line. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | mailinfo: More carefully parse header lines in read_one_header_line()Junio C Hamano2006-05-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We exited prematurely from header parsing loop when the header field did not have a space after the colon but we insisted on it, and we got the check wrong because we forgot that we strip the trailing whitespace before we do the check. The space after the colon is not even required by RFC2822, so stop requiring it. While we are at it, the header line is specified to be more strict than "anything with a colon in it" (there must be one or more characters before the colon, and they must not be controls, SP or non US-ASCII), so implement that check as well, lest we mistakenly think something like: Bogus not a header line: this is not. as a header line. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Allow in body headers beyond the in body header prefix.Eric W. Biederman2006-05-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - handle_from is fixed to not mangle it's input line. - Then handle_inbody_header is allowed to look in the body of a commit message for additional headers that we haven't already seen. This allows patches with all of the right information in unfortunate places to be imported. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | More accurately detect header lines in read_one_header_lineEric W. Biederman2006-05-23
| | | | | | | | | | | | | | | | Only count lines of the form '^.*: ' and '^From ' as email header lines. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | In handle_body only read a line if we don't already have one.Eric W. Biederman2006-05-23
| | | | | | | | | | | | | | | | | | This prepares for detecting non-email patches that don't have mail headers. In which case we have already read the first line so handle_body should not ignore it. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Refactor commit messge handling.Eric W. Biederman2006-05-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Move handle_info into main so it is called once after everything has been parsed. This allows the removal of a static variable and removes two duplicate calls. - Move parsing of inbody headers into handle_commit. This means we parse the in-body headers after we have decoded the character set, and it removes code duplication between handle_multipart_one_part and handle_body. - Change the flag indicating that we have seen an in body prefix header into another bit in seen. This is a little more general and allows the possibility of parsing in body headers after the body message has begun. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Move B and Q decoding into check header.Eric W. Biederman2006-05-23
| | | | | | | | | | | | | | | | B and Q decoding is not appropriate for in body headers, so move it up to where we explicitly know we have a real email header. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Make read_one_header_line return a flag not a length.Eric W. Biederman2006-05-23
|/ | | | | | | | | Currently we only use the return value from read_one_header line to tell if the line we have read is a header or not. So make it a flag. This paves the way for better email detection. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* mailinfo: decode underscore used in "Q" encoding properly.Junio C Hamano2006-04-21
| | | | | | | | Quoted-Printable (RFC 2045) and the "Q" encoding (RFC 2047) are subtly different; the latter is used on the mail header and an underscore needs to be decoded to 0x20. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Allow building Git in systems without iconvFernando J. Pereda2006-02-16
| | | | | | | | | | | Systems using some uClibc versions do not properly support iconv stuff. This patch allows Git to be built on those systems by passing NO_ICONV=YesPlease to make. The only drawback is mailinfo won't do charset conversion in those systems. Signed-off-by: Fernando J. Pereda <ferdy@gentoo.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* [PATCH] mailinfo: reset CTE after each multipartJunio C Hamano2006-02-06
| | | | | | | | | If the first part uses quoted-printable to protect iso8859-1 name in the commit log, and the second part was plain ascii text patchfile without even Content-Transfer-Encoding subheader, we incorrectly tried to decode the patch as quoted printable. Signed-off-by: Junio C Hamano <junkio@cox.net>
* mailinfo: iconv does not like "latin-1" -- should spell it "latin1"Junio C Hamano2005-12-23
| | | | | | | | | | | This was a stupid typo that did not follow http://www.iana.org/assignments/character-sets Long noticed but neglected by JC, but finally reported by Marco. Signed-off-by: Junio C Hamano <junkio@cox.net>
* mailinfo and git-am: allow "John Doe <johndoe>"Junio C Hamano2005-12-14
| | | | | | | | | | An isolated developer could have a local-only e-mail, which will be stripped out by mailinfo because it lacks '@'. Define a fallback parser to accomodate that. At the same time, reject authorless patch in git-am. Signed-off-by: Junio C Hamano <junkio@cox.net>
* [PATCH] Initial AIX portability fixes.Jason Riedy2005-12-06
| | | | | | | | | | | Added an AIX clause in the Makefile; that clause likely will be wrong for any AIX pre-5.2, but I can only test on 5.3. mailinfo.c was missing the compat header file, and convert-objects.c needs to define a specific _XOPEN_SOURCE as well as _XOPEN_SOURCE_EXTENDED. Signed-off-by: E. Jason Riedy <ejr@cs.berkeley.edu> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Clean up compatibility definitions.Junio C Hamano2005-12-05
| | | | | | | | | | | | | | | | | | This attempts to clean up the way various compatibility functions are defined and used. - A new header file, git-compat-util.h, is introduced. This looks at various NO_XXX and does necessary function name replacements, equivalent of -Dstrcasestr=gitstrcasestr in the Makefile. - Those function name replacements are removed from the Makefile. - Common features such as usage(), die(), xmalloc() are moved from cache.h to git-compat-util.h; cache.h includes git-compat-util.h itself. Signed-off-by: Junio C Hamano <junkio@cox.net>
* mailinfo: Do not use -u=<encoding>; say --encoding=<encoding>Junio C Hamano2005-11-28
| | | | | | | | | | Specifying the value for a single letter, single dash option parameter with equal sign looked funny, and more importantly calling the flag to override encoding from utf-8 to something else "-u" (obviously abbreviated from "utf-8") did not make any sense. So spell it out. Signed-off-by: Junio C Hamano <junkio@cox.net>
* mailinfo: Use i18n.commitencodingJunio C Hamano2005-11-27
| | | | | | | | This uses i18n.commitencoding configuration item to pick up the default commit encoding for the repository when converting form e-mail encoding to commit encoding (the default is utf8). Signed-off-by: Junio C Hamano <junkio@cox.net>
* mailinfo: allow -u to fall back on latin1 to utf8 conversion.Junio C Hamano2005-11-27
| | | | | | | | | | | When the message body does not identify what encoding it is in, -u assumes it is in latin-1 and converts it to utf8, which is the recommended encoding for git commit log messages. With -u=<encoding>, the conversion is made into the specified one, instead of utf8, to allow project-local policies. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Give proper prototype to gitstrcasestr.Junio C Hamano2005-10-08
| | | | | | | Borrow from NO_MMAP patch by Johannes, squelch compiler warnings by declaring gitstrcasestr() when we use it. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Flatten tools/ directory to make build procedure simpler.Junio C Hamano2005-09-07
Also make platform specific part more isolated. Currently we only have Darwin defined, but I've taken a look at SunOS specific patch (which I dropped on the floor for now) as well. Doing things this way would make adding it easier. Signed-off-by: Junio C Hamano <junkio@cox.net>