Closed (fixed)
Project:
Project Issue File Review
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
1 Jun 2011 at 03:39 UTC
Updated:
19 Nov 2011 at 16:40 UTC
Jump to comment: Most recent file
Comments
Comment #1
rfayThis switches to using only -p1 patches, but gives notice if the patch seems to be a -p0 patch.
Comment #2
rfayCommitted: bc06f94fdb3daa953c4b214c40a64860ef176140
I made a mistake in the commit and wrote "accept only -p0 patches" when we're actually only accepting -p1 patches.
Comment #4
pwolanin commentedI think we should revisit this. When I was a new contributor, I created patches with just the diff utility. AFAICT, there is no way with that to easily add a prefix to the testbot will take the patch?
It can be hard enough for people to figure that out - yet I think it's probably much easier than learning git enough to roll patches.
Comment #5
rfayThe reason for the decision was the other side of this: If we have both p1 and p0 patches in the queue, there's no possible way to explain to people how to apply them. And applying may be more important.
Also... Using git to create a patch is way easier than using diff... And people seem to be figuring it out OK.
Comment #6
rfayNo response, so back to fixed.
Comment #8
salvisIn #1345584-7: -p0 vs. -p1 and associated error messages I took a real-world patch from a first-time patch contributor who prepared his patch with Eclipse/SVN. That patch has the following header:
It's a -p0 header and Git will accept it with
git apply -p0orgit apply(without -p!), but it failed in the testbot, because the testbot insisted ongit apply -p1.I can prepare the same patch with
diff -up(as pwolanin mentions in #4) and get a header like...... and this, too, applies just fine with
git apply -p0orgit apply(without -p!).Alternatively, I can use
diff -upwith the original file in a different directory:Again, it applies with
git apply -p0orgit apply(without -p!).If I prepare the patch with
git diffthen I get...... and this applies with
git apply -p1orgit apply(without -p!).Finally, if I prepare the patch with
git diff --no-prefixthen I get...... and this applies with
git apply -p0only! This is the big exception here, but we don't want to support -p0 anyway, and patch creators would have to go out of their way and specify--no-prefixto get this type of patch.To sum it up, all the patch formats that we've seen (except the deliberate
--no-prefix) are acceptable togit apply. If we let Git do what it does by default (i.e. we don't force it into -p1-only mode by specifying -p1), then we may not need to worry about -p1 vs. -p0 at all. This would remove a barrier for newcomers who may be using other tools and who may not be quite ready to embrace Git yet.Can anyone come up with a common patch format that
git apply(without -p!) will not accept? and thatgit apply -p1will?If not, then I propose that we drop the unnecessary
-p1constraint and be as flexible as Git is.Comment #9
rfayIf you want to take this up as a policy debate, please don't do it in the issue queue. Go over to http://groups.drupal.org/node/140204 and take it up there.