git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Anatoly Borodin <anatoly.borodin@gmail.com>, git@vger.kernel.org
Subject: Re: Bug: pager.<cmd> doesn't work well with editors
Date: Thu, 22 Sep 2016 23:49:28 -0400	[thread overview]
Message-ID: <20160923034928.dneomzokebkuxg4z@sigill.intra.peff.net> (raw)
In-Reply-To: <xmqqfuor6ee3.fsf@gitster.mtv.corp.google.com>

On Thu, Sep 22, 2016 at 10:19:32AM -0700, Junio C Hamano wrote:

> The level at which configurability happens might be one issue
> (i.e. you may want different pager for two operating modes for the
> same command, hence your need to use "tag.list" not just "tag"), but
> I think another issue is that it conflates if the output need to be
> paged (on/off) and what pager should be used when the output is
> paged.  When we see that a user sets "pager.tag", we should not have
> made it an instruction to Git that _all_ output from "git tag" must
> be paged.

Yes, we could have done it the other way, but I think this was a natural
consequence of implementing it git.c. It _only_ knows about "all output
from git-tag" and nothing else.

At any rate, I do not see much point in moving away from it even if we
change the underlying implementation to be more flexible, if only
because it would be a gratuitous incompatibility.

> So I think we are fundamentally on the same page; it is just you are
> aiming higher than I was, but we both recognize the need for separate 
> codepaths in a single command to decide if the output should be paged.

Yeah. In my examples there are really two proposed improvements:

  1. The decision over whether and when to start a pager is pushed down
     from git.c into individual commands.

  2. As a side effect of (1), commands must declare "this is who I am"
     to look up the correct config.  But "who I am" no longer needs to
     be a whole command, so we are free to slice up the namespace more
     finely. But we do not have to.

     This might also be an opportunity to add more conditions. Like "run
     the pager if I am doing log output with -p, but not otherwise" or
     something. I dunno. That does not sound useful to me, but maybe
     somebody else would find it so.

And I think you are getting at a (3), which is something like:

  3. The config namespace can be made richer, so that "whether" and
     "how" are split. E.g., "pager.log.command" and "pager.log.enabled"
     or something.

     I do not mind that, but we would probably want to keep "pager.log"
     for compatibility, at which point I wonder if the new system is
     worth the bother.

-Peff

      reply	other threads:[~2016-09-23  3:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-18 15:28 Bug: pager.<cmd> doesn't work well with editors Anatoly Borodin
2016-09-18 15:51 ` Anatoly Borodin
2016-09-19 16:03   ` Junio C Hamano
2016-09-20  1:47     ` Jeff King
2016-09-21 16:15       ` Junio C Hamano
2016-09-22  6:47         ` Jeff King
2016-09-22 17:19           ` Junio C Hamano
2016-09-23  3:49             ` Jeff King [this message]

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=20160923034928.dneomzokebkuxg4z@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=anatoly.borodin@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).