Skip to content

Commit

Permalink
new results excel and updates to scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
cactusbranch01 committed Dec 11, 2023
1 parent 6d7256c commit 016642e
Show file tree
Hide file tree
Showing 6 changed files with 4,284 additions and 542 deletions.
2,068 changes: 2,068 additions & 0 deletions results_greatest_hits/result.csv

Large diffs are not rendered by default.

59 changes: 10 additions & 49 deletions src/python/diff3_analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"uniVocity/univocity-parsers : Cloning repo\n",
"Repository 'uniVocity/univocity-parsers' cloned to path: ./repos/merge_attempt/uniVocity/univocity-parsers\n",
"uniVocity/univocity-parsers : Finished cloning\n"
"dropwizard/metrics : Cloning repo\n",
"Repository 'dropwizard/metrics' cloned to path: ./repos/merge_attempt/dropwizard/metrics\n",
"dropwizard/metrics : Finished cloning\n"
]
},
{
Expand All @@ -25,54 +25,15 @@
"name": "stdout",
"output_type": "stream",
"text": [
"uniVocity/univocity-parsers : Cloning repo\n",
"Repository 'uniVocity/univocity-parsers' cloned to path: ./repos/programmer_merge/uniVocity/univocity-parsers\n",
"uniVocity/univocity-parsers : Finished cloning\n",
"uniVocity/univocity-parsers : Cloning repo\n",
"Repository 'uniVocity/univocity-parsers' cloned to path: ./repos/base/uniVocity/univocity-parsers\n",
"uniVocity/univocity-parsers : Finished cloning\n",
"pom.xml\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/snap/core20/current/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /lib/x86_64-linux-gnu/libproxy.so.1)\n",
"Failed to load module: /home/benrr/snap/code/common/.cache/gio-modules/libgiolibproxy.so\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Error: No such file or directory\n",
"Fallback to diffing the other way\n",
"src/test/java/com/univocity/parsers/issues/github/Github_31.java\n",
"reached delete repo\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/snap/core20/current/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /lib/x86_64-linux-gnu/libproxy.so.1)\n",
"Failed to load module: /home/benrr/snap/code/common/.cache/gio-modules/libgiolibproxy.so\n"
"dropwizard/metrics : Cloning repo\n",
"Repository 'dropwizard/metrics' cloned to path: ./repos/programmer_merge/dropwizard/metrics\n",
"dropwizard/metrics : Finished cloning\n"
]
}
],
"source": [
"repo_num = 6990\n",
"# merge_tool = \"gitmerge-recursive-patience\"\n",
"# merge_tool = \"spork\"\n",
"# merge_tool = \"gitmerge-recursive-minimal\"\n",
"# merge_tool = \"gitmerge-resrepo_num = 3595\n",
"# merge_tool = \"gitmerge-recursive-patience\"\n",
"# merge_tool = \"spork\"\n",
"# merge_tool = \"git merge-resolve\"\n",
"# merge_tool = \"intellimerge\"\n",
"# merge_tool = \"gitmerge-ort-ignorespace\"\n",
"merge_tool = 'gitmerge-ort'\n",
"repo_num = 548\n",
"gitmerge_ort\tgitmerge_ort_adjacent\tgitmerge_ort_ignorespace\tgitmerge_ort_imports\tgitmerge_ort_imports_ignorespace\tgitmerge_resolve\tgitmerge_recursive_histogram\tgitmerge_recursive_ignorespace\tgitmerge_recursive_minimal\tgitmerge_recursive_myers\tgitmerge_recursive_patience\tgit_hires_merge\tspork\tintellimerge\n",
"\n",
"from diff3_analysis import diff3_analysis\n",
"diff3_analysis(merge_tool, repo_num)"
Expand All @@ -95,7 +56,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
"version": "3.8.18"
}
},
"nbformat": 4,
Expand Down
33 changes: 20 additions & 13 deletions src/python/diff3_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def diff3_analysis(merge_tool: str, repo_num: int):
Returns:
None
"""
df = pd.read_csv("../../results/result.csv")
repo_name = df.iloc[repo_num]["repo_name"]
df = pd.read_csv("../../results_greatest_hits/result.csv")
repo_name = df.iloc[repo_num]["repository"]

script = "../scripts/merge_tools/" + merge_tool + ".sh"
repo = clone_repo_to_path(
Expand Down Expand Up @@ -59,11 +59,13 @@ def diff3_analysis(merge_tool: str, repo_num: int):
repo.git.checkout(df.iloc[repo_num]["merge"], force=True)
repo.submodule_update()

'''
repo = clone_repo_to_path(
repo_name, "./repos/base"
) # Return a Git-Python repo object
repo.git.checkout(df.iloc[repo_num]["base"], force=True)
repo.submodule_update()
'''

for conflict_file_match in conflict_file_matches:
conflicting_file = str(conflict_file_match)
Expand All @@ -72,11 +74,13 @@ def diff3_analysis(merge_tool: str, repo_num: int):
"./repos/merge_attempt", conflict_path
)

'''
conflict_path_base = os.path.join("./repos/base", conflict_path)

'''
conflict_path_programmer_merge = os.path.join(
"./repos/programmer_merge", conflict_path
)
'''
diff_results = subprocess.run(
[
"diff3",
Expand All @@ -92,16 +96,17 @@ def diff3_analysis(merge_tool: str, repo_num: int):
# Check that diff3 didn't run into missing files in the base
error_message = "No such file or directory"
if error_message in diff_results.stderr:
# Since the conflict file was added in both parents we can't diff the base.
diff_results = subprocess.run(
[
"diff",
conflict_path_merge_attempt,
conflict_path_programmer_merge,
],
stdout=subprocess.PIPE,
text=True,
)
'''
# Since the conflict file was added in both parents we can't diff the base.
diff_results = subprocess.run(
[
"diff",
conflict_path_merge_attempt,
conflict_path_programmer_merge,
],
stdout=subprocess.PIPE,
text=True,
)

# Use a temporary file to store the diff results
with tempfile.NamedTemporaryFile(mode="w+", delete=False) as temp_file:
Expand All @@ -115,11 +120,13 @@ def diff3_analysis(merge_tool: str, repo_num: int):

# Deletes base, programmer_merge, and merge_attempt folders in repos dir
# We do this to prevent errors if cloning the same repo into the folder twice
'''
subprocess.run(
["rm", "-rf", "./repos/base"],
stderr=subprocess.PIPE,
stdout=subprocess.PIPE,
)
'''
subprocess.run(
["rm", "-rf", "./repos/merge_attempt"],
stderr=subprocess.PIPE,
Expand Down
Binary file modified src/python/failed_twenty.xlsx
Binary file not shown.
Loading

0 comments on commit 016642e

Please sign in to comment.