Re: [PATCH/RFC 3/3] diff.c: add --relative-names to be used with --name-only
- From
Jeff King <peff@peff.net>
- Date
- Jun 27, 2016, 19:24 UTC
- Message-ID
- <20160627192426.GA10877@sigill.intra.peff.net>
- In-Reply-To
- <20160626171616.27948-4-pclouds@gmail.com>
On Sun, Jun 26, 2016 at 07:16:16PM +0200, Nguyễn Thái Ngọc Duy wrote:
> The difference with --relative option is, this option does not filter > paths outside cwd. You can add two more chars " ." on your command > line for that.
Another difference seems to be that it applies only to --name-only, and not to other forms. I can see how "-p --relative-names" might be weird, because you'll get:
diff --git a/../foo/bar b/../foo/bar
or something. But surely things like --name-status would want to support it?
> It would be great if --relative could be used for this (and it feels > weird that the option performs both actions at once, stripping _and_ > filtering where filtering could easily be done with pathspec). But > it's too late to change --relative behavior now.
I suspect the ".." weirdness above is one of the reasons that --relative restricted itself to the current directory (but regardless, I agree that we cannot change it now).
-Peff