linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] coccicheck:support $COCCI being defined as a directory
@ 2019-10-24  6:04 zhongshiqi
  2019-10-24  6:19 ` Julia Lawall
  2019-10-24  7:06 ` [PATCH v2] " Markus Elfring
  0 siblings, 2 replies; 6+ messages in thread
From: zhongshiqi @ 2019-10-24  6:04 UTC (permalink / raw)
  To: Julia.Lawall
  Cc: Gilles.Muller, nicolas.palix, michal.lkml, cocci, linux-kernel,
	xue.zhihong, wang.yi59, cheng.shengyu, zhongshiqi

Put a modification in scripts/coccicheck which supports users in
configuring COCCI parameter as a directory to traverse files in
directory whose next level directory contains rule files with Suffix of
cocci.

Signed-off-by: zhongshiqi <zhong.shiqi@zte.com.cn>
---
Changes in v2:
        1.fix patch subject according to the reply by Markus
        <Markus.Elfring@web.de>
        2.change description in “imperative mood”

 scripts/coccicheck | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/coccicheck b/scripts/coccicheck
index e04d328..a1c4197 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -257,6 +257,10 @@ if [ "$COCCI" = "" ] ; then
     for f in `find $srctree/scripts/coccinelle/ -name '*.cocci' -type f | sort`; do
 	coccinelle $f
     done
+elif [ -d "$COCCI" ] ; then
+    for f in `find $COCCI/ -name '*.cocci' -type f | sort`; do
+	coccinelle $f
+    done
 else
     coccinelle $COCCI
 fi
-- 
2.9.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] coccicheck:support $COCCI being defined as a directory
  2019-10-24  6:04 [PATCH v2] coccicheck:support $COCCI being defined as a directory zhongshiqi
@ 2019-10-24  6:19 ` Julia Lawall
  2019-10-24  7:55   ` [PATCH v2] coccicheck: support " Markus Elfring
  2019-10-24  7:06 ` [PATCH v2] " Markus Elfring
  1 sibling, 1 reply; 6+ messages in thread
From: Julia Lawall @ 2019-10-24  6:19 UTC (permalink / raw)
  To: zhongshiqi
  Cc: Gilles Muller, nicolas.palix, michal.lkml, cocci, linux-kernel,
	xue.zhihong, wang.yi59, cheng.shengyu

[-- Attachment #1: Type: text/plain, Size: 1577 bytes --]



On Thu, 24 Oct 2019, zhongshiqi wrote:

> Put a modification in scripts/coccicheck which supports users in
> configuring COCCI parameter as a directory to traverse files in
> directory whose next level directory contains rule files with Suffix of
> cocci.

While I thought the original was fine, if we are going to strive for
perfection, there are some things that could be changed.  First there
should be a space in the subject line after the :

Second the commit log could be more concise as:

Allow defining COCCI as a directory that contains .cocci files.

In general, at least in simple cases, it is not necessary to mention the
name of the file you are modifying in the comit log, because one can see
that just below from looking at the diffstat and the patch.

thanks,
julia

>
> Signed-off-by: zhongshiqi <zhong.shiqi@zte.com.cn>
> ---
> Changes in v2:
>         1.fix patch subject according to the reply by Markus
>         <Markus.Elfring@web.de>
>         2.change description in “imperative mood”
>
>  scripts/coccicheck | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/scripts/coccicheck b/scripts/coccicheck
> index e04d328..a1c4197 100755
> --- a/scripts/coccicheck
> +++ b/scripts/coccicheck
> @@ -257,6 +257,10 @@ if [ "$COCCI" = "" ] ; then
>      for f in `find $srctree/scripts/coccinelle/ -name '*.cocci' -type f | sort`; do
>  	coccinelle $f
>      done
> +elif [ -d "$COCCI" ] ; then
> +    for f in `find $COCCI/ -name '*.cocci' -type f | sort`; do
> +	coccinelle $f
> +    done
>  else
>      coccinelle $COCCI
>  fi
> --
> 2.9.5
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] coccicheck: support $COCCI being defined as a directory
  2019-10-24  6:04 [PATCH v2] coccicheck:support $COCCI being defined as a directory zhongshiqi
  2019-10-24  6:19 ` Julia Lawall
@ 2019-10-24  7:06 ` Markus Elfring
  1 sibling, 0 replies; 6+ messages in thread
From: Markus Elfring @ 2019-10-24  7:06 UTC (permalink / raw)
  To: Zhong Shiqi, cocci
  Cc: linux-kernel, kernel-janitors, Cheng Shengyu, Gilles Muller,
	Julia Lawall, Masahiro Yamada, Michal Marek, Nicolas Palix,
	Yi Wang, Xue Zhihong

I find that the commit message should still be considerably improved.
How do you think about to use the subject “[PATCH] coccicheck:
Support search for SmPL scripts within selected directory hierarchy”?


> Put a modification in scripts/coccicheck which supports users in
> configuring COCCI parameter as a directory to traverse files in
> directory whose next level directory contains rule files with Suffix of cocci.

* Please avoid a typo in this change description.

* Would you like to integrate a wording approach like the following?

  A search can be performed for SmPL scripts within a directory hierarchy.
  Start a corresponding file determination if the environment variable “COCCI”
  contains an acceptable path.


Regards,
Markus

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] coccicheck: support $COCCI being defined as a directory
  2019-10-24  6:19 ` Julia Lawall
@ 2019-10-24  7:55   ` Markus Elfring
  2019-10-24  7:58     ` Julia Lawall
  0 siblings, 1 reply; 6+ messages in thread
From: Markus Elfring @ 2019-10-24  7:55 UTC (permalink / raw)
  To: Julia Lawall, cocci
  Cc: linux-kernel, kernel-janitors, Cheng Shengyu, Gilles Muller,
	Masahiro Yamada, Michal Marek, Nicolas Palix, Yi Wang,
	Xue Zhihong, Zhong Shiqi

> Second the commit log could be more concise as:

I like your desire for choosing a more appropriate commit message.


> Allow defining COCCI as a directory that contains .cocci files.

I would prefer to concentrate the patch subject on other information.


> In general, at least in simple cases, it is not necessary to mention the
> name of the file you are modifying in the comit log, because one can see
> that just below from looking at the diffstat and the patch.

This view can be reasonable. - How does it fit to the usual requirement
for the specification of a “subsystem” (or “prefix”) according to the
canonical patch format?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=13b86bc4cd648eae69fdcf3d04b2750c76350053#n656

Regards,
Markus

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] coccicheck: support $COCCI being defined as a directory
  2019-10-24  7:55   ` [PATCH v2] coccicheck: support " Markus Elfring
@ 2019-10-24  7:58     ` Julia Lawall
  2019-10-24  9:11       ` [v2] " Markus Elfring
  0 siblings, 1 reply; 6+ messages in thread
From: Julia Lawall @ 2019-10-24  7:58 UTC (permalink / raw)
  To: Markus Elfring
  Cc: cocci, linux-kernel, kernel-janitors, Cheng Shengyu,
	Gilles Muller, Masahiro Yamada, Michal Marek, Nicolas Palix,
	Yi Wang, Xue Zhihong, Zhong Shiqi

[-- Attachment #1: Type: text/plain, Size: 1193 bytes --]



On Thu, 24 Oct 2019, Markus Elfring wrote:

> > Second the commit log could be more concise as:
>
> I like your desire for choosing a more appropriate commit message.
>
>
> > Allow defining COCCI as a directory that contains .cocci files.
>
> I would prefer to concentrate the patch subject on other information.
>
>
> > In general, at least in simple cases, it is not necessary to mention the
> > name of the file you are modifying in the comit log, because one can see
> > that just below from looking at the diffstat and the patch.
>
> This view can be reasonable. - How does it fit to the usual requirement
> for the specification of a “subsystem” (or “prefix”) according to the
> canonical patch format?
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=13b86bc4cd648eae69fdcf3d04b2750c76350053#n656

Huh?  I was talking about the log message, not the subject line.  Likewise
"Allow defining..." was not proposed as a subject line, but as the log
message.  With that degree of orientation, I think one can look at the
code and figure out what the intent is.  At least if one knows the meaning
of -d.

julia

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [v2] coccicheck: support $COCCI being defined as a directory
  2019-10-24  7:58     ` Julia Lawall
@ 2019-10-24  9:11       ` Markus Elfring
  0 siblings, 0 replies; 6+ messages in thread
From: Markus Elfring @ 2019-10-24  9:11 UTC (permalink / raw)
  To: Julia Lawall, cocci
  Cc: linux-kernel, kernel-janitors, Cheng Shengyu, Gilles Muller,
	Masahiro Yamada, Michal Marek, Nicolas Palix, Yi Wang,
	Xue Zhihong, Zhong Shiqi

>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=13b86bc4cd648eae69fdcf3d04b2750c76350053#n656
>
> Huh?  I was talking about the log message, not the subject line.

Thanks for this clarification.


> With that degree of orientation, I think one can look at the code
> and figure out what the intent is.

The intention should become clear by reading the commit message
(combination of a subject and change description) alone already,
shouldn't it?

Regards,
Markus

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-10-24  9:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-24  6:04 [PATCH v2] coccicheck:support $COCCI being defined as a directory zhongshiqi
2019-10-24  6:19 ` Julia Lawall
2019-10-24  7:55   ` [PATCH v2] coccicheck: support " Markus Elfring
2019-10-24  7:58     ` Julia Lawall
2019-10-24  9:11       ` [v2] " Markus Elfring
2019-10-24  7:06 ` [PATCH v2] " Markus Elfring

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