Re: What's cooking in git.git (Jan 2010, #01; Mon, 04)

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

 



Hi,

On Wed, 6 Jan 2010, Nanako Shiraishi wrote:

> diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
> index 23ded48..d42cc4f 100755
> --- a/git-rebase--interactive.sh
> +++ b/git-rebase--interactive.sh
> @@ -482,6 +482,25 @@ get_saved_options () {
>  	test -f "$DOTEST"/rebase-root && REBASE_ROOT=t
>  }
>  
> +LF='
> +'
> +parse_onto () {
> +	if	expr "$1" : '.*\.\.\.' >/dev/null &&
> +		left=${1%...*} right=${1#*...} &&
> +		: ${left:=HEAD} ${right:=HEAD} &&
> +		onto=$(git merge-base "$left" "$right")
> +	then
> +		case "$onto" in
> +		?*"$LF"?* | '')
> +			exit 1 ;;
> +		esac
> +		echo "$onto"
> +		exit 0
> +	else
> +		git rev-parse --verify "$1^0"
> +	fi
> +}

It might be easier to understand like this:

	case "$1" in
	*...*)
		left=${1%...*} &&
		right=${1#*...} &&
		onto="$(git merge-base "${left:-HEAD}" "${right:-HEAD}")" &&
		test ! -z "$onto" &&
		echo "$onto"
	;;
	*)
		git rev-parse --verify "$1^0"
	;;
	esac

Besides, why do you change the "$1" to "$1^0"?
		
> diff --git a/git-rebase.sh b/git-rebase.sh
> index 6503113..43c62c0 100755
> --- a/git-rebase.sh
> +++ b/git-rebase.sh

I would separate the patches.  rebase.sh and rebase--interactive.sh are 
fundamentally different.

Thanks,
Dscho

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