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

php 8.1 compatibility #711

Closed
wants to merge 1 commit into from
Closed

php 8.1 compatibility #711

wants to merge 1 commit into from

Conversation

thirsch
Copy link
Contributor

@thirsch thirsch commented Jan 18, 2022

This pr contains all changes from #678 except for the IntlDateTime related stuff. I only kept the change from strftime to date in internal functions.

@PierreRambaud
Copy link

If it contains all changes, maybe you can keep the commit history, at least for the contributor who did the original PR 😉

@thirsch
Copy link
Contributor Author

thirsch commented Jan 18, 2022

If it contains all changes, maybe you can keep the commit history, at least for the contributor who did the original PR 😉

If you can tell me, how to do that, I would be happy to keep the author. The only thing I know is cherry picking. But as there are some changes in at least two commits we don't want to keep, I'm not sure to achieve it. I could cherry pick two of the four changes without any required modifications. Seemed to be much less effort to me to simply copy the changes. But if there is an easy way, I'd be happy for an advice.

@PierreRambaud
Copy link

If it contains all changes, maybe you can keep the commit history, at least for the contributor who did the original PR wink

If you can tell me, how to do that, I would be happy to keep the author. The only thing I know is cherry picking. But as there are some changes in at least two commits we don't want to keep, I'm not sure to achieve it. I could cherry pick two of the four changes without any required modifications. Seemed to be much less effort to me to simply copy the changes. But if there is an easy way, I'd be happy for an advice.

You can retrieve the branch with hub pr checkout 678, then cherry-pick commits.
If you want to squash commits, use git rebase -i

@@ -196,8 +196,8 @@ public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $e
*/
public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached)
{
clearstatcache(true, $cached->lock_id);
if (is_file($cached->lock_id)) {
clearstatcache(true, $cached->lock_id ?? '');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you probably don't want to call clearstatcache with empty filename. it's performance killer to clear all cache and looking at the immediate code around this call, doesn't seem you need "clear all cache"

perhaps re-evaluate clearstatcache usage at all, as it's not cached for inexistent files and unlink invalidates automatically:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, I believe this change should be extracted to own pull request, not related to 8.1 per se, but affects all (currently supported) versions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm replying here, but I've closed the pr because of cherry-picking the commits from the previous author. Personally I agree with your point, but IMO it's out of scope of this change. What the original author tried to do is "doing whatever php < 8.1 would do". So another pr should cope with this issue.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can still split the commits, fix commit message.

and to preserve authorship (keep credits), add "Co-Authored-By: xxx" git trailer (github renders them ok)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, good to know. I've done something wrong, I guess and now I'm having some commits twice and a merge commit. Looks like I did it wrong using merge instead of using rebase?

Shall we continue here or on the other pr regarding your original comment to clearstatcache?

@thirsch thirsch marked this pull request as draft January 18, 2022 12:14
@thirsch
Copy link
Contributor Author

thirsch commented Jan 18, 2022

You can retrieve the branch with hub pr checkout 678, then cherry-pick commits. If you want to squash commits, use git rebase -i

I'll try to come up with another branch/pr with at least the two commits as being cherry picked. I'm not sure how to handle the first commit, as there is already a change regarding the IntlDate-Stuff which we want to skip here.

For now I've set the pr as draft.

@thirsch
Copy link
Contributor Author

thirsch commented Jan 18, 2022

I'm closing this pr as I've created #713 as a follow-up.

@thirsch thirsch closed this Jan 18, 2022
@glensc
Copy link
Contributor

glensc commented Jan 18, 2022

I coudn't find a way to update the previous pr, sorry.

can you explain it? show what error you got?

@thirsch
Copy link
Contributor Author

thirsch commented Jan 18, 2022

can you explain it? show what error you got?

It's just missing knowledge, I guess. I have no clue, how to remove commits that are already pushed for example. And in this branch I've just copied all changes into my editor and create new commits.

@glensc
Copy link
Contributor

glensc commented Jan 18, 2022

seems also a lack of knowledge to share error messages? :D

since don't know what step you got stuck, here's the full flow:

  • git rebase -i origin/master
  • git push --force-with-lease

you can use git push -f to lessen typing, just force with lease is safer (google for the option meaning)

@thirsch
Copy link
Contributor Author

thirsch commented Jan 18, 2022

seems also a lack of knowledge to share error messages? :D

since don't know what step you got stuck, here's the full flow:

  • git rebase -i origin/master
  • git push --force-with-lease

you can use git push -f to lessen typing, just force with lease is safer (google for the option meaning)

Looks like :-D Just joking, as I did not perform any commands, there was no chance to send any error message. So what would be the correct process to change what I did? I started from a fresh clone of the smarty-repo and created a new branch. Using my local ide, I've copied all changes from the github-ui and created a new commit with the changes.

After the feedback in this pr to keep the author, what should I have done to adjust the commits?

@thirsch thirsch deleted the feature/php-8.1 branch January 18, 2022 14:52
@thirsch
Copy link
Contributor Author

thirsch commented Jan 18, 2022

@glensc Ah, I think I've got it now. The push force allows me to change whatever the branch contains on the server. That's not allowed in our on-premise environment, therefore I've never used it. ;-)

@glensc
Copy link
Contributor

glensc commented Jan 18, 2022

force push is typically allowed in pull request, but not on main branches

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants