diff mbox series

[v3,6/9] po/git.pot: don't check in result of "make pot"

Message ID 20220523012531.4505-7-worldhello.net@gmail.com (mailing list archive)
State Superseded
Headers show
Series Incremental po/git.pot update and new l10n workflow | expand

Commit Message

Jiang Xin May 23, 2022, 1:25 a.m. UTC
From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>

Remove the "po/git.pot" file from being tracked, which started with
dce37b66fb0 (l10n: initial git.pot for 1.7.10 upcoming release,
2012-02-13).

The reason the po/git.pot started being checked in was because the
po/*.po files were changed a schema where we'd generate them from a
known-good snapshot of po/git.pot, instead of each translator running
"make pot" themselves.

This makes sense, but we don't need to carry this file in-tree just to
achieve that aim, and doing so has resulted in a significant amount of
"diff churn" since this method of doing it was introduced:

    $ git log -p --oneline -- po/git.pot|wc -l
    553743

We can instead let l10n contributors to generate "po/git.pot" in runtime
to update their own "po/XX.po", and the l10n coordinator can check
pull requests using CI pipeline.

This reverts to the schema introduced initially in cd5513a7168 (i18n:
Makefile: "pot" target to extract messages marked for translation,
2011-02-22).

The actual "git rm" of po/git.pot was in preceding commit to make this
change easier to review, and to preempt the mailing list from blocking
it due to it being too large.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Makefile      | 5 +++--
 po/.gitignore | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

Comments

Ævar Arnfjörð Bjarmason May 23, 2022, 7:26 a.m. UTC | #1
On Mon, May 23 2022, Jiang Xin wrote:

>  .PHONY: pot
>  pot: po/git.pot
> @@ -3319,6 +3319,7 @@ dist-doc: git$X
>  
>  distclean: clean
>  	$(RM) configure
> +	$(RM) po/git.pot

I think I noted "why not add this to clean?" in an earlier round, but
didn't think it through.

On second thought we should do that, but the reason is that "distclean"
should only clean things that you get if you do "make dist".

I.e. we add "configure" to a generated tarball, but not po/git.pot, so
this should just be under regular "clean", not "distclean".
Jiang Xin May 23, 2022, 8:30 a.m. UTC | #2
On Mon, May 23, 2022 at 3:27 PM Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
>
>
> On Mon, May 23 2022, Jiang Xin wrote:
>
> >  .PHONY: pot
> >  pot: po/git.pot
> > @@ -3319,6 +3319,7 @@ dist-doc: git$X
> >
> >  distclean: clean
> >       $(RM) configure
> > +     $(RM) po/git.pot
>
> I think I noted "why not add this to clean?" in an earlier round, but
> didn't think it through.
>
> On second thought we should do that, but the reason is that "distclean"
> should only clean things that you get if you do "make dist".
>
> I.e. we add "configure" to a generated tarball, but not po/git.pot, so
> this should just be under regular "clean", not "distclean".

Will remove "po/git.pot" under regular "clean" rule in next reroll. I
copied it from your original patch without thinking carefully.
Jiang Xin May 23, 2022, 8:35 a.m. UTC | #3
On Mon, May 23, 2022 at 4:30 PM Jiang Xin <worldhello.net@gmail.com> wrote:
>
> On Mon, May 23, 2022 at 3:27 PM Ævar Arnfjörð Bjarmason
> <avarab@gmail.com> wrote:
> >
> >
> > On Mon, May 23 2022, Jiang Xin wrote:
> >
> > >  .PHONY: pot
> > >  pot: po/git.pot
> > > @@ -3319,6 +3319,7 @@ dist-doc: git$X
> > >
> > >  distclean: clean
> > >       $(RM) configure
> > > +     $(RM) po/git.pot
> >
> > I think I noted "why not add this to clean?" in an earlier round, but
> > didn't think it through.
> >
> > On second thought we should do that, but the reason is that "distclean"
> > should only clean things that you get if you do "make dist".
> >
> > I.e. we add "configure" to a generated tarball, but not po/git.pot, so
> > this should just be under regular "clean", not "distclean".
>
> Will remove "po/git.pot" under regular "clean" rule in next reroll. I
> copied it from your original patch without thinking carefully.

Like this:

-- snip --
diff --git a/Makefile b/Makefile
index 3122672263..161ebf4ff3 100644
--- a/Makefile
+++ b/Makefile
@@ -3319,7 +3319,6 @@ dist-doc: git$X

 distclean: clean
        $(RM) configure
-       $(RM) po/git.pot
        $(RM) config.log config.status config.cache
        $(RM) config.mak.autogen config.mak.append
        $(RM) -r autom4te.cache
@@ -3333,6 +3332,7 @@ cocciclean:

 clean: profile-clean coverage-clean cocciclean
        $(RM) -r .build
+       $(RM) po/git.pot
        $(RM) *.res
        $(RM) $(OBJECTS)
        $(RM) $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB) $(REFTABLE_TEST_LIB)
-- snap --
Ævar Arnfjörð Bjarmason May 23, 2022, 9:28 a.m. UTC | #4
On Mon, May 23 2022, Jiang Xin wrote:

> On Mon, May 23, 2022 at 3:27 PM Ævar Arnfjörð Bjarmason
> <avarab@gmail.com> wrote:
>>
>>
>> On Mon, May 23 2022, Jiang Xin wrote:
>>
>> >  .PHONY: pot
>> >  pot: po/git.pot
>> > @@ -3319,6 +3319,7 @@ dist-doc: git$X
>> >
>> >  distclean: clean
>> >       $(RM) configure
>> > +     $(RM) po/git.pot
>>
>> I think I noted "why not add this to clean?" in an earlier round, but
>> didn't think it through.
>>
>> On second thought we should do that, but the reason is that "distclean"
>> should only clean things that you get if you do "make dist".
>>
>> I.e. we add "configure" to a generated tarball, but not po/git.pot, so
>> this should just be under regular "clean", not "distclean".
>
> Will remove "po/git.pot" under regular "clean" rule in next reroll. I
> copied it from your original patch without thinking carefully.

Yes, sorry about that. Just to be clear I didn't think this was an issue
you introduced. To be honest I thought it could be mine or yours, and
didn't dig to look into the history :)

I have no idea why I added it to distclean, and it doesn't make any
sense to me now, but oh well, as long as we fix it ... :)
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 70d5f41c3f..3122672263 100644
--- a/Makefile
+++ b/Makefile
@@ -2788,8 +2788,8 @@  endef
 	$(call mkdir_p_parent_template)
 	$(QUIET_GEN)$(gen_pot_header)
 
-po/git.pot: .build/pot/git.header $(LOCALIZED_ALL_GEN_PO) FORCE
-	$(QUIET_GEN)$(MSGCAT) $(MSGCAT_FLAGS) $(filter-out FORCE,$^) >$@
+po/git.pot: .build/pot/git.header $(LOCALIZED_ALL_GEN_PO)
+	$(QUIET_GEN)$(MSGCAT) $(MSGCAT_FLAGS) $^ >$@
 
 .PHONY: pot
 pot: po/git.pot
@@ -3319,6 +3319,7 @@  dist-doc: git$X
 
 distclean: clean
 	$(RM) configure
+	$(RM) po/git.pot
 	$(RM) config.log config.status config.cache
 	$(RM) config.mak.autogen config.mak.append
 	$(RM) -r autom4te.cache
diff --git a/po/.gitignore b/po/.gitignore
index 796b96d1c4..37d1301b32 100644
--- a/po/.gitignore
+++ b/po/.gitignore
@@ -1 +1,2 @@ 
 /build
+/git.pot