All of lore.kernel.org
 help / color / mirror / Atom feed
From: jidanni@jidanni.org
To: git@vger.kernel.org
Subject: git-diff should not fire up $PAGER, period!
Date: Thu, 18 Dec 2008 05:45:35 +0800	[thread overview]
Message-ID: <8763lixyps.fsf_-_@jidanni.org> (raw)
In-Reply-To: 20081216005658.GB3679@coredump.intra.peff.net

Gentlemen, I have found the solution to your problem.

Unbundle git-diff and $PAGER.

Ask yourself, does diff(1) call $PAGER?

No. That's because the Unix designers were smart enough not to glue
everything together.

Now's your chance to repent, as you haven't even yet mentioned $PAGER
on the git-diff man page. Yes, do mention it: "EXAMPLES: git-diff|less"
I.e., the user can page the output if he feels inclined, just like any
other output. I mean one already has a wallet. The bank need not give
the user one every time they make a withdraw.

I mean here I am in emacs, and

-*- mode: compilation; default-directory: "...coreutils/" -*-
Compilation started at Thu Dec 18 03:15:14
git-diff
WARNING: terminal is not fully functional^M
^M-  (press RETURN)

"It's all emacs' fault for emulating a tty too well"... no, it's all
your fault for gumming things together. No I don't want my cookies
with obligatory milk. I'll using git-diff|cat for now instead of
complaining that emacs is all wrong. Even using git-diff|cat|less is
better than messing with the LESS=F bug. Repent, whippersnappers!

OK, doing test x$EMACS = xt && PAGER=cat in .bashrc. That will help
for emacs' shell buffers, but not compilation mode buffers... "then
just make a hook"... 13 hooks to combat one poor design choice.
And one notices git-show is gummed up too.

Hmm, looking in changelogs, we see

 * Error messages used to be sent to stderr, only to get hidden,
   when $PAGER was in use.  They now are sent to stdout along
   with the command output to be shown in the $PAGER.

Well, if you had left paging to the user, no one would have blamed you
for making error messages disappear, and you could have left stderr as
the elders intended.

Wait,
$ git-config --global core.pager ""
Cool. Bye.

  parent reply	other threads:[~2008-12-17 21:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-16  0:21 git-diff should not fire up $PAGER if there is no diff jidanni
2008-12-16  0:56 ` Jeff King
2008-12-16  6:35   ` Stefan Karpinski
2008-12-16  7:44     ` Jeff King
2008-12-16 22:43       ` Stefan Karpinski
2008-12-17 21:45   ` jidanni [this message]
2008-12-17 22:02     ` git-diff should not fire up $PAGER, period! Junio C Hamano
2008-12-17 22:04     ` Linus Torvalds
2008-12-22  3:28       ` Miles Bader
2008-12-18  3:31     ` Jeff King
2008-12-22  3:27     ` Miles Bader
2008-12-22  7:55       ` Johannes Sixt
2008-12-22  8:30         ` Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2008-12-18  2:18 Mike Coleman
2008-12-18  2:26 ` Junio C Hamano
2008-12-18  3:22 ` Johannes Schindelin

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

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

  git send-email \
    --in-reply-to=8763lixyps.fsf_-_@jidanni.org \
    --to=jidanni@jidanni.org \
    --cc=git@vger.kernel.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.