control: retitle -1 git-apply patches different file than patch
control: reassign -1 git
control: affects -1 git-buildpackage

Hi Ian,
On Wed, Dec 21, 2016 at 01:56:22AM +0000, Ian Jackson wrote:
> Package: git-buildpackage
> Version: 0.8.7
> 
> The source package (from Debian) llvm-toolchain-3.5_3.5-10.dsc
> produces different results when extracted by dpkg-source, to when
> processed using gbp pq import.  gbp must apply the patches differently
> somehow.
> 
> (This came to light because it exposed a dgit failure, #848843.)
> 
> To reproduce:
> 
> cd Download
> dget -d dget -d 
> 'http://snapshot.debian.org/archive/debian/20150227T221819Z/pool/main/l/llvm-toolchain-3.5/llvm-toolchain-3.5_3.5-10.dsc'
> cd ..
> 
> dpkg-source -x Download/llvm-toolchain-3.5_3.5-10.dsc
> cd llvm-toolchain-3.5-3.5/
> git init
> rm -rf .pc
> git add -Af .
> git commit -q -m 'dpkg-source -x'
> cd ..
> 
> dpkg-source --skip-patches -x Download/llvm-toolchain-3.5_3.5-10.dsc w
> cd w
> git init
> git add -Af .
> git commit -q -m 'dpkg-source --skip-patches -x'
> gbp pq import
> git fetch ../llvm-toolchain-3.5-3.5 master:dpkgsource
> git-diff dpkgsource
> 
> Observe that the output is not empty.  I see a diff to `configure'.

Indeed. The issue is that git-apply picks a different place to patch
than patch. Steps to reproduce:

    gbp import-dsc --no-pristine-tar --download 
http://snapshot.debian.org/archive/debian/20150227T221819Z/pool/main/l/llvm-toolchain-3.5/llvm-toolchain-3.5_3.5-10.dsc
    cd llvm-toolchain-3.5

    git co -b with-patch master
    patch -p1 < debian/patches/0023-link-libopagent.patch
    git commit -m"with patch" configure

    git co -b with-git-apply master
    git apply debian/patches/0023-link-libopagent.patch
    git commit -m"with apply" configure

    git diff with-patch with-git-apply

While git-apply patches around 10535 patch puts the hunk around 9874.

Cheers,
 -- Guido

Reply via email to