Re: [PATCH] git-am: teach git-am to apply a patch to an unborn branch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 20, 2009 at 07:12:31AM +0900, Nanako Shiraishi wrote:

> Signed-off-by: Nanako Shiraishi <nanako3@xxxxxxxxxxx>

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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux