From mboxrd@z Thu Jan 1 00:00:00 1970 From: Suvayu Ali Subject: Re: Bash script to update - only make when update there? Date: Fri, 13 Dec 2013 01:26:33 +0100 Message-ID: <20131213002633.GA28007@kuru.dyndns-at-home.com> References: <52A6D452.3030908@krugs.de> <87eh5klmt0.fsf@alphaville.bos.redhat.com> <52A75EF2.9010502@krugs.de> <8738m0lcyk.fsf@alphaville.bos.redhat.com> <52A76D86.40103@krugs.de> <52A97B26.6040907@krugs.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48235) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VrGaf-0008FQ-27 for emacs-orgmode@gnu.org; Thu, 12 Dec 2013 19:26:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VrGaW-0003Es-Kg for emacs-orgmode@gnu.org; Thu, 12 Dec 2013 19:26:48 -0500 Received: from mail-wg0-x230.google.com ([2a00:1450:400c:c00::230]:45663) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VrGaW-0003El-Cg for emacs-orgmode@gnu.org; Thu, 12 Dec 2013 19:26:40 -0500 Received: by mail-wg0-f48.google.com with SMTP id z12so1222596wgg.27 for ; Thu, 12 Dec 2013 16:26:38 -0800 (PST) Received: from kuru.dyndns-at-home.com (sd44012d5.adsl.online.nl. [212.64.18.213]) by mx.google.com with ESMTPSA id w1sm2269235wib.6.2013.12.12.16.26.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Dec 2013 16:26:37 -0800 (PST) Content-Disposition: inline In-Reply-To: <52A97B26.6040907@krugs.de> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org On Thu, Dec 12, 2013 at 10:00:22AM +0100, Rainer M Krug wrote: > > On 12/10/13, 21:50 , Samuel Wales wrote: > > gitpullv () { #echo \=== maybe need to grab tags head=`git > > rev-parse --verify HEAD` echo git pull --stat --log | cat echo > > newhead=`git rev-parse --verify HEAD` if [ "$newhead" != "$head" ] > > then git log --pretty=tformat:%s ORIG_HEAD.. | cat # git log > > --pretty=tformat:%s --graph ORIG_HEAD.. echo echo '= you can now do > > git diff ORIG_HEAD -- files pipe tee' return 0 else return 1 fi > > #git gc --auto git status } > > Wow - and I expected a return code from git which I could simply > compare evaluate if there has something updated... A `git pull' without new updates, is still a successful pull. It is a failure only if the remote is unreachable for some reason, or the pull is interrupted midway. -- Suvayu Open source is the future. It sets us free.