From: Jeff King Date: Fri, 20 Mar 2009 04:37:52 GMT Subject: Re: [PATCH] git-am: teach git-am to apply a patch to an unborn branch Message-ID: <20090320043752.GA27160@coredump.intra.peff.net> In-Reply-To: <20090320071231.6117@nanako3.lavabit.com> On Fri, Mar 20, 2009 at 07:12:31AM +0900, Nanako Shiraishi wrote: > Signed-off-by: Nanako Shiraishi Thanks for picking up this topic. It looks sane overall. > - parent=$(git rev-parse --verify HEAD) && > + if parent=$(git rev-parse --verify -q HEAD) > + then > + pparent="-p $parent" > + else > + echo >&2 "applying to an empty history" > + parent= pparent= > + fi && Note that the '&&' here is now pointless, since one side of the conditional will always be true. We are losing the ability to detect errors besides "HEAD does not point to a valid object", but I don't think there is a way to tell the difference from the exit code of rev-parse. -Peff