All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cocci] Perforce support, or generating list of files that would be changed?
@ 2018-07-26 19:52 Timur Tabi
  2018-07-26 20:26 ` Julia Lawall
  0 siblings, 1 reply; 5+ messages in thread
From: Timur Tabi @ 2018-07-26 19:52 UTC (permalink / raw)
  To: cocci

I need to run the "p4 edit" command before spatch can modify any file.
Is there a way to do either of the following:

1. Provide a list of files that "spatch --in-place --dir ." would edit
2. Have spatch run the "p4 edit" command on a file before changing it

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

* [Cocci] Perforce support, or generating list of files that would be changed?
  2018-07-26 19:52 [Cocci] Perforce support, or generating list of files that would be changed? Timur Tabi
@ 2018-07-26 20:26 ` Julia Lawall
  2018-07-26 20:38   ` Timur Tabi
  0 siblings, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2018-07-26 20:26 UTC (permalink / raw)
  To: cocci



On Thu, 26 Jul 2018, Timur Tabi wrote:

> I need to run the "p4 edit" command before spatch can modify any file.
> Is there a way to do either of the following:
>
> 1. Provide a list of files that "spatch --in-place --dir ." would edit

I'm not sure to understand what you are asking for here.

> 2. Have spatch run the "p4 edit" command on a file before changing it

I don't think so.  Maybe you could make a script to do this.

julia

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

* [Cocci] Perforce support, or generating list of files that would be changed?
  2018-07-26 20:26 ` Julia Lawall
@ 2018-07-26 20:38   ` Timur Tabi
  2018-07-26 20:42     ` Julia Lawall
  0 siblings, 1 reply; 5+ messages in thread
From: Timur Tabi @ 2018-07-26 20:38 UTC (permalink / raw)
  To: cocci

On Thu, Jul 26, 2018 at 3:26 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:

>> 1. Provide a list of files that "spatch --in-place --dir ." would edit
>
> I'm not sure to understand what you are asking for here.

So when I run "spatch --in-place --dir .", spatch run my cocci script
on a bunch of files, but not all of them will need to be changed.  For
some, there won't be a match.

I would like a list of files that spatch *would* change in this
situation.  Something like "spatch --list-only", so I can do this:

$ p4 edit `spatch --sp-file nvprintf.cocci --in-place --list-only --dir .`
$ spatch --sp-file nvprintf.cocci --in-place --list-only --dir .

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

* [Cocci] Perforce support, or generating list of files that would be changed?
  2018-07-26 20:38   ` Timur Tabi
@ 2018-07-26 20:42     ` Julia Lawall
  2018-07-27 20:52       ` Timur Tabi
  0 siblings, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2018-07-26 20:42 UTC (permalink / raw)
  To: cocci



On Thu, 26 Jul 2018, Timur Tabi wrote:

> On Thu, Jul 26, 2018 at 3:26 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>
> >> 1. Provide a list of files that "spatch --in-place --dir ." would edit
> >
> > I'm not sure to understand what you are asking for here.
>
> So when I run "spatch --in-place --dir .", spatch run my cocci script
> on a bunch of files, but not all of them will need to be changed.  For
> some, there won't be a match.
>
> I would like a list of files that spatch *would* change in this
> situation.  Something like "spatch --list-only", so I can do this:
>
> $ p4 edit `spatch --sp-file nvprintf.cocci --in-place --list-only --dir .`
> $ spatch --sp-file nvprintf.cocci --in-place --list-only --dir .

Coccinelle can make a list of relevant files, but there is not a guarantee
that the rule will actually match on those files.  The option is
--selected-only.

julia

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

* [Cocci] Perforce support, or generating list of files that would be changed?
  2018-07-26 20:42     ` Julia Lawall
@ 2018-07-27 20:52       ` Timur Tabi
  0 siblings, 0 replies; 5+ messages in thread
From: Timur Tabi @ 2018-07-27 20:52 UTC (permalink / raw)
  To: cocci

On Thu, Jul 26, 2018 at 3:42 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> Coccinelle can make a list of relevant files, but there is not a guarantee
> that the rule will actually match on those files.  The option is
> --selected-only.

Thanks, that works.  I also discovered that this works:

spatch --very-quiet --dir .   | lsdiff --strip 1

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

end of thread, other threads:[~2018-07-27 20:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-26 19:52 [Cocci] Perforce support, or generating list of files that would be changed? Timur Tabi
2018-07-26 20:26 ` Julia Lawall
2018-07-26 20:38   ` Timur Tabi
2018-07-26 20:42     ` Julia Lawall
2018-07-27 20:52       ` Timur Tabi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.