Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not update POT-Creation-Date header if nothing else changes #757

Open
zdm opened this issue Jun 5, 2022 · 12 comments
Open

Do not update POT-Creation-Date header if nothing else changes #757

zdm opened this issue Jun 5, 2022 · 12 comments

Comments

@zdm
Copy link

zdm commented Jun 5, 2022

Is it possible to not update POT-Creation-Date header on every update from source if no updates were made?
This is mark file as modified for git and pollute repository with the same content versions.
POT-Creation-Date header must be updated only when content was really updated, not just re-scanned.

@vslavik vslavik changed the title Do not update POT-Creation-Date header Do not update POT-Creation-Date header if nothing else changes Jun 5, 2022
@vslavik
Copy link
Owner

vslavik commented Jun 5, 2022

POT-Creation-Date header must be updated only when content was really updated, not just re-scanned.

That's some strong language 😳 The POT-Creation-Date header (which is generated by xgettext, not Poedit as such) has explicit purpose: to mark to the date the POT file was updated, i.e. the date to which the file is up to date w.r.t. the source code. You could equally say it must be updated, by its specification.

It is not obvious which behavior is better. On one hand, (1) VCS noise is annoying. On the other, (2) the "this PO file is current as of this date" information has value for translators and maintainers too. It is not immediately obvious to me that (1) is more important than (2) [to be explicit: this is not saying that it isn't, just that it isn't obvious to me and need to think about it].

For completeness' sake, it's worth mentioning that in non-automated contexts, the fix for (1) is as simple as either not running update from source or discarding the trivial diff when you review your changes before committing them. But that changes if you e.g. do it through the manager to many PO files at once, of course.

Anyway, I'm happy to consider any patches on the subject.

Some relevant GNU gettext issues:
https://savannah.gnu.org/bugs/?59658
https://savannah.gnu.org/bugs/?49654

@zdm
Copy link
Author

zdm commented Jun 5, 2022

I am not a native English carrier, and always forget the difference between must and should. Sorry, if it was offensive for you.

Obvious, that if the content wasn't updated - update date shouldn't ( not must not )) ) be touched.

@vslavik
Copy link
Owner

vslavik commented Jun 5, 2022

Sorry, if it was offensive for you.

Not at all, I'm just saying that "must" is a strong statement. The bigger point is that even "should" may be, because it isn't 100% obvious .

@zdm
Copy link
Author

zdm commented Jun 5, 2022

So, what is the decision?
Let's close this issue if code will stay as is.

@vslavik
Copy link
Owner

vslavik commented Jun 5, 2022

If you want a quick resolution, submit a PR. I explicitly told you that I am unsure what to do, so please don't bug me to hurry.

@mauriciogracia

This comment was marked as off-topic.

@lanurmi
Copy link
Contributor

lanurmi commented Oct 30, 2022

One could argue that updating .po files in an automated fashion and committing the result in it self generates VCS noise – so should it be done in the first place? Even when there is something to update, the update is not inherently related to a particular translation, and so the VCS history of a .po is polluted with automatic changes not made by a human. And those are indeed changes that make no difference when actually using the translation.

@vslavik
Copy link
Owner

vslavik commented Oct 31, 2022

@lanurmi Sorry for being thick, but is your argument for or against doing what the OP suggests?

and so the VCS history of a .po is polluted with automatic changes not made by a human

I was going to say that presumably the header would be the only change, otherwise git wouldn't include the file, hence this issue, but that's not actually true - typically, there would be significant changes in file references as line numbers in code change during development.

@lanurmi
Copy link
Contributor

lanurmi commented Nov 2, 2022

@lanurmi Sorry for being thick, but is your argument for or against doing what the OP suggests?

More against it, though I understand OP's point of view too.

and so the VCS history of a .po is polluted with automatic changes not made by a human

I was going to say that presumably the header would be the only change, otherwise git wouldn't include the file, hence this issue, but that's not actually true - typically, there would be significant changes in file references as line numbers in code change during development.

My main point was, if some automatic changes are polluting git log, maybe it's worth taking a step back and rethinking if such automated commits are the right thing to do in the first place for OP. Or whether the problem can be solved by a trivial shell script one-liner instead of changing Poedit.

And since this is Poedit we are talking about; if OP is manually updating from POT and manually committing everything regardless of the output, I doubt that's the best way to use git in general.

@zdm

This comment was marked as off-topic.

@zdm zdm closed this as completed Jul 22, 2023
@vslavik vslavik reopened this Jul 22, 2023
@zdm

This comment was marked as off-topic.

@zdm zdm closed this as completed Feb 21, 2024
@vslavik

This comment was marked as off-topic.

@vslavik vslavik reopened this Feb 22, 2024
Repository owner locked and limited conversation to collaborators Feb 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants