-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
41 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,14 @@ | ||
#!/usr/bin/env sh | ||
|
||
# usage: ./gitmerge-ort.sh <clone_dir> <branch-1> <branch-2> | ||
# usage: ./gitmerge_ort_imports.sh <clone_dir> <branch-1> <branch-2> | ||
|
||
MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" | ||
clone_dir=$1 | ||
branch1=$2 | ||
branch2=$3 | ||
strategy="-s ort" | ||
"$MERGE_SCRIPTS_DIR"/gitmerge.sh "$clone_dir" "$branch1" "$branch2" "$strategy" "no-git-merge-abort" | ||
status=$? | ||
|
||
if ! "$status" ; then | ||
(cd "$clone_dir" && "$MERGE_SCRIPTS_DIR"/resolve-import-conflicts) | ||
|
||
# From https://stackoverflow.com/questions/41246415/ | ||
status=$(git diff --exit-code -S '<<<<<<< HEAD' -S "=======" -S ">>>>>>> $(git name-rev --name-only MERGE_HEAD)" HEAD) | ||
|
||
git merge --abort | ||
if "$MERGE_SCRIPTS_DIR"/gitmerge.sh "$clone_dir" "$branch1" "$branch2" "$strategy" "no-git-merge-abort" ; then | ||
exit | ||
fi | ||
|
||
exit "$status" | ||
(cd "$clone_dir" && "$MERGE_SCRIPTS_DIR"/resolve-import-conflicts-or-abort-merge) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
#!/usr/bin/env sh | ||
|
||
# usage: ./gitmerge-ort-ignorespace.sh <clone_dir> <branch-1> <branch-2> | ||
# usage: ./gitmerge_ort_imports_ignorespace.sh <clone_dir> <branch-1> <branch-2> | ||
|
||
MERGE_SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd -P)" | ||
clone_dir=$1 | ||
branch1=$2 | ||
branch2=$3 | ||
strategy="-s ort -Xignore-space-change" | ||
"$MERGE_SCRIPTS_DIR"/gitmerge.sh "$clone_dir" "$branch1" "$branch2" "$strategy" | ||
if "$MERGE_SCRIPTS_DIR"/gitmerge.sh "$clone_dir" "$branch1" "$branch2" "$strategy" "no-git-merge-abort" ; then | ||
exit | ||
fi | ||
|
||
(cd "$clone_dir" && "$MERGE_SCRIPTS_DIR"/resolve-import-conflicts) | ||
(cd "$clone_dir" && "$MERGE_SCRIPTS_DIR"/resolve-import-conflicts-or-abort-merge) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/scripts/merge_tools/resolve-import-conflicts-or-abort-merge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env sh | ||
|
||
# usage: ./resolve-import-conflicts-or-abort-merge | ||
# Runs `resolve-import-conflicts`. | ||
# If there are no remaining conflicts, exits with status 0. | ||
# If some conflicts remain, ouputs "Conflict", aborts the merge, and exits with status 1. | ||
|
||
|
||
"$MERGE_SCRIPTS_DIR"/resolve-import-conflicts | ||
|
||
# From https://stackoverflow.com/questions/41246415/ | ||
if git diff --exit-code -S '<<<<<<< HEAD' -S "=======" -S ">>>>>>> $(git name-rev --name-only MERGE_HEAD)" HEAD ; then | ||
exit | ||
fi | ||
|
||
echo "Conflict" | ||
git merge --abort | ||
exit 1 |