Gentoo Archives: gentoo-dev

From: Mike Gilbert <floppym@g.o>
To: Gentoo Dev <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] Odd git format-patch behavior
Date: Tue, 30 Jul 2013 01:41:21
Message-Id: CAJ0EP41uQHi-7F2WA_PXnMTf2R2JKXwV--AqVRPNbq3w-pNXSw@mail.gmail.com
In Reply to: [gentoo-dev] Odd git format-patch behavior by Rich Freeman
1 On Mon, Jul 29, 2013 at 8:03 PM, Rich Freeman <rich0@g.o> wrote:
2 > I figure this is half-on-topic for this list since I'm trying to
3 > prepare patch sets for a package. I'm getting fairly bizarre behavior
4 > from git format-patch - patches that don't apply, and patches numbered
5 > early in sequence that didn't show up previously in this branch. I
6 > suspect rebasing might be the cause of that change, but I don't think
7 > it fully explains this behavior.
8 >
9 > To demonstrate, run:
10 > git clone https://github.com/MythTV/mythtv.git -b fixes/0.26
11 > cd mythtv/
12 > git format-patch v0.26.0
13 > mv *.patch ..
14 > git checkout v0.26.0
15 > patch -p0 < ../0001-*
16 >
17 > Final output is:
18 > can't find file to patch at input line 17
19 > (messing with -p doesn't help, which will be obvious from a quick
20 > inspection of the file vs the tree)
21 >
22 > How can git format-patch against a tag generate a patch that won't
23 > apply against that tag?
24 >
25 > If you look at the git log of that branch you'll find that the first
26 > patch is from a commit that is more distant in the past than the tag.
27 >
28 > Am I relying on undefined behavior? This has generated useful patches
29 > for me in the past...
30 >
31
32 Try applying the patches with patch -p1.

Replies

Subject Author
Re: [gentoo-dev] Odd git format-patch behavior Mike Gilbert <floppym@g.o>