Re: [RFC PATCH 6/8] pager: remove pager_in_use()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 27, 2023, 23:00 UTC
- Message-ID
- <xmqq1qhwfr46.fsf@gitster.g>
- In-Reply-To
- <20230627195251.1973421-7-calvinwan@google.com>
Calvin Wan <calvinwan@google.com> writes:
Show 16 quoted lines
> pager_in_use() is simply a wrapper around
> git_env_bool("GIT_PAGER_IN_USE", 0). Other places that call
> git_env_bool() in this fashion also do not have a wrapper function
> around it. By removing pager_in_use(), we can also get rid of the
> pager.h dependency from a few files.
>
> Signed-off-by: Calvin Wan <calvinwan@google.com>
> ---
> builtin/log.c | 2 +-
> color.c | 2 +-
> column.c | 2 +-
> date.c | 4 ++--
> git.c | 2 +-
> pager.c | 5 -----
> pager.h | 1 -
> 7 files changed, 6 insertions(+), 12 deletions(-)With so many (read: more than 3) callsites, I am not sure if this is an improvement. pager_in_use() cannot be misspelt without getting noticed by compilers, but git_env_bool("GIT_PAGOR_IN_USE", 0) will go silently unnoticed. Is there no other way to lose the dependency you do not like?