Subject: Re: bug#18805: 24.3; tramp adds /dev/null, breaks M-x grep

From: Michael Albinus <[email-masked]>
Date: Sun, 09 Nov 2014 12:36:29 +0100

Michael Albinus <[email-masked]> writes:

>> 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.
>
> But this is neither a bug of Tramp nor of the grep command. The error
> message "fatal: '/dev/null' is outside repository" comes from git.
>
> As you have said the other message, /dev/null is added due to the
> setting of grep-use-null-device. This is computed according to the needs
> of grep, and not of git.
>
> So I wouldn't regard this as an error.

PS: If you use

    M-x compile RET git grep -nH foo

there's no problem.

Best regards, Michael.