git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Jakub Narebski <jnareb@gmail.com>
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: Mon, 9 Aug 2010 10:59:56 -0400	[thread overview]
Message-ID: <20100809145956.GB3438@sigill> (raw)
In-Reply-To: <201007081656.23474.jnareb@gmail.com>

On Thu, Jul 08, 2010 at 04:56:20PM +0200, Jakub Narebski wrote:

> > Or was that what you had in mind the whole time? My impression was that
> > you wanted --relative=foo to always be equivalent to --relative=foo/.
> > The subtle difference is that I want the "/" removed only if it is the
> > next character (or another way of thinking about it is to append "/" to
> > the prefix only if it is an actual directory).
> 
> What I wanted is for "git diff-tree A B --relative=sub" to behave as
> "git diff-tree A:sub B:sub".  Currently without -r / -t (without turning
> on recursive mode) it produces no output; well at least no output if
> 'sub' is really subdirectory.

I think this is a separate issue from the extra slash problem. I don't
think it would hurt anything to enable "-r" automatically in diff-tree,
but _only_ if we know that the prefix we stripped ended in "/". Since
that is just changing a case that is already nonsensical, whereas
turning on recursion for "git diff-tree --relative=foo- A B" would
actually be a change in behavior.

It should be possible, but it is a bit more surgery, since the prefix
stripping code is pretty dumb currently.

> What's more I wanted for "git diff --raw" in any combination to behave
> the same... although I guess here point is moot, as "git diff" is
> automatically recursive regardless of output format, and you can't turn
> it off.

Yeah, I think "git diff" already does what you want, since 82cb8af
(git-diff: turn on recursion by default, 2007-07-29).

-Peff

      parent reply	other threads:[~2010-08-09 15:00 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
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 [this message]

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=20100809145956.GB3438@sigill \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jnareb@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).