Skip to content

first steps towards pager.foo.{command,enable}

Martin Ågren git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4t7006: document that `pager.foo` can be partially preservedt/t7006-pager.sh+18 -00 replies
2/4pager: refactor `pager_command_config()`pager.c+7 -20 replies
3/4pager: introduce `pager.*.command` and `.enable`Documentation/config.txt Documentation/git-tag.txt Documentation/git.txt +2 more+98 -20 replies
4/4pager: make `pager.foo.command` imply `.enable=true`Documentation/config.txt pager.c t/t7006-pager.sh+11 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH/DONOTAPPLY 0/4] first steps towards pager.foo.{command,enable}

I'm not posting this for inclusion (yet), but because I read this:

Quoted 8 lines · Jeff King

- 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/[email protected]/

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

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.

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 there's great value to being able to say "this is the same as this, and that is the same as that", but that might get muddied by "oh, except if you use --paginate".

If someone wants to pick these up and bring them to completion, great! If not and if I or someone else feels confident about which way to go, then I can revisit these.

Martin

Martin Ågren (4):
t7006: document that pager.foo can be partially preserved
pager: refactor pager_command_config()
pager: introduce pager.*.command and .enable
pager: make pager.foo.command imply .enable=true

 Documentation/config.txt  | 19 +++++++++
 Documentation/git-tag.txt |  3 +-
 Documentation/git.txt     |  2 +-
 t/t7006-pager.sh          | 98 +++++++++++++++++++++++++++++++++++++++++++++++
 pager.c                   | 16 +++++++-
 5 files changed, 134 insertions(+), 4 deletions(-)
Signature · 1 line
2.15.0.415.gac1375d7e