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

Re: fatal: git grep: cannot generate relative filenames containing '..'

From
GSGeorge Spelvin <linux@horizon.com>
Date
Jan 16, 2009, 03:27 UTC
Message-ID
<20090116032708.21156.qmail@science.horizon.com>
In-Reply-To
<7vhc40ov78.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> wrote:
> Or perhaps someone did more than two years ago with --full-name?

Thank you for pointing that out! It's a bit of a handful to type, but at least it makes what I want to do possible without having to write a wrapper script. And I can reduce the typing with an alias.

I'm still trying to figure out why the basic form doesn't work, though. Is there something more subtle than that fact that the filename simplification in grep_sha1 and grep_file might do the wrong thing? If I comment out the check in cmd_grep(), it seems to work, although it prints out some funky filenames.

That seems like a straightforward thing to fix. Basically, strip off the common part of the prefix and name, and for every remaining component in the prefix, prepend a ../ to the name.

I don't mind doing the coding, but can someone who groks the code more fully tell me if I'm missing something major?

Previous: Junio C HamanoNext: George Spelvin
Message 9 of 11 in “fatal: git grep: cannot generate relative filenames containing '..'”
  1. George SpelvinJan 15, 2009
  2. Markus HeidelbergJan 15, 2009
  3. Junio C HamanoJan 16, 2009
  4. Jon LoeligerJan 16, 2009
  5. Hannu KoivistoJan 17, 2009
  6. George SpelvinJan 18, 2009
  7. Johannes SchindelinJan 16, 2009
  8. Junio C HamanoJan 16, 2009
  9. George SpelvinJan 16, 2009
  10. George SpelvinJan 16, 2009
  11. SZEDER GáborJan 16, 2009

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.