unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#22577: 25.0.50; vc-git-grep fails when searching for `all' files
@ 2016-02-07  3:17 Óscar Fuentes
  2016-02-08  4:46 ` Dmitry Gutov
  0 siblings, 1 reply; 10+ messages in thread
From: Óscar Fuentes @ 2016-02-07  3:17 UTC (permalink / raw)
  To: 22577


emacs -Q
M-x vc-dir <top directory of a git repo. Emacs' for instance>
M-x vc-git-grep
Search for: foo
Search for "foo" in files (default all): <ENTER (accept default)>
In directory: <ENTER (accept default)>

The command fails with

-*- mode: grep; default-directory: "~/dev/emacs/emacs/" -*-
Grep started at Sun Feb  7 03:54:09

git --no-pager grep -n -e VC -- * .*
fatal: ..: '..' is outside repository

Grep exited abnormally with code 128 at Sun Feb  7 03:54:09


The problem consists on `all' defaulting to the file patterns "* .*", as
defined in the variable `grep-files-aliases'. Those patterns matches
".." (the parent directory) which is outside the git repo (when you
execute vc-git-grep on the top directory of the repo.)

BTW, this pattern creates unnecesary noise when used with the `grep'
commands, adding to the grep output lines such as

grep: .: Is a directory
grep: ..: Is a directory

I propose the following patch to fix this problem. Shell gurus, please
review.

diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 7e6f157..3f77a2a 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -189,7 +189,7 @@ grep-find-template
   :group 'grep)
 
 (defcustom grep-files-aliases
-  '(("all" .   "* .*")
+  '(("all" .   "* .[^\\.]*")
     ("el" .    "*.el")
     ("ch" .    "*.[ch]")
     ("c" .     "*.c")


In GNU Emacs 25.0.50.29 (x86_64-unknown-linux-gnu, X toolkit)
 of 2016-01-21 built on qcore
Repository revision: 5293d1bdb3e665a565af032a163004c976328cc2
Windowing system distributor 'The X.Org Foundation', version 11.0.11702000
System Description:	Ubuntu 15.10

Configured using:
 'configure --without-toolkit-scroll-bars --with-x-toolkit=lucid'

Configured features:
XAW3D XPM JPEG TIFF GIF PNG SOUND GSETTINGS NOTIFY GNUTLS LIBXML2
FREETYPE XFT ZLIB LUCID X11

Important settings:
  value of $LANG: C
  locale-coding-system: nil

Major mode: Emacs-Lisp





^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-02-14 15:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-07  3:17 bug#22577: 25.0.50; vc-git-grep fails when searching for `all' files Óscar Fuentes
2016-02-08  4:46 ` Dmitry Gutov
2016-02-08  5:59   ` Óscar Fuentes
2016-02-08 11:16     ` Andreas Schwab
2016-02-08 16:10       ` Óscar Fuentes
2016-02-08 16:22       ` Óscar Fuentes
2016-02-08 16:28         ` Andreas Schwab
2016-02-08 18:14         ` Dmitry Gutov
2016-02-08 18:41         ` Andreas Schwab
2016-02-14 15:24         ` Óscar Fuentes

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).