Subject: Re: [PATCH v2 3/3] rebase: rebasing can also be done when HEAD is detached

From: Junio C Hamano <[email-masked]>
Date: Tue, 28 Nov 2017 11:31:47 +0900

Kaartic Sivaraam <[email-masked]> writes:

> +		if test "$branch_or_commit" = "HEAD" &&
> +			 !(git symbolic-ref -q HEAD)

Did you need a subshell here?  Now with a proper test with
"symbolic-ref -q HEAD", I wonder if you'd need to check if the
original was named HEAD in the first place (I do not feel strongly
enough to say that checking is wrong, at least not yet, but the
above does make me wonder), and instead something like

	if ! git symbolic-ref -q HEAD
	then
		...

might be sufficient.  I dunno.

I find what 2/3 and 3/3 want to do quite sensible.  They depend on
1/3, which I find is more a needless churn than a clean-up, which is
unfortunate, though.

Thanks.