From: Martin Ågren Date: Wed, 2 Aug 2017 19:40:51 +0000 (+0200) Subject: git.c: provide setup_auto_pager() X-Git-Tag: v2.14.2~40^2~4 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/033fe3d92ca16c36fb45ed7cb58d42344088e7bd?ds=inline;hp=033fe3d92ca16c36fb45ed7cb58d42344088e7bd git.c: provide setup_auto_pager() The previous patch introduced a way for builtins to declare that they will take responsibility for handling the `pager.foo`-config item. (See the commit message of that patch for why that could be useful.) Provide setup_auto_pager(), which builtins can call in order to handle `pager.`, including possibly starting the pager. Make this function don't do anything if a pager has already been started, as indicated by use_pager or pager_in_use(). Whenever this function is called from a builtin, git.c will already have called commit_pager_choice(). Since commit_pager_choice() treats the special value -1 as "punt" or "not yet decided", it is not a problem that we might end up calling commit_pager_choice() once in git.c and once (or more) in the builtin. Make the new function use -1 in the same way and document it as "punt". Don't add any users of setup_auto_pager just yet, one will follow in a later patch. Suggested-by: Jeff King Signed-off-by: Martin Ågren Signed-off-by: Junio C Hamano ---