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

[PATCH v2 0/2] grep: make output consistent with revision syntax

From
SHStefan Hajnoczi <stefanha@redhat.com>
Date
Jan 20, 2017, 17:11 UTC
Message-ID
<20170120171126.16269-1-stefanha@redhat.com>
v2:
 * Use obj->type instead of re-parsing name for delimiter
   (Followed Brandon's suggestion but named the variable 'delim' since that
   name is used in other places and 'del' is used for deletion.)
 * Add tests
 * Update Patch 1 commit description with a more relevant example
 * PATCH instead of RFC, now works with all documented git-rev-parse(1) syntax
git-grep(1)'s output is not consistent with git-rev-parse(1) revision syntax.

This means you cannot take "rev:path/to/file.c: foo();" output from git-grep(1) and expect "git show rev:path/to/file.c" to work. See the individual patches for examples of command-lines that produce invalid output.

Stefan Hajnoczi (2):
  grep: only add delimiter if there isn't one already
  grep: use '/' delimiter for paths
 builtin/grep.c  |  8 +++++++-
 t/t7810-grep.sh | 26 ++++++++++++++++++++++++++
 2 files changed, 33 insertions(+), 1 deletion(-)
-- 
2.9.3
Next: Stefan Hajnoczi
Message 1 of 15 in “grep: make output consistent with revision syntax”
  1. 0/2 grep: make output consistent with revision syntaxStefan Hajnoczi, Jan 20, 2017
  2. 1/2 grep: only add delimiter if there isn't one alreadyStefan Hajnoczi, Jan 20, 2017
  3. Junio C HamanoJan 20, 2017
  4. 2/2 grep: use '/' delimiter for pathsStefan Hajnoczi, Jan 20, 2017
  5. Junio C HamanoJan 20, 2017
  6. Brandon WilliamsJan 20, 2017
  7. Stefan HajnocziFeb 7, 2017
  8. Jeff KingFeb 7, 2017
  9. Junio C HamanoFeb 7, 2017
  10. Junio C HamanoFeb 7, 2017
  11. Jeff KingFeb 9, 2017
  12. Junio C HamanoFeb 9, 2017
  13. Jeff KingFeb 9, 2017
  14. Stefan HajnocziFeb 14, 2017
  15. Junio C HamanoJan 20, 2017

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.