From: Jia He <hejianet@gmail.com>
To: Joe Perches <joe@perches.com>, Andy Whitcroft <apw@canonical.com>
Cc: linux-kernel@vger.kernel.org, Jia He <jia.he@hxt-semitech.com>
Subject: Re: [PATCH] checkpatch: relax check for revert commit
Date: Tue, 10 Apr 2018 10:42:58 +0800 [thread overview]
Message-ID: <7c4a079b-9708-2b6e-5462-2c1c6bbf08d2@gmail.com> (raw)
In-Reply-To: <e5d59c005cdf0183b866fd24a012ccc35118f121.camel@perches.com>
On 4/9/2018 6:50 PM, Joe Perches Wrote:
> On Mon, 2018-04-09 at 14:37 +0800, Jia He wrote:
>> On 4/9/2018 1:07 AM, Joe Perches Wrote:
>>> On Sun, 2018-04-08 at 10:12 +0800, Jia He wrote:
>>>> Hi Andy & Joe
>>>>
>>>> Although it is minor, it is a real bug, I thought.
>>>>
>>>> Is there any comment? Thank you
>>> If you really want to do something useful here,
>>> quote the quote characters and compare for that.
>>>
>>>
>> Hi Joe, thanks for the comments
>> I am not sure I understand you comments here.
> Change the tests to allow quote characters instead
> of ignoring them.
>
> To do this matching, any internal quote character in
> the actual commit string and the commit string from the
> patch must be perl quoted with \Q<string>\E so that the
> expected title can be matched properly.
Sorry,I didn't catch your point, even can't image how \Q \E is helpful. ;-)
Maybe I haven't explained my changes clearly.
e.g. commit f5c1350256fb ("Revert "XXX"")
2617 } elsif ($line =~ /\bcommit\s+[0-9a-f]{5,}\s*$/i &&
2618 defined $rawlines[$linenr] &&
2619 $rawlines[$linenr] =~ /^\s*\("([^"]+)"\)/) {
2620 $orig_desc = $1;
2621 $hasparens = 1;
line 2619, the match pattern ([^"]+)"\) will match NULL and let $orig_desc="" in
this case.
My change is to let $orig_desc to be Revert "XXX"
Since the old code will check the commit id by git command to get the _real_
commit title.
I can't understand why I should use \Q \E here, sorry if I am missing something.
Cheers,
Jia
prev parent reply other threads:[~2018-04-10 2:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-02 14:28 [PATCH] relax check regex " Jia He
2018-04-02 14:28 ` [PATCH] checkpatch: relax check " Jia He
2018-04-08 2:12 ` Jia He
2018-04-08 17:07 ` Joe Perches
2018-04-09 6:37 ` Jia He
2018-04-09 10:50 ` Joe Perches
2018-04-10 2:42 ` Jia He [this message]
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=7c4a079b-9708-2b6e-5462-2c1c6bbf08d2@gmail.com \
--to=hejianet@gmail.com \
--cc=apw@canonical.com \
--cc=jia.he@hxt-semitech.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®