Procházet zdrojové kódy

Commit and push everything before a conflicting commit

Change-Id: Ifdc45e2b0f540ac8212aaca835b9d11c18078eb5
tags/7.1.0
Leif Åstrand před 11 roky
rodič
revize
5a9303869c
1 změnil soubory, kde provedl 23 přidání a 3 odebrání
  1. 23
    3
      scripts/automerge7.sh

+ 23
- 3
scripts/automerge7.sh Zobrazit soubor

pushMerged pushMerged
} }


can_merge() {
commit=$1
git merge --no-commit --no-ff $commit > /dev/null 2>&1
result=$?
git reset --hard HEAD > /dev/null 2>&1
return $result
}

nothingToCommit=`git status | grep "nothing to commit"` nothingToCommit=`git status | grep "nothing to commit"`
if [ "$nothingToCommit" == "" ] if [ "$nothingToCommit" == "" ]
then then
commitMsg=`git log -n 1 --format=oneline --abbrev-commit $commit` commitMsg=`git log -n 1 --format=oneline --abbrev-commit $commit`
if [ "$mergeDirective" == "" ] if [ "$mergeDirective" == "" ]
then then
pendingCommit=$commit
pendingCommitMessage=$pendingCommitMessage"$commitMsg\n"
echo pendingCommitMessage: $pendingCommitMessage
if can_merge $commit
then
pendingCommit=$commit
pendingCommitMessage=$pendingCommitMessage"$commitMsg\n"
echo pendingCommitMessage: $pendingCommitMessage
else
maybe_commit_and_push $pendingCommit "$pendingCommitMessage"
pendingCommit=
pendingCommitMessage=
echo
echo "Stopping merge because $commit because of merge conflicts"
echo "The following commit must be manually merged."
show $commit
exit 3
fi
elif [ "$mergeDirective" == "no" ] elif [ "$mergeDirective" == "no" ]
then then
maybe_commit_and_push $pendingCommit "$pendingCommitMessage" maybe_commit_and_push $pendingCommit "$pendingCommitMessage"

Načítá se…
Zrušit
Uložit