-
Notifications
You must be signed in to change notification settings - Fork 21
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
Applying merge diffs leads to klocalizer AssertionError #282
Comments
Thanks @lolrepeatlol . Indeed we assumed no merge commits (and commits that had C content), which is probably why this wasn't identified before. Change to usage makes sense. Would there be a way to more gracefully fail rather than an assert? |
No problem @paulgazz -- I was thinking we could check if the processed diff was empty earlier on and print an error if so; this way, we can keep the assertion. I made a change to
Here, we have
That said, I'll take a bigger look at this next week, as I don't think I have the time to get around to a PR yet. |
Description
klocalizer
will run into an AssertionError if passed a single merge commit.git show
, therefore leavingklocalizer
with an essentially empty patch.Steps to reproduce
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
and enter the directory.git show {commit} > patch.diff
. I initially encountered this issue with the commit5635f189425e328097714c38341944fc40731f3d
.make defconfig
.klocalizer
withklocalizer --repair .config -a x86_64 --include-mutex patch.diff
.What I expected to happen
klocalizer
to repair the kernel configuration file.(What should happen:
klocalizer
should tell me why it's unable to apply the patch and exit without crashing.)What actually happened
Fixing this issue
git show {commit}
togit diff {commit}^ {commit}
, which already aligns with whatgit diff
does to large sets of commits and would make using merge commits withklocalizer
significantly more useful.klocalizer
when a patchfile with no file changes is provided.The text was updated successfully, but these errors were encountered: