From: Jeff King Date: Thu, 08 Jul 2010 11:41:25 GMT Subject: Re: [BUG/RFC] Raw diff output format (git-diff-tree) and --relative[=] option Message-ID: <20100708114125.GA2427@sigill.intra.peff.net> In-Reply-To: <201007081300.18712.jnareb@gmail.com> On Thu, Jul 08, 2010 at 01:00:17PM +0200, Jakub Narebski wrote: > Last there is filename munging, done using strip_prefix function. > This is done using prefix_length only, and that is the cause of > the bug: > $ git diff-tree --abbrev -r --raw HEAD --relative=sub > a3a8425fe5496c61921010cb1e7b455a1f52bb86 > :100644 100644 d90bda0... cefcae0... M /quux > > if one uses '--relative=sub' instead of '--relative=sub/'. Is that a bug or a feature? You need to say "sub/" to get what you want, which is annoying. But it means you can also you "--relative=su" to get "b/quux". In that example, it's probably useless, but consider a set of filenames "foo-1" through "foo-5". You don't always want to break on a directory boundary. I believe "git-archive --prefix" has the same behavior for the same reason. -Peff