[PATCH 4/5] format-patch: fix rfc2047 address encoding with respect to rfc822 specials

2012-10-08 Thread Jan H . Schönherr
From: Jan H. Schönherr schn...@cs.tu-berlin.de According to RFC 2047 and RFC 822, rfc2047 encoded words and and rfc822 quoted strings do not mix. Be more strict about rfc2047 encoded words in addresses, so that it is a bit more conform to RFC 2047. (Especially, my own name gets correctly

[PATCH 5/5] format-patch: tests: check rfc822+rfc2047 in to+cc headers

2012-10-08 Thread Jan H . Schönherr
From: Jan H. Schönherr schn...@cs.tu-berlin.de Do some checks for RFC 822 and RFC 2047 support in To: and Cc: headers and fix ambiguous old checks. Signed-off-by: Jan H. Schönherr schn...@cs.tu-berlin.de --- t/t4014-format-patch.sh | 98 + 1 Datei

[PATCH 0/5] Cure some format-patch wrapping and encoding issues

2012-10-08 Thread Jan H . Schönherr
. (In that case, I would repost an updated version of this series.) Regards Jan Jan H. Schönherr (5): format-patch: do not wrap non-rfc2047 headers too early format-patch: do not wrap rfc2047 encoded headers too late format-patch: introduce helper function last_line_length() format-patch: fix

[PATCH 1/5] format-patch: do not wrap non-rfc2047 headers too early

2012-10-08 Thread Jan H . Schönherr
From: Jan H. Schönherr schn...@cs.tu-berlin.de Do not wrap the second and later lines of an ASCII header substantially before the 78 character limit. Signed-off-by: Jan H. Schönherr schn...@cs.tu-berlin.de --- pretty.c| 2 +- t/t4014-format-patch.sh | 60

[PATCH 3/5] format-patch: introduce helper function last_line_length()

2012-10-08 Thread Jan H . Schönherr
From: Jan H. Schönherr schn...@cs.tu-berlin.de Currently, an open-coded loop to calculate the length of the last line of a string buffer is used in multiple places. Move that code into a function of its own. Signed-off-by: Jan H. Schönherr schn...@cs.tu-berlin.de --- pretty.c | 25

[PATCH 2/5] format-patch: do not wrap rfc2047 encoded headers too late

2012-10-08 Thread Jan H . Schönherr
From: Jan H. Schönherr schn...@cs.tu-berlin.de Encoded characters add more than one character at once to an encoded header. Include all characters that are about to be added in the length calculation for wrapping. Additionally, RFC 2047 imposes a maximum line length of 76 characters if that line

Re: [PATCH 2/5] format-patch: do not wrap rfc2047 encoded headers too late

2012-10-10 Thread Jan H. Schönherr
Am 09.10.2012 21:30, schrieb Junio C Hamano: Jan H. Schönherr schn...@cs.tu-berlin.de writes: ... static int is_rfc2047_special(char ch) { +/* + * We encode ' ' using '=20' even though rfc2047 + * allows using '_' for readability. Unfortunately, + * many programs do

Re: [PATCH 0/5] Cure some format-patch wrapping and encoding issues

2012-10-10 Thread Jan H. Schönherr
Am 09.10.2012 21:07, schrieb Junio C Hamano: Jan H. Schönherr schn...@cs.tu-berlin.de writes: During the creation of this series, I came across the strbuf wrapping functions, and I wonder if there is an off-by-one issue. Consider the following excerpt from t4202: ... Yeah, that does

Re: [PATCH v5 02/12] ctype: support iscntrl, ispunct, isxdigit and isprint

2012-10-17 Thread Jan H. Schönherr
Hi Nguyen. I just had a need for isprint() myself, and then I found your code here. I had a look at the POSIX locale as describe here: http://sourceware.org/git/?p=glibc.git;a=blob;f=localedata/locales/POSIX Some remarks below. Am 14.10.2012 16:26, schrieb Nguyen Thai Ngoc Duy: -- 8 -- diff

[PATCH v2 0/7] Cure some format-patch wrapping and encoding issues

2012-10-18 Thread Jan H . Schönherr
2047 than v1 - updated commit messages/comments Regards Jan Jan H. Schönherr (7): utf8: fix off-by-one wrapping of text format-patch: do not wrap non-rfc2047 headers too early format-patch: do not wrap rfc2047 encoded headers too late format-patch: introduce helper function last_line_length

[PATCH v2 1/7] utf8: fix off-by-one wrapping of text

2012-10-18 Thread Jan H . Schönherr
From: Jan H. Schönherr schn...@cs.tu-berlin.de The wrapping logic in strbuf_add_wrapped_text() does currently not allow lines that entirely fill the allowed width, instead it wraps the line one character too early. For example, the text This is the sixth commit. formatted via %w(11,1,2) (wrap

[PATCH v2 2/7] format-patch: do not wrap non-rfc2047 headers too early

2012-10-18 Thread Jan H . Schönherr
From: Jan H. Schönherr schn...@cs.tu-berlin.de Do not wrap the second and later lines of non-rfc2047-encoded headers substantially before the 78 character limit. Instead of passing the remaining length of the first line as wrapping width, use the correct maximum length and tell

[PATCH v2 3/7] format-patch: do not wrap rfc2047 encoded headers too late

2012-10-18 Thread Jan H . Schönherr
From: Jan H. Schönherr schn...@cs.tu-berlin.de Encoded characters add more than one character at once to an encoded header. Include all characters that are about to be added in the length calculation for wrapping. Additionally, RFC 2047 imposes a maximum line length of 76 characters if that line

[PATCH v2 4/7] format-patch: introduce helper function last_line_length()

2012-10-18 Thread Jan H . Schönherr
From: Jan H. Schönherr schn...@cs.tu-berlin.de Currently, an open-coded loop to calculate the length of the last line of a string buffer is used in multiple places. Move that code into a function of its own. Signed-off-by: Jan H. Schönherr schn...@cs.tu-berlin.de --- pretty.c | 25

[PATCH v2 5/7] format-patch: make rfc2047 encoding more strict

2012-10-18 Thread Jan H . Schönherr
From: Jan H. Schönherr schn...@cs.tu-berlin.de RFC 2047 requires more characters to be encoded than it is currently done. Especially, RFC 2047 distinguishes between allowed remaining characters in encoded words in addresses (From, To, etc.) and other headers, such as Subject. Make add_rfc2047

[PATCH v2 6/7] format-patch: fix rfc2047 address encoding with respect to rfc822 specials

2012-10-18 Thread Jan H . Schönherr
From: Jan H. Schönherr schn...@cs.tu-berlin.de According to RFC 2047 and RFC 822, rfc2047 encoded words and and rfc822 quoted strings do not mix. Since add_rfc2047() no longer leaves RFC 822 specials behind, the quoting is also no longer necessary to create a standard-conform mail. Remove

[PATCH v2 7/7] format-patch tests: check quoting/encoding in To: and Cc: headers

2012-10-18 Thread Jan H . Schönherr
From: Jan H. Schönherr schn...@cs.tu-berlin.de git-format-patch does currently not parse user supplied extra header values (e. g., --cc, --add-header) and just replays them. That forces users to add them RFC 2822/2047 conform in encoded form, e. g. --cc '=?UTF-8?q?Jan=20H=2E=20Sch=C3=B6nherr

Re: [PATCH nd/wildmatch] Correct Git's version of isprint and isspace

2012-11-13 Thread Jan H. Schönherr
Hi. Am 13.11.2012 11:46, schrieb Nguyễn Thái Ngọc Duy: Git's ispace does not include 11 and 12. Git's isprint includes control space characters (10-13). According to glibc-2.14.1 on C locale on Linux, this is wrong. This patch fixes it. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com

Re: [PATCH] wildmatch: correct isprint and isspace

2012-11-15 Thread Jan H. Schönherr
Am 15.11.2012 13:19, schrieb Nguyễn Thái Ngọc Duy: On Thu, Nov 15, 2012 at 2:30 AM, René Scharfe rene.scha...@lsrfire.ath.cx wrote: Nevertheless, it's unfortunate that we have an isspace() that *almost* does what the widely known thing of the same name does. I'd shy away from