Re: [PATCH] git-difftool: allow skipping file by typing 'n' at prompt
- From
Sitaram Chamarty <sitaramc@gmail.com>
- Date
- Oct 10, 2011, 23:39 UTC
- Message-ID
- <CAMK1S_jNhB_cuTV0u+o_RwOdMKa-xXNZp8KGQ63yqFc70zTm5g@mail.gmail.com>
- In-Reply-To
- <7v8voslg4l.fsf@alter.siamese.dyndns.org>
On Tue, Oct 11, 2011 at 2:26 AM, Junio C Hamano <gitster@pobox.com> wrote:
> I also wondered if this is easier to read: > > pipe | stdin_contains m2 && > ! pipe | stdin_contains master
> but I do not think it is (we cannot say "pipe | ! stdin_contains master").
Agreed on both counts.
"pipe | ( ! grep master )" does work, but I suspect that is an inconsistency in the shell so I didn't want to use it. IIRC the "( list )" constrict is not supposed to make *that* much difference. Have to check when I have time.
> In any case, here is what I ended up queuing. Thanks.
> +stdin_doesnot_contain()
> +{
> + ! stdin_contains "$1"
> }(facepalm) Why didn't I think of that!
Thanks :-)