Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass --allow-unrelated-histories to git merge if git version >= 2.9 where it is needed. #102

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions checkout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -259,15 +259,18 @@ githubdate ()
hubdateonebranch sys kernel
hubdateonebranch usr user

GIT_VERSION=`git --version | cut -d' ' -f 3`
version_le "2.9" "${GIT_VERSION}" && GIT_AUH="--allow-unrelated-histories"

${GIT} checkout appstack-src
${GIT} merge --no-edit kernel-src user-src
${GIT} merge --no-edit ${GIT_AUH} kernel-src user-src

${GIT} checkout all-src
${GIT} merge --no-edit kernel-src user-src posix-src
${GIT} merge --no-edit ${GIT_AUH} kernel-src user-src posix-src

# buildrump-src revision gets embedded in buildrump.sh
${GIT} checkout buildrump-src
${GIT} merge --no-edit kernel-src posix-src
${GIT} merge --no-edit ${GIT_AUH} kernel-src posix-src
gitsrcrev=$(${GIT} rev-parse HEAD)

${GIT} checkout master
Expand Down
18 changes: 18 additions & 0 deletions subr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,21 @@ userincludes ()
done
echo '>> done installing headers'
}

version_le ()
{
VS0="$1"
VS1="$2"
while true; do
vs0="${VS0%%.*}"
[ "${VS0}" = "${VS0#*.}" ] && VS0="" || VS0="${VS0#*.}"
vs1="${VS1%%.*}"
[ "${VS1}" = "${VS1#*.}" ] && VS1="" || VS1="${VS1#*.}"
[ "${vs0}" -lt "${vs1}" ] && return 0
[ "${vs0}" -gt "${vs1}" ] && return 1
[ -z "${VS0}" -a -z "${VS1}" ] && return 0
[ -z "${VS0}" ] && return 0
[ -z "${VS1}" ] && return 1
done
}