Jeff King <p...@peff.net> writes:

> Yes, 2^31-1 is probably a better number, but it's harder to write out. :)
>
> Here's what a patch might look like to implement "0". By still using
> xargs in the unlimited code path, it's not too bad. I dunno.



As somebody who is too used to run "diff -U999" and be happy, I
cannot claim that I care enough, but the result does not look
too bad.

>
> ---
> diff --git a/Makefile b/Makefile
> index daba958b8f..0765a59b7a 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -2792,7 +2792,12 @@ endif
>  
>  %.cocci.patch: %.cocci $(COCCI_SOURCES)
>       @echo '    ' SPATCH $<; \
> -     if ! echo $(COCCI_SOURCES) | xargs -n $(SPATCH_BATCH_SIZE) \
> +     if test $(SPATCH_BATCH_SIZE) = 0; then \
> +             limit=; \
> +     else \
> +             limit='-n $(SPATCH_BATCH_SIZE)'; \
> +     fi; \
> +     if ! echo $(COCCI_SOURCES) | xargs $$limit \
>               $(SPATCH) --sp-file $< $(SPATCH_FLAGS) \
>               >$@+ 2>$@.log; \
>       then \
>
> -Peff

Reply via email to