Re: How can I tell if anything was fetched?

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

 



Am 10/11/2012 18:25, schrieb Phil Lawrence:
> What is the best way to know whether or not anything was received
> during the fetch?  I don't want to be stuck trying to parse the answer
> out of STDOUT and STDERR...

what="--all"	 # or "--remotes=the-remote"
presha1s=$(git rev-parse $what)
git fetch the-remote
if test -z "$(git rev-list -1 $what --not $presha1s)"
then
	echo nothing new
fi

Error checking is left as an exercise for the user ;)

-- Hannes
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]