Skip to content
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

[Document]Mention --ignore-space-at-eol in patching.md #11952

Merged
merged 1 commit into from
Jun 18, 2020

Conversation

Pospelove
Copy link
Contributor

My attempt to patch winpcap port resulted in a huge patch file full of whitespace changes.
--ignore-space-at-eol option forces git diff to ignore such whitespaces.

https://git-scm.com/docs/diff-options

--ignore-space-at-eol
Ignore changes in whitespace at EOL.

@JackBoosY JackBoosY self-assigned this Jun 16, 2020
@JackBoosY JackBoosY added category:documentation To resolve the issue, documentation will need to be updated requires:discussion labels Jun 16, 2020
@JackBoosY JackBoosY requested a review from vicroms June 16, 2020 06:03
@JackBoosY
Copy link
Contributor

If the patch generated using this option does not affect the application of this patch, I think we can accept it.

@Pospelove
Copy link
Contributor Author

@JackBoosY In most cases this option does nothing, but in the case with different line endings, --ignore-space-at-eol reduces the size of a generated patch by just ignoring changes in whitespaces. Yes, vcpkg, obviously, succeeds to apply patches, generated with this option (vcpkg_apply_patches, vcpkg_from_github, etc)

@JackBoosY JackBoosY added the info:reviewed Pull Request changes follow basic guidelines label Jun 17, 2020
@JackBoosY JackBoosY changed the title Mention --ignore-space-at-eol in patching.md [Document]Mention --ignore-space-at-eol in patching.md Jun 17, 2020
@vicroms vicroms merged commit 5f237aa into microsoft:master Jun 18, 2020
@Pospelove Pospelove deleted the patch-1 branch June 18, 2020 23:30
@take5v
Copy link

take5v commented May 6, 2022

Be aware, that git apply --ignore-whitespace and git diff -w (or --ignore-all-space) are broken, see https://stackoverflow.com/questions/66221977/git-apply-ignore-whitespace-is-broken and https://stackoverflow.com/questions/66221885/git-diff-w-or-ignore-all-space-is-broken. Tried on the latest git 2.36.0.windows.1 and get an error when vcpkg is applying a patch.

@JackBoosY
Copy link
Contributor

@take5v Can you please provide a output log here?

@take5v
Copy link

take5v commented May 6, 2022

@JackBoosY I tried steps described in a tutorial: https://vcpkg.readthedocs.io/en/latest/examples/patching/.

When I run git diff --ignore-space-at-eol | out-file -enc ascii foo.patch and then run vcpkg I get an error error: patch failed ... patch does not apply
However, when I run git diff | out-file -enc ascii foo.patch then git successfully applied and no errors from vcpkg.

Tested only on Windows so far (git 2.36.0.windows.1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:documentation To resolve the issue, documentation will need to be updated info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants