Skip to contentSkip to conversation

coccicheck: Allow for overriding spatch flags

PATCH In review Deepa Dinamani 4 participants 9 messages Jun 12, 2016 – Jun 20, 2016 Coccinelle/Semantic Patches (SmPL)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 coccicheck: Allow for overriding spatch flags

Documentation/coccinelle.txt suggests using the SPFLAGS make variable to pass additional options to spatch.

Reorder the way SPFLAGS is added to FLAGS, to allow for options in the SPFLAGS to override the default --very-quiet option.

Similarly, rearrage the FLAGS for org or report mode. This allows for overriding of the default --no-show-diff option through SPFLAGS.

Cc Julia Lawall <[email protected]>
Cc Gilles Muller <[email protected]>
Cc Nicolas Palix <[email protected]>
Cc Michal Marek <[email protected]>
---
 scripts/coccicheck | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/coccicheck +2 -2
index dd85a45..f662786 100755
@@ -25,7 +25,7 @@ else
 	NPROC="$J"
 fi
 
-FLAGS="$SPFLAGS --very-quiet"
+FLAGS="--very-quiet $SPFLAGS"
 
 # spatch only allows include directories with the syntax "-I include"
 # while gcc also allows "-Iinclude" and "-include include"
@@ -72,7 +72,7 @@ if [ "$MODE" = "chain" ] ; then
 	echo 'All available modes will be tried (in that order): patch, report, context, org'
     fi
 elif [ "$MODE" = "report" -o "$MODE" = "org" ] ; then
-    FLAGS="$FLAGS --no-show-diff"
+    FLAGS="--no-show-diff $FLAGS"
 fi
 
 if [ "$ONLINE" = "0" ] ; then
Signature · 1 line
1.9.1
#1 lore raw
Quoted 10 lines · Deepa Dinamani

Documentation/coccinelle.txt suggests using the SPFLAGS make variable to pass additional options to spatch.

Reorder the way SPFLAGS is added to FLAGS, to allow for options in the SPFLAGS to override the default --very-quiet option.

Similarly, rearrage the FLAGS for org or report mode. This allows for overriding of the default --no-show-diff option through SPFLAGS.

The first looks like a good idea, but do you find a use case for the second? The diff that is shown in org or report mode may be sort of random. It is just an easy hack to reuse the same pattern code for context, org, and report modes, but there isn't an intent to see the diff produced by context mode in org or report mode.

thanks,
julia

Quoted 35 lines
Cc Julia Lawall <[email protected]>
Cc Gilles Muller <[email protected]>
Cc Nicolas Palix <[email protected]>
Cc Michal Marek <[email protected]>
---
 scripts/coccicheck | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/coccicheck +2 -2
index dd85a45..f662786 100755
@@ -25,7 +25,7 @@ else
 	NPROC="$J"
 fi
 
-FLAGS="$SPFLAGS --very-quiet"
+FLAGS="--very-quiet $SPFLAGS"
 
 # spatch only allows include directories with the syntax "-I include"
 # while gcc also allows "-Iinclude" and "-include include"
@@ -72,7 +72,7 @@ if [ "$MODE" = "chain" ] ; then
 	echo 'All available modes will be tried (in that order): patch, report, context, org'
     fi
 elif [ "$MODE" = "report" -o "$MODE" = "org" ] ; then
-    FLAGS="$FLAGS --no-show-diff"
+    FLAGS="--no-show-diff $FLAGS"
 fi
 
 if [ "$ONLINE" = "0" ] ; then
Signature · 1 line
1.9.1
#2 lore raw
Quoted 11 lines
Quoted 10 lines

Documentation/coccinelle.txt suggests using the SPFLAGS make variable to pass additional options to spatch.

Reorder the way SPFLAGS is added to FLAGS, to allow for options in the SPFLAGS to override the default --very-quiet option.

Similarly, rearrage the FLAGS for org or report mode. This allows for overriding of the default --no-show-diff option through SPFLAGS.

Quoted 5 lines

The first looks like a good idea, but do you find a use case for the second? The diff that is shown in org or report mode may be sort of random. It is just an easy hack to reuse the same pattern code for context, org, and report modes, but there isn't an intent to see the diff produced by context mode in org or report mode.

I thought this at first, that org report mode wouldn't need it the diff. But if a user wishes to override the option, then why should we not accept that the user knows what they are doing?

-Deepa

#3 lore raw
Quoted 17 lines · Deepa Dinamani
Quoted 11 lines
Quoted 10 lines

Documentation/coccinelle.txt suggests using the SPFLAGS make variable to pass additional options to spatch.

Reorder the way SPFLAGS is added to FLAGS, to allow for options in the SPFLAGS to override the default --very-quiet option.

Similarly, rearrage the FLAGS for org or report mode. This allows for overriding of the default --no-show-diff option through SPFLAGS.

Quoted 5 lines

The first looks like a good idea, but do you find a use case for the second? The diff that is shown in org or report mode may be sort of random. It is just an easy hack to reuse the same pattern code for context, org, and report modes, but there isn't an intent to see the diff produced by context mode in org or report mode.

Quoted 3 lines

I thought this at first, that org report mode wouldn't need it the diff. But if a user wishes to override the option, then why should we not accept that the user knows what they are doing?

I guess... Another issue is that the org/report mode output comes from python, and the diff output comes from ocaml. They are not synchronized. Ie, the report won't come out next to the relevant diff.

julia

#4 lore raw
Quoted 17 lines
Quoted 17 lines
Quoted 16 lines
Quoted 10 lines

Documentation/coccinelle.txt suggests using the SPFLAGS make variable to pass additional options to spatch.

Reorder the way SPFLAGS is added to FLAGS, to allow for options in the SPFLAGS to override the default --very-quiet option.

Similarly, rearrage the FLAGS for org or report mode. This allows for overriding of the default --no-show-diff option through SPFLAGS.

The first looks like a good idea, but do you find a use case for the second? The diff that is shown in org or report mode may be sort of random. It is just an easy hack to reuse the same pattern code for context, org, and report modes, but there isn't an intent to see the diff produced by context mode in org or report mode.

Quoted 7 lines
Quoted 3 lines

I thought this at first, that org report mode wouldn't need it the diff. But if a user wishes to override the option, then why should we not accept that the user knows what they are doing?

I guess... Another issue is that the org/report mode output comes from python, and the diff output comes from ocaml. They are not synchronized. Ie, the report won't come out next to the relevant diff.

Ok. I was just thinking of user as the final authority because I was trying to get more
debug output for my script. And, yes I only wanted to override the --very-quiet. I just thought since --no-show-diff was a similar issue, it would be good to do the
same thing here.

Let me know if you want me to leave out the second rearrange and submit a v2.

-Deepa

#5 lore raw
Quoted 25 lines · Deepa Dinamani
Quoted 17 lines
Quoted 17 lines
Quoted 16 lines
Quoted 10 lines

Documentation/coccinelle.txt suggests using the SPFLAGS make variable to pass additional options to spatch.

Reorder the way SPFLAGS is added to FLAGS, to allow for options in the SPFLAGS to override the default --very-quiet option.

Similarly, rearrage the FLAGS for org or report mode. This allows for overriding of the default --no-show-diff option through SPFLAGS.

The first looks like a good idea, but do you find a use case for the second? The diff that is shown in org or report mode may be sort of random. It is just an easy hack to reuse the same pattern code for context, org, and report modes, but there isn't an intent to see the diff produced by context mode in org or report mode.

Quoted 7 lines
Quoted 3 lines

I thought this at first, that org report mode wouldn't need it the diff. But if a user wishes to override the option, then why should we not accept that the user knows what they are doing?

I guess... Another issue is that the org/report mode output comes from python, and the diff output comes from ocaml. They are not synchronized. Ie, the report won't come out next to the relevant diff.

Quoted 8 lines

Ok. I was just thinking of user as the final authority because I was trying to get more
debug output for my script. And, yes I only wanted to override the --very-quiet. I just thought since --no-show-diff was a similar issue, it would be good to do the
same thing here.

Let me know if you want me to leave out the second rearrange and submit a v2.

I think it doesn't hurt anything, if Nicolas is OK with it.

Thanks for noticing the --very-quiet issue.

julia

maintainer Acked-by on v1 1/1
#6 lore raw
In reply to Deepa Dinamani
Quoted 7 lines · Deepa Dinamani

Documentation/coccinelle.txt suggests using the SPFLAGS make variable to pass additional options to spatch.

Reorder the way SPFLAGS is added to FLAGS, to allow for options in the SPFLAGS to override the default --very-quiet option.

Quoted 8 lines

Similarly, rearrage the FLAGS for org or report mode. This allows for overriding of the default --no-show-diff option through SPFLAGS.

Cc Julia Lawall <[email protected]>
Cc Gilles Muller <[email protected]>
Cc Nicolas Palix <[email protected]>
Quoted 28 lines
Cc Michal Marek <[email protected]>
---
 scripts/coccicheck | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/coccicheck +2 -2
index dd85a45..f662786 100755
@@ -25,7 +25,7 @@ else
 	NPROC="$J"
 fi
 
-FLAGS="$SPFLAGS --very-quiet"
+FLAGS="--very-quiet $SPFLAGS"
 
 # spatch only allows include directories with the syntax "-I include"
 # while gcc also allows "-Iinclude" and "-include include"
@@ -72,7 +72,7 @@ if [ "$MODE" = "chain" ] ; then
 	echo 'All available modes will be tried (in that order): patch, report, context, org'
     fi
 elif [ "$MODE" = "report" -o "$MODE" = "org" ] ; then
-    FLAGS="$FLAGS --no-show-diff"
+    FLAGS="--no-show-diff $FLAGS"
 fi
 
 if [ "$ONLINE" = "0" ] ; then
Signature · 2 lines
Nicolas Palix
http://lig-membres.imag.fr/palix/
Acked-by
#7 lore raw
Quoted 12 lines · Nicolas Palix (LIG)
Quoted 11 lines · Deepa Dinamani

Documentation/coccinelle.txt suggests using the SPFLAGS make variable to pass additional options to spatch.

Reorder the way SPFLAGS is added to FLAGS, to allow for options in the SPFLAGS to override the default --very-quiet option.

Similarly, rearrage the FLAGS for org or report mode. This allows for overriding of the default --no-show-diff option through SPFLAGS.

Quoted 5 lines
Quoted 4 lines
Cc Julia Lawall <[email protected]>
Cc Gilles Muller <[email protected]>
Cc Nicolas Palix <[email protected]>
Quoted 36 lines
Quoted 29 lines
Cc Michal Marek <[email protected]>
---
 scripts/coccicheck | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/coccicheck +1 -1
index dd85a45..f662786 100755
@@ -25,7 +25,7 @@ else
 	NPROC="$J"
 fi
 
-FLAGS="$SPFLAGS --very-quiet"
+FLAGS="--very-quiet $SPFLAGS"
 
 # spatch only allows include directories with the syntax "-I include"
 # while gcc also allows "-Iinclude" and "-include include"
@@ -72,7 +72,7 @@ if [ "$MODE" = "chain" ] ; then
 	echo 'All available modes will be tried (in that order): patch,

report, context, org'
fi
elif [ "$MODE" = "report" -o "$MODE" = "org" ] ; then

scripts/coccicheck +1 -1
-    FLAGS="$FLAGS --no-show-diff"
+    FLAGS="--no-show-diff $FLAGS"
 fi
 
 if [ "$ONLINE" = "0" ] ; then
Signature · 2 lines
Nicolas Palix
http://lig-membres.imag.fr/palix/
#8 lore raw
Quoted 16 lines · Julia Lawall
Quoted 12 lines · Nicolas Palix (LIG)
Quoted 11 lines · Deepa Dinamani

Documentation/coccinelle.txt suggests using the SPFLAGS make variable to pass additional options to spatch.

Reorder the way SPFLAGS is added to FLAGS, to allow for options in the SPFLAGS to override the default --very-quiet option.

Similarly, rearrage the FLAGS for org or report mode. This allows for overriding of the default --no-show-diff option through SPFLAGS.

Quoted 7 lines
Quoted 5 lines
Quoted 4 lines
Cc Julia Lawall <[email protected]>
Cc Gilles Muller <[email protected]>
Cc Nicolas Palix <[email protected]>

Applied to kbuild.git#misc.

Michal