From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 5E8AB1F9FC for ; Sun, 28 Mar 2021 05:58:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230517AbhC1F5D (ORCPT ); Sun, 28 Mar 2021 01:57:03 -0400 Received: from pb-smtp20.pobox.com ([173.228.157.52]:61903 "EHLO pb-smtp20.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229538AbhC1F4d (ORCPT ); Sun, 28 Mar 2021 01:56:33 -0400 Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id B04F1117285; Sun, 28 Mar 2021 01:56:32 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=mhowdm8k+6YW tW6f5oXN7rdrr10=; b=Jwa7h/VG76ocsStYollz9+i6I+oZ7pJDk8MtQQ5qZJsz iXOnoHQBoXfcGzUGungulwGcpRQDZe5JV0wXCGd70r4sxzNh6oiQeALyWoFEd7fo ET372O+hIklX2NLotWt+9zO5el9vUAXY9R90C2jhZGPgLpfXdZYDdzirMwRydow= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=sasl; b=oJsVzO AvuDQ7kP1jvDRfY2Bjfrv3QnNfoqA+9db87xuIMtAu4Glv+8gfY83NvWNWEjWWQ+ jZJETcutRLspjCk/iI2H6CGSHrPJANK3ahtKlEhER5y4r87fNkVUKxz1UxF3E1Uy b9zi2cFBAPwmxTxhjr0a4aLcDuuxRzGABjGfM= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 9C559117284; Sun, 28 Mar 2021 01:56:32 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [34.74.119.39]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id D884B11727A; Sun, 28 Mar 2021 01:56:29 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason Cc: git@vger.kernel.org Subject: Re: [PATCH] Makefile: add QUIET_GEN to "tags" and "TAGS" targets References: Date: Sat, 27 Mar 2021 22:56:28 -0700 In-Reply-To: (=?utf-8?B?IsOGdmFyCUFybmZqw7Zyw7A=?= Bjarmason"'s message of "Sun, 28 Mar 2021 04:18:34 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Pobox-Relay-ID: 575EB970-8F8A-11EB-AB16-E43E2BB96649-77302942!pb-smtp20.pobox.com Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org =C3=86var Arnfj=C3=B6r=C3=B0 Bjarmason writes: > Don't show the very verbose $(FIND_SOURCE_FILES) command on every > "make TAGS" invocation. Let's also use the "cmd >x+ && mv x+ x" > pattern here so we don't momentarily clobber the file. We do not "redirect" ctags and etags output into x+. =20 Let's use "generate into temporary and rename to the final after seeing the command that generated the output finished successfully" pattern. Please also correct the explanation of why it is a good idea to use the pattern in this case. It is not about avoiding momentarily clobbering the output. It is to avoid leaving an incorrect output generated by a failed command in the file with the filename that consumers expect. Thanks for making our Makefile a bit less noisy. Anybody who makes "clean" and its friends quiet will get a gold star ;-) > Signed-off-by: =C3=86var Arnfj=C3=B6r=C3=B0 Bjarmason > --- > Makefile | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/Makefile b/Makefile > index 55c8035fa80..f317af1b602 100644 > --- a/Makefile > +++ b/Makefile > @@ -2690,12 +2690,15 @@ FIND_SOURCE_FILES =3D ( \ > ) > =20 > $(ETAGS_TARGET): FORCE > - $(RM) $(ETAGS_TARGET) > - $(FIND_SOURCE_FILES) | xargs etags -a -o $(ETAGS_TARGET) > + echo $(ALL_SOURCE_FILES) > + $(QUIET_GEN)$(RM) "$(ETAGS_TARGET)+" && \ > + $(FIND_SOURCE_FILES) | xargs etags -a -o "$(ETAGS_TARGET)+" && \ > + mv "$(ETAGS_TARGET)+" "$(ETAGS_TARGET)" > =20 > tags: FORCE > - $(RM) tags > - $(FIND_SOURCE_FILES) | xargs ctags -a > + $(QUIET_GEN)$(RM) tags+ && \ > + $(FIND_SOURCE_FILES) | xargs ctags -a -o tags+ && \ > + mv tags+ tags > =20 > cscope: > $(RM) cscope*