From: Linus Torvalds Date: Wed, 14 Mar 2007 01:34:02 GMT Subject: Re: [PATCH] Allow git-diff exit with codes similar to diff(1) Message-ID: In-Reply-To: On Wed, 14 Mar 2007, Johannes Schindelin wrote: > > So, big master to hom everybody bows, how to return the correct value when > executing a pager? Because this _has_ to be done if we go that way. Why? If you execute the pager, nobody cares about the error value anyway. I don't see why you would mix in a pager here. If you do diff -u file1 file2 | less -S the return value of the pipe will not only generally be totally uninteresting and never used, but it will be the return value of "less" anyway. Which is what we'd get quite naturally. The return value of "git diff" really only is sensibly and meaningful when you use it in a script *without* a pager (whether built-in or not). Linus