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-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,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 8337A1F4B4 for ; Wed, 31 Mar 2021 21:21:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229624AbhCaVUt (ORCPT ); Wed, 31 Mar 2021 17:20:49 -0400 Received: from pb-smtp21.pobox.com ([173.228.157.53]:59979 "EHLO pb-smtp21.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229497AbhCaVUY (ORCPT ); Wed, 31 Mar 2021 17:20:24 -0400 Received: from pb-smtp21.pobox.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 5EA3A1241C2; Wed, 31 Mar 2021 17:20:23 -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=eXSwmlrwcPcG +6EHElkotsBlfbY=; b=PQpPXsIZ2CXK5RdtWeCgW/v5cDZtCbmHd8UVryZ0D+Ct CGo4ynGgbQ0qWNQwiFV8MkIbG+QfJCxBISTcIc5cWQcGa0AggGUEKCORKy90NfXg Lj5vDkjxi1rmHUvXVQ9/RpN7CiZq+QQnQO8ThJmyQShRncJv72HfdL239l5PvsA= 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=P7lmn7 jjU5QvGcy8KIHwnkqAXa5US8KNReLSxMN5haVyCt17Q6SuxxHsGxgS2kz+n9P3+g gBrm6aAdTELnOsf4BrhijVv21y8J+rBRdFPbX0iZM/EJhZsJ/NxkCxbhImpMdg/P s5Ab1HjaCrJNCvEwThYG67nYBXhYhka6N+KgQ= Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 5762E1241C1; Wed, 31 Mar 2021 17:20:23 -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-smtp21.pobox.com (Postfix) with ESMTPSA id 891051241BB; Wed, 31 Mar 2021 17:20:20 -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: Wed, 31 Mar 2021 14:20:18 -0700 In-Reply-To: (Junio C. Hamano's message of "Sat, 27 Mar 2021 22:56:28 -0700") 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: E5DD8A26-9266-11EB-918D-D609E328BF65-77302942!pb-smtp21.pobox.com Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Junio C Hamano writes: > =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) This echo I presume is a debugging aid to be removed? >> + $(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*