GNU bug report logs - #18805
24.3; tramp adds /dev/null, breaks M-x grep

Previous Next

Package: emacs;

Reported by: trentbuck <at> gmail.com (Trent W. Buck)

Date: Thu, 23 Oct 2014 07:45:02 UTC

Severity: normal

Tags: notabug

Found in version 24.3

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: trentbuck <at> gmail.com (Trent W. Buck)
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3; tramp adds /dev/null, breaks M-x grep
Date: Thu, 23 Oct 2014 18:43:16 +1100
I routinely do M-x grep, but don't always run grep itself.
For example, I might type in
    find /usr/share/emacs/24.3/lisp/ -name \*.el.gz -exec zgrep -nH -e /dev/null {} +
like I did to investigate this issue.

The problem I'm having is when *in tramp* I do
    M-x grep RET git grep -nH foo
tramp helpfully appends " /dev/null" to the command, breaking it:
    fatal: '/dev/null' is outside repository

If I change it to
    M-x grep RET git grep -nH foo #
then I get the behaviour I want.

This issue *DOES NOT* occur in local directories, only over tramp.

IMO it's daft of tramp to assume appending /dev/null will DTRT,
since that only holds for trivial commands.
If TRAMP is running each command in a sh -c '...' (IIRC it doesn't),
prepending "exec </dev/null; \n" (or <&-) should be more reliable.

I would patch this away in my .emacs,
but I can't understand where tramp is doing this.
I suspect it's this, but that's a wild-ass guess.
    tramp-sh.el.gz:2820: (setq input "/dev/null")


In GNU Emacs 24.3.1 (x86_64-pc-linux-gnu)
 of 2014-06-07 on barber, modified by Debian
System Description:	Debian GNU/Linux testing (jessie)

Configured using:
 `configure '--build' 'x86_64-linux-gnu' '--build' 'x86_64-linux-gnu'
 '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib'
 '--localstatedir=/var/lib' '--infodir=/usr/share/info'
 '--mandir=/usr/share/man' '--with-pop=yes'
 '--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.3/site-lisp:/usr/share/emacs/site-lisp'
 '--with-crt-dir=/usr/lib/x86_64-linux-gnu' '--with-x=no'
 '--without-gconf' '--without-gsettings' 'build_alias=x86_64-linux-gnu'
 'CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat
 -Werror=format-security -Wall' 'LDFLAGS=-Wl,-z,relro'
 'CPPFLAGS=-D_FORTIFY_SOURCE=2''

Important settings:
  value of $LC_COLLATE: C
  value of $LANG: en_AU.utf8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Fundamental

Minor modes in effect:
  shell-dirtrack-mode: t
  xterm-mouse-mode: t
  ido-everywhere: t
  savehist-mode: t
  icomplete-mode: t
  show-paren-mode: t
  delete-selection-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
ESC x r e p o r t SPC C-g C-x b * s c RET ESC x r e 
p o r t SPC e m a c s SPC b u g RET

Recent messages:
Tramp: Found remote shell prompt on `login'
Tramp: Opening connection for login using scp...done
Tramp: Opening connection for login using scp...
Tramp: Sending command `exec ssh -q   -e none login'

Tramp: Waiting for prompts from remote shell
Tramp: Sending command `exec ssh -q   -e none login'
Tramp: Found remote shell prompt on `login'
Tramp: Opening connection for login using scp...done
Grep finished (matches found)
Quit

Load-path shadows:
/usr/share/emacs/24.3/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup
/usr/share/emacs/site-lisp/rst hides /usr/share/emacs/24.3/lisp/textmodes/rst
/usr/share/emacs24/site-lisp/dictionaries-common/ispell hides /usr/share/emacs/24.3/lisp/textmodes/ispell
/usr/share/emacs24/site-lisp/dictionaries-common/flyspell hides /usr/share/emacs/24.3/lisp/textmodes/flyspell

Features:
(shadow sort mail-extr emacsbug message rfc822 mml easymenu mml-sec
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader grep dired tramp-cache tramp-sh tramp tramp-compat
auth-source eieio byte-opt bytecomp byte-compile cconv gnus-util
password-cache tramp-loaddefs shell pcomplete format-spec advice
help-fns cl-lib advice-preload sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils jka-compr edmacro kmacro disp-table
xt-mouse ido savehist icomplete time-date paren delsel saveplace
debian-el debian-el-loaddefs w3m-load pylint compile comint regexp-opt
ansi-color ring tool-bar 50magit emacs-goodies-el emacs-goodies-custom
emacs-goodies-loaddefs easy-mmode dpkg-dev-el dpkg-dev-el-loaddefs
ediff-hook vc-hooks lisp-float-type tabulated-list newcomment lisp-mode
register page menu-bar rfn-eshadow timer select mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process dbusbind multi-tty emacs)




This bug report was last modified 10 years and 242 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.