public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Kaartic Sivaraam <kaarticsivaraam91196@gmail•com>
Cc: git@vger•kernel.org
Subject: Re: [PATCH 2/2] commit-template: add new line before status information
Date: Thu, 29 Jun 2017 10:51:57 -0700	[thread overview]
Message-ID: <xmqq4luyvg02.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20170629170120.11479-2-kaarticsivaraam91196@gmail.com> (Kaartic Sivaraam's message of "Thu, 29 Jun 2017 22:31:20 +0530")

Kaartic Sivaraam <kaarticsivaraam91196@gmail•com> writes:

> The commit template adds the optional parts without
> a new line to distinguish them. This results in
> difficulty in interpreting it's content, specifically
> for inexperienced users.
>
> Add new lines to separate the distinct parts of the
> template.
> ---
>  I tried writing tests to ensure that the new line is added
>  but as it seems to require checking multi-line, special 
>  options of grep were required to check. I tried the following,
>
>    test_expect_success 'new line found before status message' '
>     ! (GIT_EDITOR="cat >editor-input" git commit) &&
>     grep -Pz "#\n# On branch" editor-input
>    '
>
>  It worked well locally but seems to make the build with 
>  GETTEXT_POISON=YesPlease to fail. So, I removed it.
>  Not sure how to write a good test for this change, sorry :(

The above is a good way to capture the input to the editor, but the
test with "grep -P" which is not portable would not work well.  You
however should be able to prepare an expected output with

	cat >expect <<\-EOF &&
	... expected contents to editor-input here ...
	EOF

and do "test_i18ncmp expect editor-input" instead of "grep -P".

  reply	other threads:[~2017-06-29 17:52 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-26 17:24 [PATCH/RFC] commit-template: improve readability of commit template Kaartic Sivaraam
2017-06-26 21:59 ` Junio C Hamano
2017-06-27 17:22   ` Kaartic Sivaraam
2017-06-27 17:56     ` Junio C Hamano
2017-06-28 13:04       ` Kaartic Sivaraam
2017-06-28 14:50         ` Kaartic Sivaraam
2017-06-28 13:29       ` [PATCH] " Kaartic Sivaraam
2017-06-28 14:47         ` Kaartic Sivaraam
2017-06-28 16:48         ` Junio C Hamano
2017-06-29 17:01           ` [PATCH 1/2] commit-template: remove outdated notice about explicit paths Kaartic Sivaraam
2017-06-29 17:01             ` [PATCH 2/2] commit-template: add new line before status information Kaartic Sivaraam
2017-06-29 17:51               ` Junio C Hamano [this message]
2017-06-29 18:17               ` Junio C Hamano
2017-06-30  3:19                 ` Kaartic Sivaraam
2017-06-29 17:56             ` [PATCH 1/2] commit-template: remove outdated notice about explicit paths Junio C Hamano
2017-06-30  3:18               ` Kaartic Sivaraam
2017-06-30 12:12                 ` Kaartic Sivaraam
2017-06-30 12:12                   ` [PATCH 2/2] commit-template: distinguish status information unconditionally Kaartic Sivaraam
2017-06-30 14:52                     ` Junio C Hamano
2017-07-01  1:59                       ` Kaartic Sivaraam
2017-07-01 11:44                         ` Ævar Arnfjörð Bjarmason
2017-07-01 12:08                           ` Kaartic Sivaraam
2017-07-01 17:21                           ` Junio C Hamano
2017-07-09 17:54                   ` [PATCH 1/2] commit-template: remove outdated notice about explicit paths Kaartic Sivaraam
2017-07-09 18:54                     ` Junio C Hamano

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=xmqq4luyvg02.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=kaarticsivaraam91196@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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