From: Junio C Hamano Date: Tue, 28 Feb 2012 19:10:27 GMT Subject: Re: [PATCH v7 02/10] Stop starting pager recursively Message-ID: <7vipiqzsd8.fsf@alter.siamese.dyndns.org> In-Reply-To: <7v4nua25cz.fsf@alter.siamese.dyndns.org> Junio C Hamano writes: > Nguyễn Thái Ngọc Duy writes: > >> git-column can be used as a pager for other git commands, something >> like this: >> >> GIT_PAGER="git -p column --mode='dense color'" git -p branch >> >> The problem with this is that "git -p column" also has $GIT_PAGER >> set so the pager runs itself again as a pager, then again and again. >> >> Stop this. > > A natural question that may come after reading only the above is if "git > column" is the only one that has this problem. In other words, is the > undesirable behaviour you observed caused by a bug in setup_pager() that > needs to be fixed, or should it be fixed in "git column"? Put another way, if there is another git command X that can be used as a filter to the output of a git command Y, do you suffer from the same issue to when you abuse the GIT_PAGER mechanism to pipe the output from Y to X? That is a sure sign that the pager mechanism needs improvement (obviously, an alternative answer could be "don't do that then", though). For example, shortlog is designed to be X for Y=log, i.e. $ git log v1.0.0.. | git shortlog is a perfectly valid way to use the command. I could imagine that this patch may improve the situation if you abuse GIT_PAGER mechanism to implement the above pipeline, i.e. $ GIT_PAGER="git -p shortlog" git log v1.0.0.. Although I never tried it.