Bug 42088 - git использует less без параметра -F
Summary: git использует less без параметра -F
Status: NEW
Alias: None
Product: Sisyphus
Classification: Development
Component: git (show other bugs)
Version: unstable
Hardware: x86 Linux
: P5 normal
Assignee: placeholder@altlinux.org
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-09 23:02 MSK by makise-homura
Modified: 2022-04-03 20:55 MSK (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description makise-homura 2022-03-09 23:02:59 MSK
Во всех дистрибутивах, с которыми я работал (Debian, Ubuntu, OS Elbrus, CentOS) git использует пейджер в режиме -F, т.е., если вывод помещается на экран, то он выводится просто, если нет - то less его показывает в режиме пейджера. Но для Alt Linux это неверно - less всегда показывает любой вывод в режиме пейджера. Я так понял, что это из-за задания переменной LESS в /etc/profile.d/less.sh как -MM (при замене -MM на "-MM -F" git начинает работать как надо в привычном режиме).

Собственно, вопросы следующие:
1) Не стоило бы это починить в дистрибутиве, а не только локально у меня на машине?
2) Если да, то нет ли более красивого пути это сделать?
3) Если нет, то где бы это документировать, чтобы другим не пришлось полчаса искать причину, как мне?
Comment 1 Dmitry V. Levin 2022-03-09 23:12:58 MSK
git(1):
       GIT_PAGER
           This environment variable overrides $PAGER. If it is set to an empty string or to the value "cat", Git will not launch a pager. See also the core.pager option in git-config(1).

git-config(1):
       core.pager
           Text viewer for use by Git commands (e.g., less). The value is meant to be interpreted by the shell. The order of preference is the $GIT_PAGER environment variable, then core.pager configuration, then $PAGER, and then the default chosen at compile time (usually less).
           When the LESS environment variable is unset, Git sets it to RS (if LESS environment variable is set, Git does not change it at all). If you want to selectively override Git’s default setting for LESS, you can set core.pager to e.g. less -X. This will be passed to the shell by Git, which will translate the final command to LESS=RS less -X. The environment does not set the X option but the command line does, instructing less to truncate long lines. Similarly, setting core.pager to less -+F will deactivate the F option specified by the environment from the command-line, deactivating the "quit if one screen" behavior of less. One can specifically activate some flags for particular commands: for example, setting pager.blame to less -X enables line truncation only for git blame.
Comment 2 Michael Shigorin 2022-04-03 19:30:42 MSK
Оно-то да, но из коробки и впрямь хорошо бы в PAGER и MANPAGER (а может, и сразу в гитовом core.pager) видеть less -F.  Попробовал и уже привыкаю.
Comment 3 Dmitry V. Levin 2022-04-03 20:55:16 MSK
О вкусах не спорят. :)