Subject: Re: [PATCH v4 3/9] Makefile: have "make pot" not "reset --hard"

From: Junio C Hamano <[email-masked]>
Date: Wed, 25 May 2022 15:24:12 -0700

Junio C Hamano <[email-masked]> writes:

> Jiang Xin <[email-masked]> writes:
>
>>  ## Gettext tools cannot work with our own custom PRItime type, so
>>  ## we replace PRItime with PRIuMAX.  We need to update this to
>>  ## PRIdMAX if we switch to a signed type later.
>> +$(LOCALIZED_C_GEN_PO): .build/pot/po/%.po: %
>> +	$(call mkdir_p_parent_template)
>> +	$(QUIET_XGETTEXT) \
>> +	    if grep -q PRItime $<; then \
>> +		(\
>> +			sed -e 's|PRItime|PRIuMAX|g' <$< \
>> +				>.build/pot/po/$< && \
>> +			cd .build/pot/po && \
>> +			$(XGETTEXT) --omit-header \
>> +				-o $(@:.build/pot/po/%=%) \
>> +				$(XGETTEXT_FLAGS_C) $< && \
>> +			rm $<; \
>> +		); \
>> +	    else \
>> +		$(XGETTEXT) --omit-header \
>> +			-o $@ $(XGETTEXT_FLAGS_C) $<; \
>> +	    fi
>
> My build (a random hack on top of 'seen') is getting this message
>
> $ make
> Makefile:2755: target '.build/pot/po/archive.c.po' given more than once in the same rule
> Makefile:2755: target '.build/pot/po/archive.c.po' given more than once in the same rule
>     SUBDIR git-gui
>
> I haven't changed archive.c in particular relative to 'seen', and
> .build/pot/po directory seems to be empty (understandably---I have
> not run the po/ stuff myself lately).

Well, I lied.  I am doing the random hack while in a conflicted
state coming from an interrupted merge that had conflicts in the
archive.c.

Perhaps we need some logic to dedup "ls-files" output?