コマンドでパッチを作成しようとしています
git diff sourcefile >/var/lib/laymab/overlay/category/ebuild/files/thepatch.patch
パッチを適用すると、
$ patch -v
GNU patch 2.7.5
$ /usr/bin/patch -p1 </var/lib/laymab/overlay/category/ebuild/files/thepatch.patch
patching file sourcefile
Hunk #1 FAILED at 1 (different line endings).
Hunk #2 FAILED at 23 (different line endings).
Hunk #3 FAILED at 47 (different line endings).
Hunk #4 FAILED at 65 (different line endings).
Hunk #5 FAILED at 361 (different line endings).
5 out of 5 hunks FAILED -- saving rejects to file sourcefile.rej
dos2unixをsrcファイルとパッチファイルの両方に適用しようとしましたが、メッセージは消えません...
UPD:--ignore-whitespaceも役に立たない
PATCH COMMAND: patch -p1 -g0 -E --no-backup-if-mismatch --ignore-whitespace --dry-run -f < '/var/lib/layman/dotnet/dev-dotnet/slntools/files/remove-wix-project-from-sln-file-v2.patch'
=====================================================
checking file Main/SLNTools.sln
Hunk #1 FAILED at 14 (different line endings).
Hunk #2 FAILED at 49 (different line endings).
Hunk #3 FAILED at 69 (different line endings).
Hunk #4 FAILED at 102 (different line endings).
4 out of 4 hunks FAILED
UPD:非常に良い記事が見つかりました:https : //stackoverflow.com/a/4425433/1709408
sed -i.bak -e 's/\r$//g' something
。dos2unixは、混在した行末をあなたが望むほど積極的に処理するとは思わない。