Re: [PATCH v14 5/8] bisect: introduce --no-checkout support into porcelain.

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

 



Jon Seymour <jon.seymour@xxxxxxxxx> writes:

> +	BISECT_MODE=
>  	while [ $# -gt 0 ]; do
>  	    arg="$1"
>  	    case "$arg" in
> @@ -76,6 +79,11 @@ bisect_start() {
>  		shift
>  		break
>  		;;
> +	    --no-checkout)
> +		BISECT_MODE=--no-checkout;
> +		shift ;;
> +	    --*)
> +		die "$(eval_gettext "unrecognised option: '\$arg'")" ;;
>  	    *)
>  		rev=$(git rev-parse -q --verify "$arg^{commit}") || {
>  		    test $has_double_dash -eq 1 &&
> @@ -107,7 +115,11 @@ bisect_start() {
>  	then
>  		# Reset to the rev from where we started.
>  		start_head=$(cat "$GIT_DIR/BISECT_START")
> -		git checkout "$start_head" -- || exit
> +		if test "$BISECT_MODE" = "--no-checkout"; then
> +		    git update-ref --no-deref HEAD "$start_head"
> +		else
> +		    git checkout "$start_head" --
> +		fi

Just a minor worry but I would not be surprised if somebody's "test"
implementation barfs upon:

	test "--no-checkout" = "--no-checkout"

mistaking the string with a dash at the beginning as an option unknown to
it. That is why we often have "z$variable" in our comparison, like so:

	if test "z$BISECT_MODE" = "z--no-checkout"
        then
        	git update-ref --no-deref BISECT_HEAD "$start_head"
	else
        	git checkout "$start_head" --
	fi

> -	git rev-parse --sq-quote "$@" >"$GIT_DIR/BISECT_NAMES" &&
> +	git rev-parse --sq-quote "$@" >"$GIT_DIR/BISECT_NAMES"
> +	echo "$BISECT_MODE" > "$GIT_DIR/BISECT_MODE" &&

&&?
--
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]