-
Notifications
You must be signed in to change notification settings - Fork 175
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 b4 Tool #3506
base: main
Are you sure you want to change the base?
Add b4 Tool #3506
Conversation
Add method am to apply patches download by B4
8baa196
to
aab22a4
Compare
@@ -201,6 +201,17 @@ def apply( | |||
) | |||
result.assert_exit_code(message=f"failed on applying patches. {result.stdout}") | |||
|
|||
def am(self, cwd: pathlib.PurePath, patch: pathlib.PurePath) -> None: | |||
result = self.run( | |||
f"am {patch}", |
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.
does git am depend on b4 package?
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.
The output of b4 is a .mbx file. You can apply this patch to the repo using git am "filename.mbx"
As per description, git am can be used to apply any email related patch, whereas git apply is for the .patch files
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 didn't see the place which uses b4 tool
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 will be raising that as a separate PR, added that in the description.
I have created a Modifier in Kernel Install transformer that uses b4 to apply patches
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 can add those changes to this PR, if you prefer having it in the same PR
aab22a4
to
3876b5d
Compare
@@ -201,6 +201,17 @@ def apply( | |||
) | |||
result.assert_exit_code(message=f"failed on applying patches. {result.stdout}") | |||
|
|||
def am(self, cwd: pathlib.PurePath, patch: pathlib.PurePath) -> None: |
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 see you put arg name as "patch" unlike git apply where it has "patches". Does it not work with multiple patches/mboxes? Can you test once if not tested for the tools/library sake?
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.
Interesting, I did not notice that.
Though the parameter is named patches, it accepts a Purepath and not list of Purepath.
I will verify the behavior and fix it along with Chi's comment below
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.
By multiple I meant something like a pattern.
Ref:
file_pattern: str = "*.patch" |
@@ -201,6 +201,17 @@ def apply( | |||
) | |||
result.assert_exit_code(message=f"failed on applying patches. {result.stdout}") | |||
|
|||
def am(self, cwd: pathlib.PurePath, patch: pathlib.PurePath) -> None: |
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.
Change the name to apply_mail
. But if it's possible, you can check the file ext, and implement it in apply
method.
Add b4 tool to download upstream patches.
Add am method to git in order to apply this patch.
The usage of these will be raised as a separate PR. A new modifier will be added to kernel_installer to modify code using b4.