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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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é
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]