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

Re: [PATCH] git-grep --relative: show pathnames relative to the current directory

From
Karl Hasselström <kha@treskal.com>
Date
Aug 11, 2006, 12:03 UTC
Message-ID
<20060811120334.GA6713@diana.vm.bytemark.co.uk>
In-Reply-To
<7vpsf7u2x7.fsf@assigned-by-dhcp.cox.net>
On 2006-08-11 00:50:12 -0700, Junio C Hamano wrote:
Show 7 quoted lines
> By default, the command shows pathnames relative to the project
> root, even when run from a subdirectory. With --relative flag,
> however, the command outputs pathnames relative to the current
> directory.
>
> This makes it very pleasant to run in Emacs compilation (or
> "grep-find") buffer.
[...]
Show 7 quoted lines
>  * Now the question is, shouldn't this be the default, with the
>    current output available as an option --full-name, just like
>    ls-files?
>
>    Changing the default always risks breaking people's habit and
>    scripts, but I tend to think the current output is a misfeature
>    which we'd better fix sooner rather than later.

I think this behavior should be the default, precisely because it otherwise breaks the habits formed during use of plain "grep".

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle
Previous: Junio C HamanoNext: Sam Ravnborg
Message 2 of 3 in “git-grep --relative: show pathnames relative to the current directory”
  1. git-grep --relative: show pathnames relative to the current directoryJunio C Hamano, Aug 11, 2006
  2. Karl HasselströmAug 11, 2006
  3. Sam RavnborgAug 11, 2006

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.