From: Jakub Narebski <jnareb@gmail.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [BUG/RFC] Raw diff output format (git-diff-tree) and --relative[=<path>] option
Date: Thu, 8 Jul 2010 14:11:13 +0200 [thread overview]
Message-ID: <201007081411.14843.jnareb@gmail.com> (raw)
In-Reply-To: <20100708114125.GA2427@sigill.intra.peff.net>
On Thu, 8 Jul 2010, Jeff King wrote:
> 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.
It is called --relative=<path>, *not* --relative=<prefix>. I also
think that it was meant to be the opposite of --directory=<root> of
git-am and git-apply.
"git archive --prefix" is IMVHO a bit of horse of different color.
Nevertheless in current situation it would be good to have the
following applied.
-- >8 --
diff --git i/Documentation/diff-options.txt w/Documentation/diff-options.txt
index 2371262..bc837cd 100644
--- i/Documentation/diff-options.txt
+++ w/Documentation/diff-options.txt
@@ -278,7 +278,7 @@ ifndef::git-format-patch[]
Swap two inputs; that is, show differences from index or
on-disk file to tree contents.
---relative[=<path>]::
+--relative[=<path>/]::
When run from a subdirectory of the project, it can be
told to exclude changes outside the directory and show
pathnames relative to it with this option. When you are
-- 8< --
--
Jakub Narebski
Poland
next prev parent reply other threads:[~2010-07-08 12:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-05 8:15 [BUG] Spurious leading '/' in filename in "git diff --raw --relative=<subdirectory>" Jakub Narebski
2010-07-05 15:44 ` Jakub Narebski
2010-07-08 11:00 ` [BUG/RFC] Raw diff output format (git-diff-tree) and --relative[=<path>] option Jakub Narebski
2010-07-08 11:41 ` Jeff King
2010-07-08 12:11 ` Jakub Narebski [this message]
2010-07-08 12:19 ` Jakub Narebski
2010-07-08 14:23 ` Jeff King
2010-07-08 14:56 ` Jakub Narebski
2010-08-09 14:50 ` Jeff King
2010-08-09 14:59 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201007081411.14843.jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.