Re: [PATCH] Allow git-diff exit with codes similar to diff(1)
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Mar 14, 2007, 01:38 UTC
- Message-ID
- <Pine.LNX.4.63.0703140237270.22628@wbgn013.biozentrum.uni-wuerzburg.de>
- In-Reply-To
- <Pine.LNX.4.64.0703131831390.9690@woody.linux-foundation.org>
Hi,
On Tue, 13 Mar 2007, Linus Torvalds wrote:
Show 16 quoted lines
> 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 thing is, most people do not realize that
git diff file1 file2
_will_ execute a pager. As foreground process. And the return value is that of the pager.
Ciao, Dscho