git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH/RFC 3/3] diff.c: add --relative-names to be used with --name-only
Date: Mon, 27 Jun 2016 15:24:26 -0400	[thread overview]
Message-ID: <20160627192426.GA10877@sigill.intra.peff.net> (raw)
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

  parent reply	other threads:[~2016-06-27 19:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-26 17:16 [PATCH 0/3] diff: add --relative-names Nguyễn Thái Ngọc Duy
2016-06-26 17:16 ` [PATCH 1/3] diff.c: refactor strip_prefix() Nguyễn Thái Ngọc Duy
2016-06-26 17:16 ` [PATCH 2/3] diff.c: separate "prefix" from RELATIVE_NAME (aka --relative) Nguyễn Thái Ngọc Duy
2016-06-26 17:16 ` [PATCH/RFC 3/3] diff.c: add --relative-names to be used with --name-only Nguyễn Thái Ngọc Duy
2016-06-26 23:05   ` Eric Sunshine
2016-06-27 19:24   ` Jeff King [this message]
2016-06-27 19:33     ` Duy Nguyen
2016-06-27 19:35       ` Jeff King
2016-06-27 19:39         ` Duy Nguyen

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160627192426.GA10877@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pclouds@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).