Tdesktop: Problem with Git apply

Created on 28 Aug 2016  路  7Comments  路  Source: telegramdesktop/tdesktop

git apply ./../../tdesktop/Telegram/Patches/openal.diff

when i use this code in vs 2015 console , i get error :

./../../tdesktop/Telegram/Patches/openal.diff:10: trailing whitespace.
if (!self->killNow) while(GetMessage(&msg, NULL, 0, 0))
./../../tdesktop/Telegram/Patches/openal.diff:19: trailing whitespace.
if (!self->killNow) while(GetMessage(&msg, NULL, 0, 0))
error: patch failed: Alc/backends/winmm.c:221
error: Alc/backends/winmm.c: patch does not apply

All 7 comments

Error 2 :

D:\TBuild\Libraries\qt5_6_0>cd qtbase && git apply ../../../tdesktop/Telegram/Patches/qtbase_5_6_0.diff && cd ..

../../../tdesktop/Telegram/Patches/qtbase_5_6_0.diff:12: trailing whitespace.

Make this build use static runtime library.

../../../tdesktop/Telegram/Patches/qtbase_5_6_0.diff:13: trailing whitespace.
QMAKE_CFLAGS_RELEASE = -O2 -MT
../../../tdesktop/Telegram/Patches/qtbase_5_6_0.diff:14: trailing whitespace.
QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MT -Zi
../../../tdesktop/Telegram/Patches/qtbase_5_6_0.diff:15: trailing whitespace.
QMAKE_CFLAGS_DEBUG = -Zi -MTd
../../../tdesktop/Telegram/Patches/qtbase_5_6_0.diff:29: trailing whitespace.
// CopyFile2 returns HRESULT, not BOOL, so it should be tested for S_OK, not 0.
fatal: git apply: bad git-diff - expected /dev/null on line 423

I sugest to use sourcetree or gitextensions to apply patches.

how ?

In case of soucetree: http://i.imgur.com/Y96VwX2.png
(git for windows don't likes to much patches with /dev/null
you must convert .diff file from dos format to unix format to allow to be applied.

git -c diff.mnemonicprefix=false -c core.quotepath=false apply -v --reject -p 1 --directory=D:/TBuild/Libraries/openal-soft/ C:\Users\Pouya\Documentstdesktop\Telegram\Patches\openal.diff
C:\Users\Pouya\Documentstdesktop\Telegram\Patches\openal.diff:10: trailing whitespace.
if (!self->killNow) while(GetMessage(&msg, NULL, 0, 0))

C:\Users\Pouya\Documentstdesktop\Telegram\Patches\openal.diff:19: trailing whitespace.
if (!self->killNow) while(GetMessage(&msg, NULL, 0, 0))
Checking patch D:/TBuild/Libraries/openal-soft/Alc/backends/winmm.c...
fatal: invalid path 'D:/TBuild/Libraries/openal-soft/Alc/backends/winmm.c'

but that path is exist !!

Change CLRF to LF and command from instruction will works

@zikasak so this issue can be closed?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Liudvikas picture Liudvikas  路  3Comments

matteotumiati picture matteotumiati  路  3Comments

TotalKrill picture TotalKrill  路  3Comments

Mindstormer619 picture Mindstormer619  路  3Comments

abhyrz picture abhyrz  路  3Comments