From: Frans Pop Date: Wed, 27 Jan 2010 15:39:43 GMT Subject: Re: Testing if a certain commit is in the current branch Message-ID: <201001271639.44167.elendil@planet.nl> In-Reply-To: On Wednesday 27 January 2010, Dale Farnsworth wrote: > I've been using the following. It produces output only if the commit > is NOT in HEAD. > > git rev-list -1 ^HEAD commitID Nice. That does work. Returns 0 in both cases and you'd need to allow for nonexisting commit IDs, so you'd get: test -z "$(git rev-list -1 ^HEAD 2>/dev/null)" Time needed looks to be slightly faster than Junio's test. Thanks, FJP