threads / discuss / 31381

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

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

## tl;dr

8 messages between Aug 29, 2012 and Aug 31, 2012.

replies: 7people: 5as markdown or json

Emmanuel Michon· Aug 29, 2012, 16:02 UTC · lore
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.
Junio C Hamano· Aug 29, 2012, 17:19 UTC · re: Emmanuel Michon · lore

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

Emmanuel Michon <emmanuel_michon@sigmadesigns.com> writes:
> Isn't the design principle superior to the wishes of the masses?
Only when you are living an ideal fantasy land.
Junio C Hamano· Aug 29, 2012, 17:50 UTC · re: Emmanuel Michon · lore

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

Emmanuel Michon <emmanuel_michon@sigmadesigns.com> writes:
> 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 ;-).

dag@cray.com· Aug 31, 2012, 17:54 UTC · re: Junio C Hamano · lore

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

Junio C Hamano <gitster@pobox.com> writes:
> 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
Andreas Schwab· Aug 31, 2012, 18:09 UTC · re: dag@cray.com · lore

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

<dag@cray.com> 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.
-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Jeff King· Aug 31, 2012, 21:43 UTC · re: Andreas Schwab · lore

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

On Fri, Aug 31, 2012 at 08:09:34PM +0200, Andreas Schwab wrote:
Show 8 quoted lines
> <dag@cray.com> 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
dag@cray.com· Aug 31, 2012, 23:03 UTC · re: Jeff King · lore

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

Jeff King <peff@peff.net> writes:
> 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!
> 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
Junio C Hamano· Aug 31, 2012, 18:48 UTC · re: dag@cray.com · lore

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

<dag@cray.com> writes:
Show 7 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
>
>> 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?

← back to recent threads