Skip to contentSkip to conversation

(minor concern) git using the pager should not be a default

DISCUSSION Emmanuel Michon 5 participants 8 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Hello,

I'm risking myself on this mailing list after looking for some advise on IRC. Basically I know about this previous attempt
http://marc.info/?l=git&m=122955045415845&w=2 but my request has little to do with emacs.

I believe UNIX recommends some rules in the «less is more» spirit when designing command line applications [basically listed here:
http://en.wikipedia.org/wiki/Unix_philosophy].

As far as I understand those, stdin/out/err would be better left with minimum processing. Silent execution with $? = 0 is the best thing that can happen.

Per those rules, which I think apply to Linux apps, it would be preferrable if the *default* setup of git didn't fork a pager, didn't use colors, didn't behave differently whether piped or not.

Of course I would be the first to always call the tool with git diff |less
excepted when I do git diff |diffstat
or enjoy such options as command line or environment switches to git. when I want.

So the point is more about the appropriateness of pushing that special ergonomy to all users, knowing it makes most users happy.

Isn't the design principle superior to the wishes of the masses?

Thanks for reading,
Don't laugh,
Keep on the good work.

Sincerely yours,

e.m.

#1 lore raw
Quoted 3 lines · Emmanuel Michon

I believe UNIX recommends some rules in the «less is more» spirit when designing command line applications [basically listed here:
http://en.wikipedia.org/wiki/Unix_philosophy].

That is exactly why our plumbing layer of commands (e.g. "git diff-tree", "git rev-list") do not page by default for people who want to go bare-metal Unix philosophy.

In other words, Porcelain (roughly speaking, those that page by default when their standard output is terminal), are not "command line applications"; they have a layer on top with a built-in UI.

If you follow Unix philosophy and want to combine tools each of which is designed to do one thing and one thing well, you would be using the commands from the plumbing layer to write your scripts, and wouldn't have to raise that "minor concern" in the first place, as they do not page by default ;-).

#2 lore raw
Quoted 3 lines · Junio C Hamano

In other words, Porcelain (roughly speaking, those that page by default when their standard output is terminal), are not "command line applications"; they have a layer on top with a built-in UI.

Is "status" considered a plumbing layer command? Because I have often wondered why it does not use the pager by default. I pipe it through less all the time and it's kind of annoying that it works differently than everything else.

-Dave

#3 lore raw
Quoted 7 lines · <[email protected]> writes:
Quoted 3 lines · Junio C Hamano

In other words, Porcelain (roughly speaking, those that page by default when their standard output is terminal), are not "command line applications"; they have a layer on top with a built-in UI.

Is "status" considered a plumbing layer command?

Have you asked "git help git" lately?

#4 lore raw
In reply to [email protected]
Quoted 4 lines · <[email protected]> writes:

Is "status" considered a plumbing layer command? Because I have often wondered why it does not use the pager by default. I pipe it through less all the time and it's kind of annoying that it works differently than everything else.

I would be pretty annoyed if git status would page by default.

Andreas.

Signature · 3 lines
Andreas Schwab, [email protected]
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#5 lore raw
Quoted 8 lines · Andreas Schwab
Quoted 4 lines · <[email protected]> writes:

Is "status" considered a plumbing layer command? Because I have often wondered why it does not use the pager by default. I pipe it through less all the time and it's kind of annoying that it works differently than everything else.

I would be pretty annoyed if git status would page by default.

This one has been debated for a while. People used to complain that it did not page, and then we turned on the pager, and then people complained that it did page. I wrote 4e10738 (Allow per-command pager config, 2008-07-03) to help settle it, and now you can do:

git config pager.status true

if you really want it. As of 9bad723 (allow command-specific pagers in pager.<cmd>, 2010-11-17), you can even set it to an arbitrary pager for each git command.

With all those options, it's amazing that we can still have threads about what should page. :)

-Peff

#6 lore raw
Quoted 3 lines · Jeff King

if you really want it. As of 9bad723 (allow command-specific pagers in pager.<cmd>, 2010-11-17), you can even set it to an arbitrary pager for each git command.

Cool!

Quoted 2 lines

With all those options, it's amazing that we can still have threads about what should page. :)

Well to be fair, it's hard to know when to read the documentation again. :)

-Dave