Re: [PATCH] git-am: teach git-am to apply a patch to an unborn branch
- From
Jeff King <peff@peff.net>
- Date
- Mar 20, 2009, 04:37 UTC
- 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 <nanako3@lavabit.com>
Thanks for picking up this topic. It looks sane overall.
Show 8 quoted lines
> - 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