git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 0/7] tag: more fine-grained pager-configuration
@ 2017-07-10 21:55 Martin Ågren
  2017-07-10 21:55 ` [PATCH 1/7] api-builtin.txt: document SUPPORT_SUPER_PREFIX Martin Ågren
                   ` (9 more replies)
  0 siblings, 10 replies; 69+ messages in thread
From: Martin Ågren @ 2017-07-10 21:55 UTC (permalink / raw)
  To: git
  Cc: Jeff King, Jonathan Nieder, Nguyễn Thái Ngọc Duy,
	Brandon Williams

Using, e.g., `git -c pager.tag tag -a new-tag` results in errors such as "Vim: Warning: Output is not to a terminal" and a garbled terminal. A user who makes use of `git tag -a` and `git tag -l` will probably choose not to configure `pager.tag` or to set it to "no", so that `git tag -a` will actually work, at the cost of not getting the pager with `git tag -l`.

In the discussion at [1], it was brought up that 1) the individual builtins should be in charge of setting up the paging (as opposed to git.c which has no knowledge about what the command is about to do) and that 2) there could then be a configuration `pager.tag.list` to address the specific problem of `git tag`.

This is an attempt to implement something like that. I decided to let `pager.tag.list` fall back to `pager.tag` before falling back to "on". The default for `pager.tag` is still "off". I can see how that might seem confusing. However, my argument is that it would be awkward for `git tag -l` to ignore `pager.tag` -- we are after all running a subcommand of `git tag`. Also, this avoids a regression for someone who has set `pager.tag` and uses `git tag -l`.

I am not moving all builtins to handling the pager on their own, but instead introduce a flag IGNORE_PAGER_CONFIG and use it only with the tag builtin. That means there's another flag to reason about, but it avoids moving all builtins to handling the paging themselves just to make one of them do something more "clever".

The discussion mentioned above discusses various approaches. It also notes how the current pager.foo-configuration conflates _whether_ and _how_ to run a pager. Arguably, this series paints ourselves even further into that corner. The idea of `pager.foo.command` and `pager.foo.enabled` has been mentioned and this series might make such an approach slightly less clean, conceptually. We could introduce `paging.foo` as a "yes"/"no"/"maybe" to go alongside `pager.foo` which is then "less"/"cat"/.... That's definitely outside this series, but should not be prohibited by it...

A review would be much appreciated. Comments on the way I structured the series would be just as welcome as ones on the final result.

Martin

[1] https://public-inbox.org/git/nrmbrl$hsk$1@blaine.gmane.org/T/

Martin Ågren (7):
  api-builtin.txt: document SUPPORT_SUPER_PREFIX
  git.c: let builtins opt for handling `pager.foo` themselves
  git.c: provide setup_auto_pager()
  t7006: add tests for how git tag paginates
  tag: handle `pager.tag`-configuration within the builtin
  tag: make git tag -l consider new config `pager.tag.list`
  tag: make git tag -l use pager by default

 Documentation/git-tag.txt               |  4 +++
 Documentation/technical/api-builtin.txt | 10 ++++++
 builtin.h                               | 14 +++++++++
 builtin/tag.c                           |  4 +++
 git.c                                   | 44 +++++++++++++++++++++++++--
 t/t7006-pager.sh                        | 54 +++++++++++++++++++++++++++++++++
 6 files changed, 127 insertions(+), 3 deletions(-)

-- 
2.13.2.653.gfb5159d


^ permalink raw reply	[flat|nested] 69+ messages in thread

end of thread, other threads:[~2017-08-04 16:42 UTC | newest]

Thread overview: 69+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-10 21:55 [PATCH 0/7] tag: more fine-grained pager-configuration Martin Ågren
2017-07-10 21:55 ` [PATCH 1/7] api-builtin.txt: document SUPPORT_SUPER_PREFIX Martin Ågren
2017-07-10 22:50   ` Brandon Williams
2017-07-11  6:32     ` Martin Ågren
2017-07-11 18:23       ` Brandon Williams
2017-07-10 21:55 ` [PATCH 2/7] git.c: let builtins opt for handling `pager.foo` themselves Martin Ågren
2017-07-11 10:24   ` Jeff King
2017-07-11 13:46     ` Martin Ågren
2017-07-11 13:54       ` Jeff King
2017-07-10 21:55 ` [PATCH 3/7] git.c: provide setup_auto_pager() Martin Ågren
2017-07-11 10:37   ` Jeff King
2017-07-11 13:47     ` Martin Ågren
2017-07-10 21:55 ` [PATCH 4/7] t7006: add tests for how git tag paginates Martin Ågren
2017-07-10 21:55 ` [PATCH 5/7] tag: handle `pager.tag`-configuration within the builtin Martin Ågren
2017-07-11 10:38   ` Jeff King
2017-07-10 21:55 ` [PATCH 6/7] tag: make git tag -l consider new config `pager.tag.list` Martin Ågren
2017-07-11 10:41   ` Jeff King
2017-07-11 13:48     ` Martin Ågren
2017-07-10 21:55 ` [PATCH 7/7] tag: make git tag -l use pager by default Martin Ågren
2017-07-11 10:44   ` Jeff King
2017-07-10 22:42 ` [PATCH 0/7] tag: more fine-grained pager-configuration Junio C Hamano
2017-07-11 10:47   ` Jeff King
2017-07-11 16:05     ` Junio C Hamano
2017-07-12  7:29   ` Martin Ågren
2017-07-11 10:19 ` Jeff King
2017-07-11 13:50   ` Martin Ågren
2017-07-11 14:08     ` Jeff King
2017-07-17 20:10 ` [PATCH v2 00/10] tag: only respect `pager.tag` in list-mode Martin Ågren
2017-07-17 20:10   ` [PATCH v2 01/10] builtin.h: take over documentation from api-builtin.txt Martin Ågren
2017-07-17 20:10   ` [PATCH v2 02/10] builtin.h: format documentation-comment properly Martin Ågren
2017-07-17 20:10   ` [PATCH v2 03/10] builtin.h: document SUPPORT_SUPER_PREFIX Martin Ågren
2017-07-17 20:10   ` [PATCH v2 04/10] git.c: let builtins opt for handling `pager.foo` themselves Martin Ågren
2017-07-17 20:10   ` [PATCH v2 05/10] git.c: provide setup_auto_pager() Martin Ågren
2017-07-31  3:34     ` Jeff King
2017-07-31 16:32       ` Junio C Hamano
2017-07-17 20:10   ` [PATCH v2 06/10] t7006: add tests for how git tag paginates Martin Ågren
2017-07-31  3:38     ` Jeff King
2017-07-31 16:37       ` Junio C Hamano
2017-07-31 17:50         ` Martin Ågren
2017-07-17 20:10   ` [PATCH v2 07/10] tag: handle `pager.tag`-configuration within the builtin Martin Ågren
2017-07-17 20:10   ` [PATCH v2 08/10] tag: respect `pager.tag` in list-mode only Martin Ågren
2017-07-31  3:40     ` Jeff King
2017-07-17 20:10   ` [PATCH v2 09/10] tag: change default of `pager.tag` to "on" Martin Ågren
2017-07-17 20:10   ` [PATCH v2 10/10] git.c: ignore pager.* when launching builtin as dashed external Martin Ågren
2017-07-31  3:45     ` Jeff King
2017-07-31 17:42       ` Martin Ågren
2017-07-18 19:13   ` [PATCH v2 00/10] tag: only respect `pager.tag` in list-mode Junio C Hamano
2017-07-20 22:27   ` Junio C Hamano
2017-07-23 18:17     ` Martin Ågren
2017-07-31  3:46       ` Jeff King
2017-07-31 17:44         ` Martin Ågren
2017-07-31 17:45           ` Jeff King
2017-07-31 20:10             ` Junio C Hamano
2017-08-02 19:40   ` [PATCH v3 0/7] " Martin Ågren
2017-08-02 19:40     ` [PATCH v3 1/7] builtin.h: take over documentation from api-builtin.txt Martin Ågren
2017-08-03 17:44       ` Junio C Hamano
2017-08-04  4:18         ` Martin Ågren
2017-08-04 16:00           ` Junio C Hamano
2017-08-04 16:42             ` Martin Ågren
2017-08-02 19:40     ` [PATCH v3 2/7] git.c: let builtins opt for handling `pager.foo` themselves Martin Ågren
2017-08-02 19:40     ` [PATCH v3 3/7] git.c: provide setup_auto_pager() Martin Ågren
2017-08-02 19:40     ` [PATCH v3 4/7] t7006: add tests for how git tag paginates Martin Ågren
2017-08-02 19:40     ` [PATCH v3 5/7] tag: respect `pager.tag` in list-mode only Martin Ågren
2017-08-02 19:40     ` [PATCH v3 6/7] tag: change default of `pager.tag` to "on" Martin Ågren
2017-08-02 19:40     ` [PATCH v3 7/7] git.c: ignore pager.* when launching builtin as dashed external Martin Ågren
2017-08-03 18:20     ` [PATCH v3 0/7] tag: only respect `pager.tag` in list-mode Junio C Hamano
2017-08-03 19:29     ` Jeff King
2017-08-04  4:21       ` Martin Ågren
2017-08-04  4:59         ` Jeff King

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).