From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Bash script to update - only make when update there? Date: Tue, 10 Dec 2013 14:31:47 -0500 Message-ID: <8738m0lcyk.fsf@alphaville.bos.redhat.com> References: <52A6D452.3030908@krugs.de> <87eh5klmt0.fsf@alphaville.bos.redhat.com> <52A75EF2.9010502@krugs.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34945) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqT2U-00061E-6l for emacs-orgmode@gnu.org; Tue, 10 Dec 2013 14:32:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VqT2O-0004MD-0b for emacs-orgmode@gnu.org; Tue, 10 Dec 2013 14:32:14 -0500 Received: from plane.gmane.org ([80.91.229.3]:44102) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqT2N-0004M5-RA for emacs-orgmode@gnu.org; Tue, 10 Dec 2013 14:32:07 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VqT2L-0001az-PJ for emacs-orgmode@gnu.org; Tue, 10 Dec 2013 20:32:05 +0100 Received: from nat-pool-bos-t.redhat.com ([66.187.233.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 10 Dec 2013 20:32:05 +0100 Received: from ndokos by nat-pool-bos-t.redhat.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 10 Dec 2013 20:32:05 +0100 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 Rainer M Krug writes: > On 12/10/13, 16:59 , Nick Dokos wrote: >> ... >> Be that as it may, you can try something like this hack (those are >> backticks around the git pull - it's under the ESC key in the upper >> left hand corner on most US keyboards but it may be somewhere else >> on yours): >> >> if [ "`git pull`" == "Already up-to-date" ] then echo "Up to date" >> else make update fi > > True - but if git pull does change the message, I have to change it as > well - I just leave it as it is. > Here for your amusement is a way to get around this problem: if [ "`git pull`" == "`git pull`" ] then echo Up to date else make update fi You pay double the cost every time you use it but if they ever *do* change the message, it's not going to break. But of course, if the shell ever optimizes the second git pull away, you are back at square one... With-tongue-firmly-in-cheek-ly yours, Nick