Re: [PATCH] pull: require choice between rebase/merge on non-fast-forward pull

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

 



John Keeping <john@xxxxxxxxxxxxx> writes:

> On Thu, Jun 27, 2013 at 12:48:52PM -0700, Junio C Hamano wrote:
>> diff --git a/git-pull.sh b/git-pull.sh
>> index 638aabb..4a6a863 100755
>> --- a/git-pull.sh
>> +++ b/git-pull.sh
>> @@ -264,6 +274,30 @@ case "$merge_head" in
>>  		die "$(gettext "Cannot rebase onto multiple branches")"
>>  	fi
>>  	;;
>> +*)
>> +	# integrating with a single other history
>> +	merge_head=${merge_head% }
>> +	if test -z "$rebase$no_ff$ff_only${squash#--no-squash}" &&
>> +		test -n "$orig_head" &&
>> +		! $(git merge-base --is-ancestor "$orig_head" "$merge_head")
>
> I think this needs to be:
>
> 	! $(git merge-base --is-ancestor "$orig_head" "$merge_head" ||
> 	    git merge-base --is-ancestor "$merge_head" "$orig_head")

Neither makes sense.  You want to check the exit status of git
merge-base --is-ancestor, not execute its (empty) output as a command.

Andreas.

-- 
Andreas Schwab, schwab@xxxxxxxxxxxxxx
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
--
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]