Re: [PATCH 1/2] shortlog: Fix wrapping lines of wraplen (was broken since recent off-by-one fix)

2012-12-11 Thread Jan H. Schönherr
Am 11.12.2012 06:59, schrieb Steffen Prohaska: > A recent commit [1] fixed a off-by-one wrapping error. As > a side-effect, the conditional in add_wrapped_shortlog_msg() whether to > append a newline needs to be removed. add_wrapped_shortlog_msg() should > always append a newline, which was the c

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 > 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 > > changing git's version dire

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 > --- > I wr

[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 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?= <...>

[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 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 the quoting, when RFC 2047

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

2012-10-18 Thread Jan H . Schönherr
From: Jan H. Schönherr 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() and is_rfc2047_special

[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 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 --- pretty.c | 25 + 1 Datei geändert, 13 Zeilen

[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 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 contains an rfc2047

[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 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 strbuf_add_wrapped_bytes() how many

[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 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 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

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< -- > di

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 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: ... >

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

2012-10-10 Thread Jan H. Schönherr
Am 09.10.2012 21:45, schrieb Junio C Hamano: > Jan H. Schönherr writes: > >> +test_expect_failure 'additional command line cc (rfc822)' ' >> + >> +git config --replace-all format.headers "Cc: R E Cipient >> " && >> g

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 writes: ... >> static int is_rfc2047_special(char ch) >> { >> +/* >> + * We encode ' ' using '=20' even though rfc2047 >> + * allows using '_' for readabil

[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 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 contains an rfc2047

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

2012-10-08 Thread Jan H . Schönherr
From: Jan H. Schönherr 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 --- pretty.c | 25 + 1 Datei geändert, 13 Zeilen

[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 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 --- pretty.c| 2 +- t/t4014-format-patch.sh | 60 - 2 Dateien geändert

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

2012-10-08 Thread Jan H . Schönherr
he sixth commit. This is the fifth commit. (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

[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 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 --- t/t4014-format-patch.sh | 98 + 1 Datei geändert, 66 Zeilen hinzugefügt(+), 32 Zeilen

[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 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 decoded as Jan H. Schönherr