From: Junio C Hamano <gitster@pobox.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Makefile: add QUIET_GEN to "tags" and "TAGS" targets
Date: Wed, 31 Mar 2021 14:20:18 -0700 [thread overview]
Message-ID: <xmqq5z176mwd.fsf@gitster.g> (raw)
In-Reply-To: <xmqqpmzjom7n.fsf@gitster.g> (Junio C. Hamano's message of "Sat, 27 Mar 2021 22:56:28 -0700")
Junio C Hamano <gitster@pobox.com> writes:
> Ævar Arnfjörð Bjarmason <avarab@gmail.com> 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+.
>
> 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: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
>> ---
>> 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 = ( \
>> )
>>
>> $(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)"
>>
>> 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
>>
>> cscope:
>> $(RM) cscope*
prev parent reply other threads:[~2021-03-31 21:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-28 2:18 [PATCH] Makefile: add QUIET_GEN to "tags" and "TAGS" targets Ævar Arnfjörð Bjarmason
2021-03-28 5:56 ` Junio C Hamano
2021-03-31 21:20 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq5z176mwd.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).