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

Re: [PATCH] Enable git rev-list to parse --quiet

From
Nick Andrew <nick@nick-andrew.net>
Date
Jul 18, 2008, 09:20 UTC
Message-ID
<20080718092001.GD16102@mail.local.tull.net>
In-Reply-To
<7v8wvzeojm.fsf@gitster.siamese.dyndns.org>
On Thu, Jul 17, 2008 at 10:42:21PM -0700, Junio C Hamano wrote:
> Thanks for noticing, but this replaces one breakage with another.
> 
> Your new behaviour is a new "tell me if it is an empty set" option, and it
> means quite different thing from what --quiet does.

Fair enough. Yes, I want to find out if it is an empty set. The manpage does say "fully connected" which I interpreted to mean that one set of commits is a subset of the other..

I want to automatically (e.g. in crontab) update a git repo to the latest HEAD from a remote branch ... but with the possibility that the local repo has local changes, and I want no chance of merge failure. In other words, "git fetch remote; git merge origin/master" and only do the merge if it's a fast-forward. If there are any local commits, or local uncommitted changes, then leave the local working tree alone.

So my idea was to use "git rev-list --quiet master ^origin/master" and check the exit code; if zero do "git merge origin/master". Without a working "--quiet" nor exit code I can pipe the output to "wc -l" but is there a more efficient/reliable way to implement the requirement?

Nick.
Previous: Junio C HamanoNext: Johannes Schindelin
Message 4 of 8 in “Enable git rev-list to parse --quiet”
  1. Enable git rev-list to parse --quietNick Andrew, Jul 18, 2008
  2. Junio C HamanoJul 18, 2008
  3. Junio C HamanoJul 18, 2008
  4. Nick AndrewJul 18, 2008
  5. Johannes SchindelinJul 18, 2008
  6. Junio C HamanoJul 20, 2008
  7. Nick AndrewJul 20, 2008
  8. Junio C HamanoJul 20, 2008

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.