unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Óscar Fuentes" <ofv@wanadoo.es>
To: 22577@debbugs.gnu.org
Subject: bug#22577: 25.0.50; vc-git-grep fails when searching for `all' files
Date: Sun, 07 Feb 2016 04:17:03 +0100	[thread overview]
Message-ID: <878u2xyztc.fsf@telefonica.net> (raw)


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





             reply	other threads:[~2016-02-07  3:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-07  3:17 Óscar Fuentes [this message]
2016-02-08  4:46 ` bug#22577: 25.0.50; vc-git-grep fails when searching for `all' files 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878u2xyztc.fsf@telefonica.net \
    --to=ofv@wanadoo.es \
    --cc=22577@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).