diff --git a/src/python/diff3_analysis.ipynb b/src/python/diff3_analysis.ipynb deleted file mode 100644 index 013ab8e1d8..0000000000 --- a/src/python/diff3_analysis.ipynb +++ /dev/null @@ -1,65 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from diff3_analysis import diff3_analysis\n", - "import os\n", - "\n", - "row_nums = [\n", - " 582, 427, 930, 70, 128, 1444, 1177, 849, 1425, 1642, 1897, 862, 943, 1442, 1120,\n", - " 111, 693, 535, 354, 530, 845, 654, 921, 464, 1006, 707, 485, 1928, 809, 1329, 65, 1890, 100, 247, 2038, 900\n", - "]\n", - "\n", - "merge_tools = [\"gitmerge_ort\", \n", - " \"gitmerge_ort_adjacent\", \n", - " \"gitmerge_ort_ignorespace\", \n", - " \"gitmerge_ort_imports\", \n", - " \"gitmerge_ort_imports_ignorespace\", \n", - " \"gitmerge_resolve\",\n", - " \"gitmerge_recursive_histogram\", \n", - " \"gitmerge_recursive_ignorespace\", \n", - " \"gitmerge_recursive_minimal\", \n", - " \"gitmerge_recursive_myers\", \n", - " \"gitmerge_recursive_patience\",\n", - " \"git_hires_merge\",\n", - " \"spork\", \n", - " \"intellimerge\"]\n", - "\n", - "# Ensure the base output directory exists\n", - "base_output_dir = \"./merge_conflict_analysis_diffs\"\n", - "\n", - "for row_num in row_nums:\n", - " for merge_tool in merge_tools:\n", - " # Create a subdirectory for this specific results_index\n", - " repo_output_dir = os.path.join(base_output_dir, str(row_num), merge_tool)\n", - " os.makedirs(repo_output_dir, exist_ok=True)\n", - " diff3_analysis(merge_tool, row_num, repo_output_dir)\n" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "research", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.18" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/src/python/run_diff3_analysis.py b/src/python/run_diff3_analysis.py new file mode 100644 index 0000000000..8c7fd259a6 --- /dev/null +++ b/src/python/run_diff3_analysis.py @@ -0,0 +1,74 @@ +from diff3_analysis import diff3_analysis +import os + +# Mixed conflict and pass examples from results_greatest_hits/result.csv +# Randomly chosen sample of mixed results from dataset +row_nums = [ + 582, + 427, + 930, + 70, + 128, + 1444, + 1177, + 849, + 1425, + 1642, + 1897, + 862, + 943, + 1442, + 1120, + 111, + 693, + 535, + 354, + 530, + 845, + 654, + 921, + 464, + 1006, + 707, + 485, + 1928, + 809, + 1329, + 65, + 1890, + 100, + 247, + 2038, + 900, +] + +# All merge tools +merge_tools = [ + "gitmerge_ort", + "gitmerge_ort_adjacent", + "gitmerge_ort_ignorespace", + "gitmerge_ort_imports", + "gitmerge_ort_imports_ignorespace", + "gitmerge_resolve", + "gitmerge_recursive_histogram", + "gitmerge_recursive_ignorespace", + "gitmerge_recursive_minimal", + "gitmerge_recursive_myers", + "gitmerge_recursive_patience", + "git_hires_merge", + "spork", + "intellimerge", +] + + +def run_analysis(): + # Ensure the base output directory exists + base_output_dir = "./merge_conflict_analysis_diffs" + + # Loop through each conflict, recreating merges to repo_output_dir + for row_num in row_nums: + for merge_tool in merge_tools: + # Create a subdirectory for this specific results_index + repo_output_dir = os.path.join(base_output_dir, str(row_num), merge_tool) + os.makedirs(repo_output_dir, exist_ok=True) + diff3_analysis(merge_tool, row_num, repo_output_dir)