bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [patch] (but not for gnulib) squash git diff spurious exit code 1


From: Thien-Thi Nguyen
Subject: Re: [patch] (but not for gnulib) squash git diff spurious exit code 1
Date: Thu, 27 Dec 2007 23:06:20 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)

() Jim Meyering <address@hidden>
() Thu, 27 Dec 2007 22:13:53 +0100

   [test case?]

thanks for looking into this.

below is a script (write to /tmp/z ; chmod +x) that shows little output
and exit code 0 with the patch and spurious "0 files changed" and exit
code 1 without.  i am curious how it behaves w/ other versions of git.

fyi, to simulate "without patch", i actually used the small mod:

  if (! total_files, 0)

which produced a compiler warning (of no consequence).

thi


______________________________________________________
#!/bin/sh
rm -rf /tmp/foo
mkdir /tmp/foo
cd /tmp/foo
git init
echo echo > echo
git add .
git commit -m'one'

sleep 1 # ymmv, munge to taste
touch echo

try ()
{
    git diff-index $1 -p --exit-code HEAD -- echo
    echo $?
}

try      --stat
try --shortstat

# /tmp/z ends here




reply via email to

[Prev in Thread] Current Thread [Next in Thread]