git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Shumkin <alex.crezoff@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: Re: [PATCH v2 1/2] t4205, t6006: Add failing tests for the case when i18n.logOutputEncoding is set
Date: Sat, 17 May 2014 12:52:03 +0400	[thread overview]
Message-ID: <20140517085203.GA27165@dell-note> (raw)
In-Reply-To: <xmqqfvk9a797.fsf@gitster.dls.corp.google.com>

On Fri, May 16, 2014 at 11:49:40AM -0700, Junio C Hamano wrote:
> Alexey Shumkin <alex.crezoff@gmail.com> writes:
> 
> > Pretty format string %<(N,[ml]trunc)>%s truncates subject to a given
> > length with an appropriate padding. This works for non-ASCII texts when
> > i18n.logOutputEncoding is UTF-8 only (independently of a printed commit
> > message encoding) but does not work when i18n.logOutputEncoding is NOT
> > UTF-8.
> >
> > There were no breakages as far as were no tests for the case
> > when both a commit message and logOutputEncoding are not UTF-8.
> >
> > Add failing tests for that which will be fixed in the next patch.
> >
> > Signed-off-by: Alexey Shumkin <Alex.Crezoff@gmail.com>
> > Reviewed-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> > ---
> >  t/t4205-log-pretty-formats.sh | 169 ++++++++++++++++++++++++++++++++++++++++++
> >  t/t6006-rev-list-format.sh    |  75 ++++++++++++++++++-
> >  2 files changed, 242 insertions(+), 2 deletions(-)
> >
> > diff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh
> > index 2a6278b..6791e0d 100755
> > --- a/t/t4205-log-pretty-formats.sh
> > +++ b/t/t4205-log-pretty-formats.sh
> > @@ -153,6 +153,19 @@ EOF
> >  	test_cmp expected actual
> >  '
> >  
> > +test_expect_success 'left alignment formatting. i18n.logOutputEncoding' '
> > +	git -c i18n.logOutputEncoding=iso8859-1 log --pretty="format:%<(40)%s" >actual &&
> > +	# complete the incomplete line at the end
> > +	echo >>actual &&
> 
> Would it change the meaning of the test if you used tformat: instead
> of format: (or --format="%<(40)%s")?  If it doesn't, it would make
> it unnecessary to append an extra LF and explain why you do so.
Well, actually, I just copied previous tests and added
i18n.logOutputEncoding.

But as I can see in the code - no, tformat will not change the meaning.
so, may be there is a reason to change that (initial) tests from format
to tformat first? And then add mine new.
> 
> > +	qz_to_tab_space <<EOF | iconv -f utf-8 -t iso8859-1 >expected &&
> 
> It is minor but many existing uses of iconv in our tests spell these
> as UTF-8 and ISO8859-1 in uppercase.  I vaguely recall there was a
> portability concern to favor the ones that are used in existing
> tests, but probably it no longer matters (I see you added the
> lowercase one with de6029a2 mid last year), so I am fine if these
> stay lowercase.
I've grep'ed for lowercase iso8859-1 in test, and found almost all of
them is code added by me.
Grep for uppercase gives more results. I can refactor that first for
uniformity.
> 
> > +	git -c i18n.logOutputEncoding=iso8859-1 log --pretty="format:%<(1)%s" >actual &&
> > +	# complete the incomplete line at the end
> > +	echo >>actual &&
> 
> Likewise for all the other "--pretty=format:" followed by an echo.
the same copy-paste-modify.

> 
> Thanks.

-- 
Alexey Shumkin

  reply	other threads:[~2014-05-17  8:52 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-16 13:06 [PATCH 0/2] Pretty print truncate does not work Alexey Shumkin
2014-05-16 13:06 ` [PATCH 1/2] t4205 (log-pretty-formats): Add failing tests for the case when i18n.logOutputEncoding is set Alexey Shumkin
2014-05-16 13:06 ` [PATCH 2/2] pretty.c: format string with truncate respects logOutputEncoding Alexey Shumkin
2014-05-16 13:44   ` Duy Nguyen
2014-05-16 15:40     ` [PATCH v2 0/2] Reroll patch series. Pretty print truncate does not work Alexey Shumkin
2014-05-16 15:40     ` [PATCH v2 1/2] t4205, t6006: Add failing tests for the case when i18n.logOutputEncoding is set Alexey Shumkin
2014-05-16 18:49       ` Junio C Hamano
2014-05-17  8:52         ` Alexey Shumkin [this message]
2014-05-19 15:28         ` [PATCH v3 0/5] Reroll patches. Pretty print truncate does not work Alexey Shumkin
2014-05-21 13:20           ` [PATCH v4 " Alexey Shumkin
2014-05-21 13:20           ` [PATCH v4 1/5] t4205 (log-pretty-formats): don't hardcode SHA-1 in expected outputs Alexey Shumkin
2014-05-21 13:20           ` [PATCH v4 2/5] t4041, t4205, t6006, t7102: Don't hardcode tested encoding value Alexey Shumkin
2014-05-21 13:20           ` [PATCH v4 3/5] t4205 (log-pretty-format): Use `tformat` rather than `format` Alexey Shumkin
2014-05-21 13:20           ` [PATCH v4 4/5] t4205, t6006: Add failing tests for the case when i18n.logOutputEncoding is set Alexey Shumkin
2014-05-21 15:38             ` Ramsay Jones
2014-05-21 18:11               ` Junio C Hamano
2014-05-21 13:20           ` [PATCH v4 5/5] pretty.c: format string with truncate respects logOutputEncoding Alexey Shumkin
2014-05-19 15:28         ` [PATCH v3 1/5] t4205 (log-pretty-formats): don't hardcode SHA-1 in expected outputs Alexey Shumkin
2014-05-19 15:28         ` [PATCH v3 2/5] t4041, t4205, t6006, t7102: Don't hardcode tested encoding value Alexey Shumkin
2014-05-20  1:49           ` brian m. carlson
2014-05-20  6:41             ` Alexey Shumkin
2014-05-19 15:28         ` [PATCH v3 3/5] t4205 (log-pretty-format): Use `tformat` rather than `format` Alexey Shumkin
2014-05-19 15:28         ` [PATCH v3 4/5] t4205, t6006: Add failing tests for the case when i18n.logOutputEncoding is set Alexey Shumkin
2014-05-19 15:28         ` [PATCH v3 5/5] pretty.c: format string with truncate respects logOutputEncoding Alexey Shumkin
2014-05-16 15:40     ` [PATCH v2 2/2] " Alexey Shumkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140517085203.GA27165@dell-note \
    --to=alex.crezoff@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pclouds@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).