-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
[ADD] add option rename-to to allow rename addon #64
base: main
Are you sure you want to change the base?
Conversation
dc1f63f
to
f5d3ad4
Compare
oca_port/migrate_addon.py
Outdated
def _rename_module(self): | ||
if self.app.rename_to: | ||
try: | ||
import git_filter_repo as fr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember a command that was in the OCA documentation in the past to rework history to rename a module, I can't find it anymore...
I tend to reduce the dependencies if possible, especially if a git command can do the job.
Keep this lib for now, I still didn't test your PR :)
And for such feature (renaming a module), we can consider it as required, so such dependency should be in the pyproject.toml
(and try/except
block can be removed).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean: git filter-branch --tree-filter 'if [ -d old_module_name ]; then mv old_module_name new_module_name; fi' HEAD
, right?
Now I am thinking git-filter-repo could be overkill for this case, let me experiment with the git filter-branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess, I don't remember exactly 🤷♂️
Open questions:
- do we want to rename the module within all the history? (I don't know what is the "best practice" regarding this in OCA)
- is
PortAddonPullRequest
working as expected when porting commits from moduleA
which has been renamedB
on target branch? (BTW having tests for such feature and this use case is welcome)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is PortAddonPullRequest working as expected when porting commits from module A which has been renamed B on target branch? (BTW having tests for such feature and this use case is welcome)
You mentioned the point I did not notice, will add some tests
Thanks for this work 🙏 I wanted to start working on it yesterday and saw your PR 🎉 I'll test it soon |
|
f5d3ad4
to
568a3af
Compare
This change