emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bash script to update - only make when update there?
@ 2013-12-10  8:44 Rainer M Krug
  2013-12-10 15:59 ` Nick Dokos
  2013-12-10 17:00 ` Achim Gratz
  0 siblings, 2 replies; 12+ messages in thread
From: Rainer M Krug @ 2013-12-10  8:44 UTC (permalink / raw)
  To: emacs-orgmode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

I have a question concerning a bash script to update org (and ess in
the same way but in a different script).

The script I use to update org looks as follow:

#!/bin/sh
cd ~/.emacs.d/org-git

####
#!/bin/sh
git checkout master
make update
####

which works nicely, but I would like to only execute the "make update"
if git updated something - I am sure this is possible, but how?

Thanks,

Rainer

- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer@krugs.de

Skype:      RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSptRSAAoJENvXNx4PUvmCcpMIAI3A8M/YsSmgB8IShrIc12S3
qZSM+jOUdCZaSxs7rA2NMs0J9W9nL+spvZN66c/VS4je75KPxQXeKCmbSsThuoKW
U6kbMQU1lyHiyFFkwq8ZOSYTWisA/X4d4uQ5rT99kfx1uthvLbyMKLvZzvSkxceG
W3+yMKuhiMDT+Rc3Qwuox6+N4YtucJbPkcjJJwKEtSZwIFdVhxRxFxBkGaZhS+Cy
UpMHjyxrtHUjAPVVl7LDng51ps+69kXCi6rf2+rHWwIViErkhytXLMA1IHC63qCc
48QmjFVnHBklcKFZ0MjhQ6EHkg/M+Xjp0UNr4I/QO0k06F8ITTnERIwnIsRpFRk=
=RpCX
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bash script to update - only make when update there?
  2013-12-10  8:44 Bash script to update - only make when update there? Rainer M Krug
@ 2013-12-10 15:59 ` Nick Dokos
  2013-12-10 18:35   ` Rainer M Krug
  2013-12-10 17:00 ` Achim Gratz
  1 sibling, 1 reply; 12+ messages in thread
From: Nick Dokos @ 2013-12-10 15:59 UTC (permalink / raw)
  To: emacs-orgmode

Rainer M Krug <Rainer@krugs.de> writes:

> Hi
>
> I have a question concerning a bash script to update org (and ess in
> the same way but in a different script).
>
> The script I use to update org looks as follow:
>
> #!/bin/sh
> cd ~/.emacs.d/org-git
>
> ####
> #!/bin/sh
> git checkout master
> make update
> ####
>
> which works nicely, but I would like to only execute the "make update"
> if git updated something - I am sure this is possible, but how?
>

It seems to me that the dependencies are not dealt with correctly in the
Makefile, so after the git pull (whether that did anything or not),
``make update'' rebuilds everything. Ideally, it should figure out what
needs rebuilding and just do that - then you wouldn't need anything
more. OTOH, CPU cycles are cheap and rebuilding everything only takes 12
seconds on my laptop, so should we really care?

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

Nick

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bash script to update - only make when update there?
  2013-12-10  8:44 Bash script to update - only make when update there? Rainer M Krug
  2013-12-10 15:59 ` Nick Dokos
@ 2013-12-10 17:00 ` Achim Gratz
  2013-12-10 17:12   ` Achim Gratz
  1 sibling, 1 reply; 12+ messages in thread
From: Achim Gratz @ 2013-12-10 17:00 UTC (permalink / raw)
  To: emacs-orgmode

Rainer M Krug writes:
> git checkout master
> make update

This doesn't update at all since you never do a "git pull" on master.

> which works nicely, but I would like to only execute the "make update"
> if git updated something - I am sure this is possible, but how?

I really don't see why you'd need to use a shell script for that
(instead of adding your own target in local.mk), but that aside you'd
want to compare the SHA1 of your checkout with the SHA1 of your last
install (for instancefrom org-version.el).  If there wasn't an update
these two would be identical.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptation for Waldorf microQ V2.22R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bash script to update - only make when update there?
  2013-12-10 17:00 ` Achim Gratz
@ 2013-12-10 17:12   ` Achim Gratz
  2013-12-10 18:36     ` Rainer M Krug
  0 siblings, 1 reply; 12+ messages in thread
From: Achim Gratz @ 2013-12-10 17:12 UTC (permalink / raw)
  To: emacs-orgmode

Achim Gratz writes:
> Rainer M Krug writes:
>> git checkout master
>> make update
>
> This doesn't update at all since you never do a "git pull" on master.

Scratch that, I was imagining an "update2" where you clearly wrote
"update".  In any case (and to answer Nick Dokos' remark) make always
does a full re-build by design when asked to do an "update" or any of
the other related targets.  The purpose of those targets is to always
end up with a working installation, not to expend the least amount of
work to have something that maybe but not always could work.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptation for Waldorf microQ V2.22R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bash script to update - only make when update there?
  2013-12-10 15:59 ` Nick Dokos
@ 2013-12-10 18:35   ` Rainer M Krug
  2013-12-10 19:31     ` Nick Dokos
  0 siblings, 1 reply; 12+ messages in thread
From: Rainer M Krug @ 2013-12-10 18:35 UTC (permalink / raw)
  To: Nick Dokos, emacs-orgmode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



On 12/10/13, 16:59 , Nick Dokos wrote:
> Rainer M Krug <Rainer@krugs.de> writes:
> 
>> Hi
>> 
>> I have a question concerning a bash script to update org (and ess
>> in the same way but in a different script).
>> 
>> The script I use to update org looks as follow:
>> 
>> #!/bin/sh cd ~/.emacs.d/org-git
>> 
>> #### #!/bin/sh git checkout master make update ####
>> 
>> which works nicely, but I would like to only execute the "make
>> update" if git updated something - I am sure this is possible,
>> but how?
>> 
> 
> It seems to me that the dependencies are not dealt with correctly
> in the Makefile, so after the git pull (whether that did anything
> or not), ``make update'' rebuilds everything. Ideally, it should
> figure out what needs rebuilding and just do that - then you
> wouldn't need anything more. OTOH, CPU cycles are cheap and
> rebuilding everything only takes 12 seconds on my laptop, so should
> we really care?

Well - you are right. Why care?

> 
> 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.

Cheers,

Rainer

> 
> Nick
> 
> 
> 

- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer@krugs.de

Skype:      RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSp17xAAoJENvXNx4PUvmCxYcH/j0n2ap3F7KhWV0BvPBvy1dz
Y3A4RIryZcodwftJdjsulo7bJk465kkWDliojxrLBlRPqdcPLMrT2ZRVFU8T3Bbx
RomZoB3fFntUGQ4OvtsmbGvCZ/mBYFY2ejuMmnxGxtYlgjYatrRdVvviuNTGPIzj
IivWcUXN9k8JJ743NhMHthhQJP/9l6IImhsKysnKNhBHjlQuHiYYmQSipVYoO5ot
pNcE3i8iqlpTzkn2K2LF5wjp5VduvBRCAYyessszsA7CrA4mlC+HNTamF6pG+jZS
2zSsA2l4oTCVtPdnJdp1KnLCb3uqET5YHKL+5OIXxHvsOUbILh6HLIXDAc2g9rg=
=Msa4
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bash script to update - only make when update there?
  2013-12-10 17:12   ` Achim Gratz
@ 2013-12-10 18:36     ` Rainer M Krug
  0 siblings, 0 replies; 12+ messages in thread
From: Rainer M Krug @ 2013-12-10 18:36 UTC (permalink / raw)
  To: Achim Gratz, emacs-orgmode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



On 12/10/13, 18:12 , Achim Gratz wrote:
> Achim Gratz writes:
>> Rainer M Krug writes:
>>> git checkout master make update
>> 
>> This doesn't update at all since you never do a "git pull" on
>> master.
> 
> Scratch that, I was imagining an "update2" where you clearly wrote 
> "update".  In any case (and to answer Nick Dokos' remark) make
> always does a full re-build by design when asked to do an "update"
> or any of the other related targets.  The purpose of those targets
> is to always end up with a working installation, not to expend the
> least amount of work to have something that maybe but not always
> could work.

Well - I will just leave it as it is - never change a working system.

Thanks,
Rainer


> 
> 
> Regards, Achim.
> 

- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer@krugs.de

Skype:      RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSp18tAAoJENvXNx4PUvmCtwoIALbPj2OauNN05dhEA2Lgnb4R
sOARn6H5QhLQR+xtEf7b/FtV856WE3nW2J9eldjVJ1oJFlOQLECGOP34iwD0S7ix
Uispt0MTT51dvhXHy1Bubgpir0WuHhyhSWiBxmeXTCAaz9GvMJeBtVcuzbrp9Puv
+Q5QLjeVSRWqMmA4OjOZKqSlURycRQs6p89ebko6ttTdQg+Ng+VHfiR5RI0B43uC
HKF5PnJOkbwLDc7naNknhPY3YApeQYF5zqlVQdKlmk3OfkT8zzPb9W6g95L+MVok
aqKDDPMWZfVBizE3X32WaSp7iWDtLysoe4X/+RROTbZw0zowN1JhJ5fSz/BUPYo=
=p3gu
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bash script to update - only make when update there?
  2013-12-10 18:35   ` Rainer M Krug
@ 2013-12-10 19:31     ` Nick Dokos
  2013-12-10 19:37       ` Rainer M Krug
  0 siblings, 1 reply; 12+ messages in thread
From: Nick Dokos @ 2013-12-10 19:31 UTC (permalink / raw)
  To: emacs-orgmode

Rainer M Krug <Rainer@krugs.de> 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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bash script to update - only make when update there?
  2013-12-10 19:31     ` Nick Dokos
@ 2013-12-10 19:37       ` Rainer M Krug
  2013-12-10 20:50         ` Samuel Wales
  0 siblings, 1 reply; 12+ messages in thread
From: Rainer M Krug @ 2013-12-10 19:37 UTC (permalink / raw)
  To: emacs-orgmode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



On 12/10/13, 20:31 , Nick Dokos wrote:
> Rainer M Krug <Rainer@krugs.de> 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...

I like it - optimization which not necessarily is faster....

Cheers,

Rainer


> 
> With-tongue-firmly-in-cheek-ly yours, Nick
> 
> 
> 
> 
> 

- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer@krugs.de

Skype:      RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSp22GAAoJENvXNx4PUvmClkoIAONl6ouPeXWJ2PV0spQ4kYIy
egng/Eu5WLIUfsZUHtPAtYTIs39KR2qfUDsuBFsnSG6DUE/HX2TPeTW+GGla+jZ4
gAPKUCRmk8xoOPn2CX5Ue4UPf5rU2UNtuwFhhJyuS9vCE35lo/tC8tGdieAfq9jA
Gm9JAfHlCEjtDZWjnI7l2Qm5pEbe95FZJE+YzXKTbkz+KOGGgthiTETe08BYlxmM
BSnniTU283Zxh/6I4xV5B0M14wFvpnayMSaKu3F53bY/iT2fBkC0qZvklMs+XOjq
z5pnke7k0WgyEZvA7B/XAynLRhwE8NzRG6WyG659IFm+YgGOXouwXLAg5I52vSc=
=CN/p
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bash script to update - only make when update there?
  2013-12-10 19:37       ` Rainer M Krug
@ 2013-12-10 20:50         ` Samuel Wales
  2013-12-12  9:00           ` Rainer M Krug
  0 siblings, 1 reply; 12+ messages in thread
From: Samuel Wales @ 2013-12-10 20:50 UTC (permalink / raw)
  To: Rainer; +Cc: emacs-orgmode

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
}


On 12/10/13, Rainer M Krug <Rainer@krugs.de> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
>
> On 12/10/13, 20:31 , Nick Dokos wrote:
>> Rainer M Krug <Rainer@krugs.de> 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...
>
> I like it - optimization which not necessarily is faster....
>
> Cheers,
>
> Rainer
>
>
>>
>> With-tongue-firmly-in-cheek-ly yours, Nick
>>
>>
>>
>>
>>
>
> - --
> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
> Biology, UCT), Dipl. Phys. (Germany)
>
> Centre of Excellence for Invasion Biology
> Stellenbosch University
> South Africa
>
> Tel :       +33 - (0)9 53 10 27 44
> Cell:       +33 - (0)6 85 62 59 98
> Fax :       +33 - (0)9 58 10 27 44
>
> Fax (D):    +49 - (0)3 21 21 25 22 44
>
> email:      Rainer@krugs.de
>
> Skype:      RMkrug
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQEcBAEBAgAGBQJSp22GAAoJENvXNx4PUvmClkoIAONl6ouPeXWJ2PV0spQ4kYIy
> egng/Eu5WLIUfsZUHtPAtYTIs39KR2qfUDsuBFsnSG6DUE/HX2TPeTW+GGla+jZ4
> gAPKUCRmk8xoOPn2CX5Ue4UPf5rU2UNtuwFhhJyuS9vCE35lo/tC8tGdieAfq9jA
> Gm9JAfHlCEjtDZWjnI7l2Qm5pEbe95FZJE+YzXKTbkz+KOGGgthiTETe08BYlxmM
> BSnniTU283Zxh/6I4xV5B0M14wFvpnayMSaKu3F53bY/iT2fBkC0qZvklMs+XOjq
> z5pnke7k0WgyEZvA7B/XAynLRhwE8NzRG6WyG659IFm+YgGOXouwXLAg5I52vSc=
> =CN/p
> -----END PGP SIGNATURE-----
>
>


-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

The disease DOES progress.  MANY people have died from it.  ANYBODY can get it.

Denmark: free Karina Hansen NOW.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bash script to update - only make when update there?
  2013-12-10 20:50         ` Samuel Wales
@ 2013-12-12  9:00           ` Rainer M Krug
  2013-12-13  0:26             ` Suvayu Ali
  0 siblings, 1 reply; 12+ messages in thread
From: Rainer M Krug @ 2013-12-12  9:00 UTC (permalink / raw)
  To: Samuel Wales; +Cc: emacs-orgmode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



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...

Well - I will stay with my simple update script.

Thanks,

Rainer


> 
> 
> On 12/10/13, Rainer M Krug <Rainer@krugs.de> wrote:
> 
> 
> On 12/10/13, 20:31 , Nick Dokos wrote:
>>>> Rainer M Krug <Rainer@krugs.de> 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...
> 
> I like it - optimization which not necessarily is faster....
> 
> Cheers,
> 
> Rainer
> 
> 
>>>> 
>>>> With-tongue-firmly-in-cheek-ly yours, Nick
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
> 
>> 
>> 
> 
> 

- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer@krugs.de

Skype:      RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSqXsmAAoJENvXNx4PUvmCp5cH/Rif3YwvLrftxJm1loAudCxP
aGeU/iF8pOv6K8b106svUej6efVGa4c4nBO8356V+krX+jJVkzXU8nwcNGusWVFz
aRy6a0TBIm29ySmOAFIOalrXMfFOkSI0yc4MiTFoeGQ4ZSb8Cp6029hxMB+nuZyV
JHpuuFdq7LomIia+jMYtqeIuoKEeizRU8qh+cvYqilFb4i1Rpm9WBlLPbkpMXMiN
yl0R2GP3S8t+5iBm5yqvA8V9v1XsH541b5c+7q29epZSFwJnPXCUd2koLkBKmbrl
3MuAzz3CvTpMhZcf4aptV/1tLUdmWuXQE8FbSZEzWdi+7AakTPOSzb8H+ec278w=
=vgdf
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bash script to update - only make when update there?
  2013-12-12  9:00           ` Rainer M Krug
@ 2013-12-13  0:26             ` Suvayu Ali
  2013-12-13  8:40               ` Rainer M Krug
  0 siblings, 1 reply; 12+ messages in thread
From: Suvayu Ali @ 2013-12-13  0:26 UTC (permalink / raw)
  To: emacs-orgmode

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.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bash script to update - only make when update there?
  2013-12-13  0:26             ` Suvayu Ali
@ 2013-12-13  8:40               ` Rainer M Krug
  0 siblings, 0 replies; 12+ messages in thread
From: Rainer M Krug @ 2013-12-13  8:40 UTC (permalink / raw)
  To: Suvayu Ali, emacs-orgmode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



On 12/13/13, 01:26 , Suvayu Ali wrote:
> 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.
> 

True.

Rainer

- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer@krugs.de

Skype:      RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSqsfnAAoJENvXNx4PUvmCZnYIAMUZWqs3tf9N8dzQ14klAnJQ
1Qq/FCqeU2ZA1n+o+QR4jjqwoo1T3uLQJkIju5Z0jJq8LLKNcI+7ENDIZ2JkjeuA
8iy/bEM27xuf1MhGQCakPsUJUPczo9gx649Za/Jqb9mghRbml3Gn2D770qdv+Pxw
pTTVe7FfXtUbwpR2M5ohlu/3wABsAAOztMxb6uf0Mr3dWrqLzbYfaENK95L13/hJ
85p99ZLXpyqCeAtC8zNnfTcC4/m+GkDI8F4AaD07w6TfdVYFzeqxZgBdn4NZJTn2
RWdZEb0XbZCvIlXzefLsHCAd+/f/GAp03krFkbWGZYNQP5e64THLZ0OBRQL7nM0=
=NhSB
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-12-13  8:40 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-10  8:44 Bash script to update - only make when update there? Rainer M Krug
2013-12-10 15:59 ` Nick Dokos
2013-12-10 18:35   ` Rainer M Krug
2013-12-10 19:31     ` Nick Dokos
2013-12-10 19:37       ` Rainer M Krug
2013-12-10 20:50         ` Samuel Wales
2013-12-12  9:00           ` Rainer M Krug
2013-12-13  0:26             ` Suvayu Ali
2013-12-13  8:40               ` Rainer M Krug
2013-12-10 17:00 ` Achim Gratz
2013-12-10 17:12   ` Achim Gratz
2013-12-10 18:36     ` Rainer M Krug

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).