From: trentbuck@gmail.com (Trent W. Buck)
To: 18805@debbugs.gnu.org
Subject: bug#18805: 24.3; tramp adds /dev/null, breaks M-x grep
Date: Thu, 23 Oct 2014 18:43:16 +1100 [thread overview]
Message-ID: <87d29j6xkb.fsf@gmail.com> (raw)
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)
next reply other threads:[~2014-10-23 7:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-23 7:43 Trent W. Buck [this message]
[not found] ` <handler.18805.B.14140502429734.ack@debbugs.gnu.org>
2014-10-23 8:05 ` bug#18805: 24.3; tramp adds /dev/null, breaks M-x grep Trent W. Buck
2014-11-09 10:58 ` Michael Albinus
2014-11-09 11:36 ` Michael Albinus
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=87d29j6xkb.fsf@gmail.com \
--to=trentbuck@gmail.com \
--cc=18805@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).