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

Re: Can't find the revelant commit with git-log

From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
Jan 28, 2011, 22:01 UTC
Message-ID
<4D433CA7.9060200@lsrfire.ath.cx>
In-Reply-To
<4D4063EC.7090509@lsrfire.ath.cx>
Am 26.01.2011 19:11, schrieb René Scharfe:
> - Make git grep report non-matching path specs (new feature).

This is a bit complicated because grep can work on files, index entries as well as versioned objects and supports wildcards, so it's not that easy to tell if a path spec matches something or is a rather typo. But it's not impossible either, of course.

What you can do until someone implements it is to simply omit the double dash. Path specs are then looked up as revs and files and you'll get an error if they can't be found:

	# In the Linux kernel repo; we enter the wrong directory:
	$ cd drivers
	$ git grep blacklist_iommu v2.6.27 intel-iommu.c
	fatal: ambiguous argument 'intel-iommu.c': unknown revision or path not in the working tree.
	Use '--' to separate paths from revisions
	# Now we enter the right one and try again:
	$ cd pci
	$ git grep blacklist_iommu v2.6.27 intel-iommu.c
	v2.6.27:intel-iommu.c:static int blacklist_iommu(const struct dmi_system_id *id)
	v2.6.27:intel-iommu.c:		.callback = blacklist_iommu,

This won't work in bare repos or with wildcards, but it's better than nothing. And it saves you a few keystrokes.

René
Previous: René ScharfeNext: Francis Moreau
Message 23 of 30 in “Can't find the revelant commit with git-log”
  1. Francis MoreauJan 25, 2011
  2. René ScharfeJan 25, 2011
  3. Francis MoreauJan 25, 2011
  4. Francis MoreauJan 26, 2011
  5. Johannes SixtJan 26, 2011
  6. Francis MoreauJan 26, 2011
  7. Sverre RabbelierJan 26, 2011
  8. Francis MoreauJan 26, 2011
  9. Sverre RabbelierJan 26, 2011
  10. Francis MoreauJan 26, 2011
  11. Junio C HamanoJan 26, 2011
  12. Francis MoreauJan 26, 2011
  13. René ScharfeJan 26, 2011
  14. René ScharfeJan 28, 2011
  15. Junio C HamanoJan 29, 2011
  16. René ScharfeJan 29, 2011
  17. Junio C HamanoJan 29, 2011
  18. René ScharfeJan 29, 2011
  19. Junio C HamanoFeb 1, 2011
  20. Junio C HamanoFeb 7, 2011
  21. René ScharfeFeb 10, 2011
  22. René ScharfeJan 29, 2011
  23. René ScharfeJan 28, 2011
  24. Francis MoreauJan 29, 2011
  25. René ScharfeJan 29, 2011
  26. Francis MoreauJan 29, 2011
  27. René ScharfeJan 29, 2011
  28. Francis MoreauJan 26, 2011
  29. René ScharfeJan 26, 2011
  30. Francis MoreauJan 26, 2011

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.