Re: [PATCH] Teach 'git apply' to look at $GIT_DIR/config
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Feb 18, 2007, 00:53 UTC
- Message-ID
- <Pine.LNX.4.63.0702180151060.22628@wbgn013.biozentrum.uni-wuerzburg.de>
- In-Reply-To
- <7v64a0qpa8.fsf@assigned-by-dhcp.cox.net>
Hi,
On Sat, 17 Feb 2007, Junio C Hamano wrote:
Show 9 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes: > > > ... However, I suspect you have to 'cd' back to prefix, or else the > > patch gets applied in the repo root, right? (Disclaimer: I did not > > read the patch.) > > Actually, not cd-ing up was a bug, since git diff is always relative to > root. The behaviour to apply the same file was inconsistent between > with --index and without as far as I can tell.
For the same reason that I like git-merge-file, and git-diff2, namely to have a _sane_ tool with a lot of options, which works the same everywhere I have git, I also like git-apply.
And I use git-apply to apply patches way more often than "patch" these days. And I _think_ that it is a feature that it does not cd-up before trying to apply the stuff. In git.git, I cannot think of a reasonable use case for applying something not relative-to-root, but I had that use case in some other (git-tracked) project.
So my vote is to leave the cwd where it is in git-apply.
Ciao, Dscho