[PATCH v2] release.sh: use git-diff --quiet instead of git status

Gaetan Nadon memsize at videotron.ca
Wed May 12 06:18:54 PDT 2010


On Wed, 2010-05-12 at 10:19 +1000, Peter Hutterer wrote:

> git status in git-1.7 always returns 0, regardless of the number of
> uncommitted changes [1]. This breaks the current script. Replace with a git
> diff --quiet HEAD instead, that's sufficient for our use-case here.
> 
> [1] commit 9e4b7ab6525 "git status: not "commit --dry-run" anymore"
>     in the git source tree
> 
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> ---
>  release.sh |    7 +------
>  1 files changed, 1 insertions(+), 6 deletions(-)
> 
> diff --git a/release.sh b/release.sh
> index c8461fc..ec52f9a 100755
> --- a/release.sh
> +++ b/release.sh
> @@ -124,15 +124,10 @@ done
>  # Check for uncommitted/queued changes.
>  if [ "x$ignorechanges" != "x1" ]; then
>      set +e
> -    git diff --exit-code > /dev/null 2>&1
> +    git diff --quiet HEAD > /dev/null 2>&1
>      if [ $? -ne 0 ]; then
>          abort_for_changes
>      fi
> -git version 1.6.0.4
> -    git status > /dev/null 2>&1
> -    if [ $? -eq 0 ]; thengit version 1.6.0.4
> -        abort_for_changes
> -    fi
>      set -e
>  fi
>  


The new git command works as advertised.

Tested-by: Gaetan Nadon <memsize at videotron.ca>
git version 1.6.0.4

git status --porcelain did not work for me anyway.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100512/02f5f974/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100512/02f5f974/attachment.pgp>


More information about the xorg-devel mailing list