-
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
1 parent
660ca8d
commit 3f5568d
Showing
11 changed files
with
156 additions
and
113 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Run Reproducibility Check | ||
on: [push, pull_request] | ||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
maven: [ '3.9.2' ] | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
steps: | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'zulu' | ||
java-version: 17 | ||
- run: echo "JAVA17_HOME=$JAVA_HOME" >> $GITHUB_ENV | ||
- run: java -version | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.12 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
- name: Setup miniconda | ||
uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
python-version: 3.12 | ||
auto-update-conda: true | ||
mamba-version: "*" | ||
channels: conda-forge,defaults | ||
activate-environment: AST | ||
environment-file: environment.yml | ||
- name: Install maven | ||
uses: s4u/[email protected] | ||
with: | ||
java-version: 17 | ||
maven-version: ${{ matrix.maven }} | ||
- name: Clean caches & workspace | ||
run: make clean | ||
- run: echo "LOGURU_COLORIZE=NO" >> $GITHUB_ENV | ||
- name: Run small test | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Example Example" | ||
head -n 101 results/combined/result.csv > results/combined/result_trimmed.csv | ||
make check-merges-reproducibility | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }} |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env sh | ||
|
||
# usage: ./gitmerge_ort_imports.sh <clone_dir> <branch-1> <branch-2> | ||
|
||
clone_dir=$1 | ||
branch1=$2 | ||
branch2=$3 | ||
|
||
export JAVA_HOME="$JAVA17_HOME" | ||
|
||
cd "$clone_dir" || exit 1 | ||
|
||
git checkout "$branch1" --force | ||
|
||
attributes_file=".git/info/attributes" | ||
echo "*.java merge=merge-java" >> "$attributes_file" | ||
git config --local merge.merge-java.name "Merge Java files" | ||
git config --local merge.merge-java.driver 'java-merge-driver.sh "%A" "%O" "%B"' | ||
|
||
git merge --no-edit "$branch2" | ||
retVal=$? | ||
|
||
# report conflicts | ||
if [ "$retVal" -ne 0 ]; then | ||
echo "Conflict" | ||
fi | ||
|
||
exit "$retVal" |
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,4 +1 @@ | ||
git-hires-merge is from https://github.com/paulaltin/git-hires-merge . | ||
|
||
resolve-adjacent-conflicts, resolve-conflicts.py, and resolve-import-conflicts | ||
are from https://github.com/plume-lib/manage-git-branches . |
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,20 +1,28 @@ | ||
#!/usr/bin/env sh | ||
|
||
# usage: ./gitmerge_ort_adjacent.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" | ||
if "$MERGE_SCRIPTS_DIR"/gitmerge.sh "$clone_dir" "$branch1" "$branch2" "$strategy"; then | ||
exit 0 | ||
fi | ||
|
||
export JAVA_HOME="$JAVA17_HOME" | ||
|
||
cd "$clone_dir" || exit 1 | ||
if ! "$MERGE_SCRIPTS_DIR"/resolve-adjacent-conflicts; then | ||
echo "Conflict" | ||
exit 1 | ||
|
||
git checkout "$branch1" --force | ||
|
||
attributes_file=".git/info/attributes" | ||
echo "*.java merge=merge-java" >> "$attributes_file" | ||
git config --local merge.merge-java.name "Merge Java files" | ||
git config --local merge.merge-java.driver 'java-merge-driver.sh "%A" "%O" "%B" --only-adjacent' | ||
|
||
git merge --no-edit "$branch2" | ||
retVal=$? | ||
|
||
# report conflicts | ||
if [ "$retVal" -ne 0 ]; then | ||
echo "Conflict" | ||
fi | ||
|
||
exit 0 | ||
exit "$retVal" |
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
29 changes: 10 additions & 19 deletions
29
src/scripts/merge_tools/gitmerge_ort_imports_ignorespace.sh
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,29 +1,20 @@ | ||
#!/usr/bin/env sh | ||
|
||
# usage: ./gitmerge_ort_imports_ingorespace.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="-Xignore-space-change" | ||
|
||
export JAVA_HOME="$JAVA17_HOME" | ||
strategy="-s ort -Xignore-space-change" | ||
if "$MERGE_SCRIPTS_DIR"/gitmerge.sh "$clone_dir" "$branch1" "$branch2" "$strategy"; then | ||
exit 0 | ||
fi | ||
|
||
cd "$clone_dir" || exit 1 | ||
|
||
git checkout "$branch1" --force | ||
|
||
attributes_file=".git/info/attributes" | ||
echo "*.java merge=merge-java" >> "$attributes_file" | ||
git config --local merge.merge-java.name "Merge Java files" | ||
git config --local merge.merge-java.driver 'java-merge-driver.sh "%A" "%O" "%B"' | ||
|
||
git merge --no-edit "$strategy" "$branch2" | ||
retVal=$? | ||
|
||
# report conflicts | ||
if [ "$retVal" -ne 0 ]; then | ||
echo "Conflict" | ||
if ! "$MERGE_SCRIPTS_DIR"/resolve-import-conflicts; then | ||
echo "Conflict" | ||
exit 1 | ||
fi | ||
|
||
exit "$retVal" | ||
exit 0 |
Submodule merging
updated
30 files
This file was deleted.
Oops, something went wrong.
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,39 @@ | ||
#!/bin/bash | ||
# bash, not POSIX sh, because of "readarray". | ||
|
||
# This script edits files in place to remove conflict markers related to Java | ||
# imports. For a given conflict that involves only `import` statements and | ||
# blank lines, the output includes every `import` statement that is in either | ||
# of the parents. This script leaves other conflicts untouched. | ||
|
||
# Usage: | ||
# resolve-import-conflicts [file ...] | ||
# | ||
# The script works on all files given on the command line. | ||
# If none are given, the script works on all files in or under the current directory. | ||
# | ||
# The exit status code is 0 (success) if all conflicts are resolved in all the files. | ||
# The exit status code is 1 (failure) if any conflict remains. | ||
|
||
# This script is not a git mergetool. A git mergetool is given the base, parent 1, and | ||
# parent 2 files, all without conflict markers. | ||
# However, this can be run after a git mergetool that leaves conflict markers | ||
# in files, as the default git mergetool does. | ||
|
||
if [ "$#" -eq 0 ] ; then | ||
readarray -t files < <(grep -l -r '^<<<<<<< HEAD' .) | ||
else | ||
files=("$@") | ||
fi | ||
|
||
SCRIPTDIR="$(cd "$(dirname "$0")" && pwd -P)" | ||
|
||
status=0 | ||
|
||
for file in "${files[@]}" ; do | ||
if ! "${SCRIPTDIR}"/resolve-conflicts.py --java_imports "$file" ; then | ||
status=1 | ||
fi | ||
done | ||
|
||
exit $status |