Re: [PATCH v2] Do not show "diff --git" metainfo with --no-prefix
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- Jan 16, 2008, 04:22 UTC
- Message-ID
- <alpine.LFD.1.00.0801152017490.2806@woody.linux-foundation.org>
- In-Reply-To
- <alpine.LNX.1.00.0801152256480.13593@iabervon.org>
On Tue, 15 Jan 2008, Daniel Barkalow wrote:
Show 7 quoted lines
> > I don't think --no-prefix is sufficient for submodules; it means that > git-apply will accidentally remove exactly one level, but if your > submodule is two directory levels down, it won't work, and having the > effective prefixes be "gitweb" and "gitweb" is a little hackish. You'd > really want to generate a -p1 patch whose root is shifted from the actual > project root, not a -p0 patch or -p2 patch or something.
.. and this is *exactly* what
cd gitweb git diff --src-prefix=a/gitweb/ --dst-prefix=b/gitweb/
would do (obviously people wouldn't do this by hand - it would be something that is done by the "git diff" hitting a subproject).
The point is, Junio's patch suggestion tied that prefix together with the "gitness" of the patch, so Junio's patch would have broken the above: git would decide that since it's not a standard -p1 prefix, it's not a git diff, so it shouldn't have "--git" in it.
That's why tying "--git" together with any prefix handling is wrong: because it's a totally different issue. It's true that "git-apply" right now doesn't understand these things, but assuming we want to teach git-apply to apply to subprojects eventually (we do, don't we?) we'll eventually have to teach it.
Linus