-
Notifications
You must be signed in to change notification settings - Fork 8
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
ignore new white space in the patch context #27
Comments
Hi, I tried your second example and it behaves as you say, but if I use "-b" or "--ignore-blanks" then it does what you want. Similarly the final example gives the found/expected content that you wanted if you use "-b". But both examples from termux code do, as you say, give the unwanted conflict even if I specify "-b". The reasoning is that wiggle sees that the patch adds lines where someone else added lines, and it cannot deduce which of the insertions should be first, and which should be second. You want to say that you don't care when one of the insertions is simply blank lines. It probably makes sense to enhance "-b" to also ignore blank lines. I'll try to find time to work on that. |
--ignore-blanks should ignore blank lines as well as spaces and tabs. We don't ignore all newline characters, only those at the end of blank lines. We do this even in "line" mode. This addresses github issue #27. Signed-off-by: NeilBrown <[email protected]>
I've pushed a few changes to wiggle on github. The "-b" option should now do what you want. |
unexpected new line in context
if a new line has appeared in the patch context since the patch was created the patch is not cleanly applied
there could be a flag to ignore this type of conflict instead of forcing a manual edit
proposed solution: compare the found and expected section. if the difference is only white space characters write the replacement without a conflict message
in this example i would like to use the replacement as it is without creating a conflict message that an extra new line is now in the context that was not there before
and again almost the same
this might be redundant
the actual problem is the same but i also introduce a harmless mistake of removing a space from indentation
the found and expected message is still correct with context unlike the actual conflict further down
the actual conflict
all the conflicts from these patches seemed to be caused by new white space in the context that i would like to ignore
unexpected new line in context
there was one empty line in the context when i patched it but now there are three.
this happens in two places but i show only one for brevity
the message context is stripped but it is correct about two new empty lines
same problem again
a conflict is generated because a new line has appeared in the context
in this case also the replacement would be fine there was no need to generate a conflict
the first line in the patch is an accidentally removed space but it is irrelevant to the problem
the found and expected message is incorrect in this case it should indicate the new line with context preferably not the first line of the patch context that contains nothing interesting
The text was updated successfully, but these errors were encountered: