-
Notifications
You must be signed in to change notification settings - Fork 266
Make merge #1825
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
Make merge #1825
Conversation
Haha. Haha. Fsck. My We should have worked on AFPy/powrap#76 sooner... |
This is very bad, it mean that constributors will randomly have the old or the new wrapping behavior, either via poedit or via powrap ☹ |
I bet not wrapping at all is not an option: proofreading in github would be made impossible? |
OK, I'm lacking context. What are the different relationships between powrap, msgcat, GitHub and Poedit? |
So if gettext changes, powrap changes, and gettext changes, which looks good at first glance. But if half of the contributors do use an old version, and half do use a new version, which will happen for many years, we'll have "diff battles": user1 commits with an old wrapping, user2 edits the file and commits with a new wrapping, user3 edits and commits with an old wrapping ... leading to an unreadable git log (where true edits are hidden in a gigantic mess of rewrapping). The relationship with github now: if we stop wrapping, I bet ... oh let me test. a few minutes later mandatory escalator music OK, I pushed a version with I see a single decent solution: Stop enforcing a common strict wrapping as it does no longer exists anyway (different poedit version will probably soon wrap differently), just enforce a mere "configure your editor to wrap around the 79th column". And for readability of the git log, enforce at PR proofreading time, manually, a rule like "in a commit, there should not be edits on line you have not modified", meaning "do not rewrap what you have not touched", or in other words "if you edit a single typo I want to see a single diff, not a whole file rewrapped". Another solution would be to work on AFPy/powrap#76 so "powrap is the only true wrapping", but it's bad: it would force everyone to use powrap, even people that previously had a good wrapping (users of poedit), which is not nice for them (powrap was here so contributors not using poedit have the same wrapping as users using it, so in reality only a few users had to use powrap). |
Gosh, what a headache. Do you have information on the change on the Gettext side that is causing the new wrapping? Is it possible to ask everyone to install the new version?
Maybe we can promote the use of powrap in a Git pre-commit hook so that it won't be a burden on people not using Poedit? That way, if powrap uses a consistent algorithm from polib, we should be fine.
… Le 19 mars 2022 à 08:49, Julien Palard ***@***.***> a écrit :
What are the different relationships between powrap, msgcat, GitHub and Poedit?
powrap is a small Python wrapper using msgcat to wrap po files.
msgcat do use a library (from the gettext project) to wrap text.
gettext IIRC use the same library from the gettext project to wrap text.
So if gettext changes, powrap changes, and gettext changes, which looks good at first glance.
But if half of the contributors do use an old version, and half do use a new version, which will happen for many years, we'll have "diff battles": user1 commits with an old wrapping, user2 edits the file and commits with a new wrapping, user3 edits and commits with an old wrapping ... leading to an unreadable git log (where true edits are hidden in a gigantic mess of rewrapping).
The relationship with github now: if we stop wrapping, I bet ... oh let me test.
a few minutes later
mandatory escalator music
OK, I pushed a version with --no-wrap (in this same PR), just click the files changed and try to review the PR, it's highly inconvenient: most paragraphs overflow the screen, forcing to scroll horizontally a lot to read them:
I see a single decent solution: Stop enforcing a common strict wrapping as it does no longer exists anyway (different poedit version will probably soon wrap differently), just enforce a mere "configure your editor to wrap around the 79th column". And for readability of the git log, enforce at PR proofreading time, manually, a rule like "in a commit, there should not be edits on line you have not modified", meaning "do not rewrap what you have not touched", or in other words "if you edit a single typo I want to see a single diff, not a whole file rewrapped".
Another solution would be to work on AFPy/powrap#76 so "powrap is the only true wrapping", but it's bad: it would force everyone to use powrap, even people that previously had a good wrapping (users of poedit), which is not nice for them (powrap was here so contributors not using poedit have the same wrapping as users using it, so in reality only a few users had to use powrap).
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you commented.
|
Whoops, 'not using poedit' -> 'using poedit'
… Le 19 mars 2022 à 10:57, Jean Abou Samra ***@***.***> a écrit :
Gosh, what a headache. Do you have information on the change on the Gettext side that is causing the new wrapping? Is it possible to ask everyone to install the new version?
Maybe we can promote the use of powrap in a Git pre-commit hook so that it won't be a burden on people not using Poedit? That way, if powrap uses a consistent algorithm from polib, we should be fine.
> Le 19 mars 2022 à 08:49, Julien Palard ***@***.***> a écrit :
>
> What are the different relationships between powrap, msgcat, GitHub and Poedit?
>
> powrap is a small Python wrapper using msgcat to wrap po files.
> msgcat do use a library (from the gettext project) to wrap text.
> gettext IIRC use the same library from the gettext project to wrap text.
> So if gettext changes, powrap changes, and gettext changes, which looks good at first glance.
>
> But if half of the contributors do use an old version, and half do use a new version, which will happen for many years, we'll have "diff battles": user1 commits with an old wrapping, user2 edits the file and commits with a new wrapping, user3 edits and commits with an old wrapping ... leading to an unreadable git log (where true edits are hidden in a gigantic mess of rewrapping).
>
> The relationship with github now: if we stop wrapping, I bet ... oh let me test.
>
> a few minutes later
>
> mandatory escalator music
>
> OK, I pushed a version with --no-wrap (in this same PR), just click the files changed and try to review the PR, it's highly inconvenient: most paragraphs overflow the screen, forcing to scroll horizontally a lot to read them:
>
>
>
> I see a single decent solution: Stop enforcing a common strict wrapping as it does no longer exists anyway (different poedit version will probably soon wrap differently), just enforce a mere "configure your editor to wrap around the 79th column". And for readability of the git log, enforce at PR proofreading time, manually, a rule like "in a commit, there should not be edits on line you have not modified", meaning "do not rewrap what you have not touched", or in other words "if you edit a single typo I want to see a single diff, not a whole file rewrapped".
>
> Another solution would be to work on AFPy/powrap#76 so "powrap is the only true wrapping", but it's bad: it would force everyone to use powrap, even people that previously had a good wrapping (users of poedit), which is not nice for them (powrap was here so contributors not using poedit have the same wrapping as users using it, so in reality only a few users had to use powrap).
>
> —
> Reply to this email directly, view it on GitHub, or unsubscribe.
> Triage notifications on the go with GitHub Mobile for iOS or Android.
> You are receiving this because you commented.
|
It would work, yes. But powrap started as a tool to help 10% of contributors and if we go this way it'll end mandatory for everyone, feel strange, and it reminds me the quote:
I'd prefer to be lax: as long as the wrapping is OKish, and the diff is readable, it's OK. Also I prefer removing a step in the contribution path that adding one. But there's a catch: if someone have a poedit configured to not preserve the existing wrapping (which is not the default fortunately), he can make a commit with many unwanted edits mixed with real edits, and it'll be a PITA to fix. |
OTOH, setting up a pre-commit hook is a one-time thing. If Contributing.rst gives the command to do it, it shouldn't be too much of a burden among the other tasks (cloning cpython etc).
Another idea: tweak PyDocTeur so that it runs powrap right before merging. Then the tree remains consistent at all times. If there are a few unwanted diffs in a PR, it can be left as is, pydocteur'll fix it. If there are many of them, we run powrap as is done at the moment. That should reduce the need for running powrap manually from 'after every change, including applying suggestions on GitHub' to 'from time to time in the case of an unreadable diff'.
… Le 19 mars 2022 à 11:15, Julien Palard ***@***.***> a écrit :
Maybe we can promote the use of powrap in a Git pre-commit hook so that it won't be a burden on people not using Poedit? That way, if powrap uses a consistent algorithm from polib, we should be fine.
It would work, yes. But powrap started as a tool to help 10% of contributors and if we go this way it'll end mandatory for everyone, feel strange, and it reminds me the quote:
A foolish consistency is the hobgoblin of little minds.
I'd prefer to be lax: as long as the wrapping is OKish, and the diff is readable, it's OK.
Also I prefer removing a step in the contribution path that adding one.
But there's a catch: if someone have a poedit configured to not preserve the existing wrapping (which is not the default fortunately), he can make a commit with many unwanted edits mixed with real edits, and it'll be a PITA to fix.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you commented.
|
Yes, it's easy for us all, but for newcomers it mean many prerequisites (a shell, a venv, understanding where powrap gets installed, let alone trying this on Windows with users using a graphical git client and poedit).
It was the initial motivation for creating PyDocTeur and we never get to this point, as if it was forgotten en route. The only drawback is that the commit get modified (commit signature are not important at all in this repo, but still they would be lost). |
draft comment, Feel free to amend, complete… Let's sum up if i understand right. issue: proposed evolutions for python-docs-fr:
|
I see. I had always wondered what PyDocTeur was for given that our CI is not
I thought commit IDs were already changed due to squash-merging? |
That's right, but I don't know if, in the case there's a single fast-forward commit, github use it directly (keeping the signature) or not. But we don't really care :D |
I don't think it does, given that by default the commit title has the PR number appended at the end (which means the commit message, and hence the hash, changes). At any rate, yes, I think it's safe to say nobody cares. |
Problem is: gettext changed it line wrapping algorithm, so we can no longer rely on everyone having the same wrapping: some will still get the old one for a very long time, while other will have the new one.
I'm trying to replace the powrap workflow with a simple one just checking that we don't have lines > 80 chars. |
awk ftw!
|
On merge ? |
Je pense qu'on peut y aller, oui. Tant qu'il n'y a personne pour bosser sur powrap et PyDocTeur, autant ne pas bloquer les traducteurs quitte à avoir quelques diffs plus gros que la norme. |
Hello @JulienPalard ! Désolé, mais ton titre de pull request me semble invalide par rapport à ce que je suis programmé d'accepter. DisclaimerJe suis un robot fait par l'équipe de l'AFPy et de Traduction I'm a bot made by the Translation and AFPy teams on their free (state: incorrect_title) |
@JulienPalard Je ne sais pas par quelle méthode tu préfères merger ce genre de PR (squash ou non), je te laisse faire. |
Hello @JulienPalard ! Désolé, mais ton titre de pull request me semble invalide par rapport à ce que je suis programmé d'accepter. DisclaimerJe suis un robot fait par l'équipe de l'AFPy et de Traduction I'm a bot made by the Translation and AFPy teams on their free (state: incorrect_title) |
ON Y EST PRESQUE ! Un p'tit label DisclaimerJe suis un robot fait par l'équipe de l'AFPy et de Traduction I'm a bot made by the Translation and AFPy teams on their free (state: approved) |
I just ran
python merge.py 3.10
, nothing less, nothing more.I lied, I also ran
git push
.But wow, wrapping algorithm changed! Please let me the time to review this before merging.