git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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:35 UTC
Message-ID
<20160627193542.GC10877@sigill.intra.peff.net>
In-Reply-To
<CACsJy8BYsPCLiEM2syrGUa_VOCHnR3W+sSiG3sNFme1L0Hx7XA@mail.gmail.com>
On Mon, Jun 27, 2016 at 09:33:18PM +0200, Duy Nguyen wrote:
Show 18 quoted lines
> On Mon, Jun 27, 2016 at 9:24 PM, Jeff King <peff@peff.net> wrote:
> > 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?
> 
> That's my plan :) Anything that does not start with a/ or b/ should
> respect this new option.
I guess it seems a bit unfortunate that:
  git log -p --relative-names .
would not be equivalent to:
  git log -p --relative

I am not entirely convinced that "a/../Documentation/git.txt" is that unreasonable. Sure, it looks weird, and probably nobody will be able to apply the patch. But it is what the user asked for.

-Peff
Previous: Duy NguyenNext: Duy Nguyen
Message 8 of 9 in “diff: add --relative-names”
  1. 0/3 diff: add --relative-namesNguyễn Thái Ngọc Duy, Jun 26, 2016
  2. 1/3 diff.c: refactor strip_prefix()Nguyễn Thái Ngọc Duy, Jun 26, 2016
  3. 2/3 diff.c: separate "prefix" from RELATIVE_NAME (aka --relative)Nguyễn Thái Ngọc Duy, Jun 26, 2016
  4. 3/3 diff.c: add --relative-names to be used with --name-onlyNguyễn Thái Ngọc Duy, Jun 26, 2016
  5. Eric SunshineJun 26, 2016
  6. Jeff KingJun 27, 2016
  7. Duy NguyenJun 27, 2016
  8. Jeff KingJun 27, 2016
  9. Duy NguyenJun 27, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.