poedit icon indicating copy to clipboard operation
poedit copied to clipboard

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

Open zdm opened this issue 2 years ago • 12 comments

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.

zdm avatar Jun 05 '22 03:06 zdm

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

vslavik avatar Jun 05 '22 06:06 vslavik

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.

zdm avatar Jun 05 '22 07:06 zdm

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 .

vslavik avatar Jun 05 '22 07:06 vslavik

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

zdm avatar Jun 05 '22 09:06 zdm

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.

vslavik avatar Jun 05 '22 09:06 vslavik

Hi @vslavik, I dont see @zdm bugging you, he just wants to know what is going to be the resolution for this, Even if you are undecided I can clearly see IMHO what is you preference.

If the content of the rest of the file is the same, does it make sense to update the "updated date" internally, when nothing has changed ? for me nope.

mauriciogracia avatar Jul 18 '22 15:07 mauriciogracia

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.

lanurmi avatar Oct 30 '22 22:10 lanurmi

@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.

vslavik avatar Oct 31 '22 14:10 vslavik

@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.

lanurmi avatar Nov 02 '22 13:11 lanurmi

Let;s close this issue, it is not actual anymore. Need to keep my issues list clean.

zdm avatar Jul 22 '23 11:07 zdm

Let's clos ethis. Ehat is the trason to collect tons of the garbage. Who will read this after a years has been passed. It just pollute my issues lost, I don;t like to see unfinisjed jaobs. If you want you can create this issue from your account.

zdm avatar Feb 21 '24 20:02 zdm

@zdm This is not your call to make. You created the issue asking me to spend time on it, you don't get to harass like this. That's incredibly disrespectful behavior.

vslavik avatar Feb 22 '24 09:02 vslavik