From: Junio C Hamano Date: Fri, 02 May 2008 18:18:02 GMT Subject: Re: To page or not to page Message-ID: <7v1w4ky3hh.fsf@gitster.siamese.dyndns.org> In-Reply-To: <20080502125553.GB2923@sigill.intra.peff.net> Jeff King writes: > My bigger worry is that this affects only builtins. Which makes it > sufficient for turning off the pager for anything that does USE_PAGER. Hmm. How about doing things this way? - at the beginning of handle_options() remember argv[0] - restructure handle_options() so that it does not run setup_pager() and setenv("GIT_PAGER", "cat", 1) inside the loop, but instead remember what we had on the command line; - after the handle_options() loop, if we saw an explicit --pager, --no-pager, that's the decision; - otherwise: - look at argv[0] to see what the command is; - do the config thing to see if there is user preference; if there is one, that setting decides; - otherwise: - see the built-in defaults; - and finally use or not use pager depending on what we found above. I suspect we would want a similar restructure of handle_options() loop about --git-dir and --git-work-tree so that the loop is only used to decide what to do and action is carried out after the loop exits, but that is a separate topic.