git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: "Martin Ågren" <martin.agren@gmail.com>
Cc: git@vger.kernel.org, hkleynhans@bloomberg.net,
	Thomas Gummerer <t.gummerer@gmail.com>
Subject: Re: [PATCH/DONOTAPPLY 0/4] first steps towards pager.foo.{command,enable}
Date: Mon, 6 Nov 2017 05:48:01 -0500	[thread overview]
Message-ID: <20171106104801.73n27fgmn43y6m3v@sigill.intra.peff.net> (raw)
In-Reply-To: <cover.1509879269.git.martin.agren@gmail.com>

On Sun, Nov 05, 2017 at 12:58:18PM +0100, Martin Ågren wrote:

> On 4 November 2017 at 10:28, Jeff King <peff@peff.net> wrote:
> >  - the pager.<cmd> config is mis-designed, because our config keys
> >    cannot represent all possible command names (e.g., case folding and
> >    illegal characters). This should be pager.<cmd>.enable or similar.
> >    Some discussion in (this message and the surrounding thread):
> >
> >      https://public-inbox.org/git/20170711101942.h2uwxtgzvgguzivu@sigill.intra.peff.net/
> >
> >    But I think you could find more by searching the archive.
> 
> I'm posting four patches I have on this to save others from redoing my
> work and findings. These patches feel a bit incomplete, which is why I
> put them to the side some time ago (and eventually forgot about them).

Thanks for sharing these; it's nice if we can avoid duplicating work.
We'll see if somebody at the event wants to pick up this topic.

> In particular, they do not teach `--paginate` to use the pager
> configured by `pager.foo.command`. It is already now possible to use
> `pager.foo` to say "I don't want you to page, but if I later give you
> `pager.foo=true`, this is the pager I want you to use". That does not
> work with `--paginate`, but this can all be explained -- indeed, we
> document that `--paginate` overrules `pager.foo`.

Hmm. I think the current behavior is actually buggy. I assume the
documentation you mean is from git.txt:

  --paginate::
          Pipe all output into 'less' (or if set, $PAGER) if standard
          output is a terminal.  This overrides the `pager.<cmd>`
          configuration options (see the "Configuration Mechanism" section
          below).

That comes from 06300d9753 (git.1: Clarify the behavior of the
--paginate option, 2010-02-14). But I think that commit was just trying
to clarify that "--paginate" overrides the defaults and config, but not
does say "always paginate".

I suspect nobody really noticed it in practice because once you've
configured "pager.foo", there's basically no need to ever use
"--paginate".

> If we teach `--paginate` to respect `pager.foo.command`, it seems that
> we would either 1) introduce a small (and possibly hard to understand
> and explain) difference between the old-style and the new-style
> pager-configuration or 2) knowingly change the behavior of `--paginate`
> with `pager.foo` or 3) knowingly change the behavior of
> `pager.foo=false` as documented in the first patch.

I think I'm suggesting (2), then.

-Peff

  parent reply	other threads:[~2017-11-06 10:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-01 16:36 Git Open Source Weekend London 11th/12th November Thomas Gummerer
2017-11-04  9:28 ` Jeff King
2017-11-04 17:15   ` Philip Oakley
2017-11-05 11:58   ` [PATCH/DONOTAPPLY 0/4] first steps towards pager.foo.{command,enable} Martin Ågren
2017-11-05 11:58     ` [PATCH 1/4] t7006: document that `pager.foo` can be partially preserved Martin Ågren
2017-11-05 11:58     ` [PATCH 2/4] pager: refactor `pager_command_config()` Martin Ågren
2017-11-05 11:58     ` [PATCH 3/4] pager: introduce `pager.*.command` and `.enable` Martin Ågren
2017-11-05 11:58     ` [PATCH 4/4] pager: make `pager.foo.command` imply `.enable=true` Martin Ågren
2017-11-06 10:48     ` Jeff King [this message]
2017-11-07 20:46       ` [PATCH/DONOTAPPLY 0/4] first steps towards pager.foo.{command,enable} Martin Ågren
2017-11-05 12:42 ` Git Open Source Weekend London 11th/12th November Patrick Steinhardt

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20171106104801.73n27fgmn43y6m3v@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=hkleynhans@bloomberg.net \
    --cc=martin.agren@gmail.com \
    --cc=t.gummerer@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).