venkateshtata's picture
Upload folder using huggingface_hub
0ff2e02 verified
|
Raw History Blame Contribute Delete
5.4 kB
metadata
license:
  - apache-2.0
  - mit
  - bsd-3-clause
  - bsd-2-clause
language:
  - en
  - code
pretty_name: Java merge conflicts
size_categories:
  - 10K<n<100K
task_categories:
  - text-generation
tags:
  - code
  - java
  - git
  - merge-conflicts
configs:
  - config_name: default
    data_files:
      - split: train
        path: data/train.jsonl.gz
      - split: validation
        path: data/validation.jsonl.gz
      - split: test
        path: data/test.jsonl.gz
  - config_name: prompts
    data_files:
      - split: train
        path: prompts/train.jsonl.gz
      - split: validation
        path: prompts/validation.jsonl.gz
      - split: test
        path: prompts/test.jsonl.gz

Java merge conflicts

10,480 real merge conflicts from 609 public Java repositories. For each conflict: the two sides, the lines as they were before either branch changed them, and what the developer committed. It is the data that Merge Decision 4B was trained and tested on.

It is part of the Model Training Project. The full account of how it was made and used is at modeltrainingproject.com/models/merge-decision-model.

The splits

Split by repository, so a model is always tested on repositories it never trained on.

Split Conflicts Repositories Merges
train 9,678 549 3,910
validation 400 30 181
test 402 30 188

What the developers did

Kind of answer Share
Kept side A, whole 33.4%
Kept side B, whole 26.4%
Wrote a line that is on neither side 17.5%
Mixed lines from both sides 15.7%
Kept side A, then side B 4.4%
Kept side B, then side A 1.9%
Neither side, or the original lines 0.6%

So 82.5% of the answers can be written as a choice of lines that are already in the conflict.

The fields

The default configuration holds one conflict per line.

Field What it holds
id A short identifier of the conflict
repository The GitHub repository, as owner/name
merge, parent_a, parent_b The merge commit and its two parents. Side A is the branch being merged into, side B the incoming branch.
path The file the conflict is in
conflict_in_file, conflicts_in_file Which conflict of the file this is, from 0, and how many the file has
before, after Up to 20 unchanged lines above and below the conflict
side_a, base, side_b The lines of side A, of the original, and of side B. Every line keeps its line ending.
answer The lines the developer committed in place of the conflict
labels The answer as a choice of lines, such as ["A1", "B2"], when it can be written that way; empty when new code was needed
kind What the developer did: side A, side B, A then B, B then A, mix of lines, needs new code, neither side or the original lines
tags test_file: the file is a test; benchmark_size: the conflict is small enough for the Merge-Bench benchmark; sides_differ_only_in_spacing
windows_line_endings The file had Windows line endings, which were turned into plain ones
licence The licence of the repository the conflict comes from

The prompts configuration holds the prompts the model was trained and scored with. Its training split has 8,132 conflicts: those whose two sides together are at most 14 lines, the benchmark's size, and whose answer turns back into exactly the developer's code. Its validation and test splits hold every conflict. Each prompt shows the five lines above and below and every line of the conflict labelled, with and the answer as KEEP and a list of labels, or NEW and the lines. Its answer field is the developer's code; target is what the model was trained to say.

How it was made

  • Repositories: public Java repositories on GitHub with at least 50 stars and a permissive licence: Apache 2.0, MIT, BSD 3-Clause or BSD 2-Clause. None is among the repositories the Merge-Bench benchmark was built from.
  • Conflicts: each merge commit was replayed with git, with the original lines shown, and the developer's answer was found by matching the unchanged lines around each conflict. On five of the benchmark's own repositories this reproduced 166 of its 167 conflicts and answers exactly.
  • Cleaning: conflicts in generated code were removed, as were conflicts the developer left unresolved, sides longer than 30 lines, exact duplicates, more than 5 conflicts from one merge, and more than 2% of the data from one repository.
  • Mined on: 29 November 2026.

Licence

Every conflict is code from its repository and keeps that repository's licence, which the licence field gives: 4,917 Apache 2.0, 3,822 MIT, 1,144 BSD 3-Clause and 597 BSD 2-Clause. Using a conflict means following its licence, including its notices. repositories.csv lists every repository with its licence.

Limits

  • Java only.
  • 14% of the conflicts found were left out because the developer's answer could not be located. They are likely the ones the developer changed most, so the data leans a little towards simpler answers.
  • The developer's answer is not proof of a correct merge.
  • The test and validation sets are small: about 400 conflicts from 30 repositories each.