You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
often I noticed that oca-port is trying to port commits already present in the target branch. I'm not sure but it seems it's looking using sha1 so it fails on commits that are cherry-picked (disclaimer I'm not very sure it's the reason why). But I notice this very often.
So what I did is I look up the commit with a long enough summary and if the summary and author_email matches in the target branch, then I skip the commit and I print that I'm skipping it.
Yes there is a small chance a commit by the same author got the same summary without being the same, but in that case you'll likely notice merge conflicts later in the port process and the culprit commit will also be logged, so I feel this is safe enough.
This is a a feature I've been using for one year in OCA/l10n-brazil (the most active OCA repo after OpenUpgrade), but it can probably be made cleaner. Let me know if you want me to change something.
Hello @rvalyi ,
IMO the issue should be somewhere else, as oca-port doesn't rely on SHA to compare commits, but instead on different commit attributes, like the message (not the summary, which is contained in the message), author name + email, authored date etc... even the updated file paths in some cases (there is a strict or non-strict comparison depending on the use case), see the Commit class.
Normally commits migrated with git cherry-pick or git format-patch + git am (and without touching the commit message) are well detected as already existing.
If you could provide me an example in OCA/l10n-brazil that is listing false-positive commits, I could analyze deeper where the issue stands, maybe the existing criteria for that comparison is too strict for your use case?
The other day I found the opposite bug: oca-port is not proposing some commits to be ported because it detected another similar one but in another module :) I will tackle that in release 0.20.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
often I noticed that oca-port is trying to port commits already present in the target branch. I'm not sure but it seems it's looking using sha1 so it fails on commits that are cherry-picked (disclaimer I'm not very sure it's the reason why). But I notice this very often.
So what I did is I look up the commit with a long enough summary and if the summary and author_email matches in the target branch, then I skip the commit and I print that I'm skipping it.
Yes there is a small chance a commit by the same author got the same summary without being the same, but in that case you'll likely notice merge conflicts later in the port process and the culprit commit will also be logged, so I feel this is safe enough.
This is a a feature I've been using for one year in OCA/l10n-brazil (the most active OCA repo after OpenUpgrade), but it can probably be made cleaner. Let me know if you want me to change something.
cc @sebalix @simahawk