git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How can I tell if anything was fetched?

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Oct 12, 2012, 06:28 UTC
Message-ID
<5077B88E.5060303@viscovery.net>
In-Reply-To
<CAFRB3XkueafikCvwzBb+WOAG_1mEkVg1Yt6=teOuVwYd2zWVOw@mail.gmail.com>
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
Previous: Jeff King
Message 5 of 5 in “How can I tell if anything was fetched?”
  1. Phil LawrenceOct 11, 2012
  2. Andreas SchwabOct 11, 2012
  3. Enrico WeigeltOct 11, 2012
  4. Jeff KingOct 12, 2012
  5. Johannes SixtOct 12, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.