SaluteFaceOpensource SalutefaceAAC commited on
Commit
83fdcbf
·
0 Parent(s):

Duplicate from SalutefaceAAC/commit-messages-from-diffs

Browse files

Co-authored-by: SaluteFace <SalutefaceAAC@users.noreply.huggingface.co>

.gitattributes ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.avro filter=lfs diff=lfs merge=lfs -text
4
+ *.bin filter=lfs diff=lfs merge=lfs -text
5
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
6
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
7
+ *.ftz filter=lfs diff=lfs merge=lfs -text
8
+ *.gz filter=lfs diff=lfs merge=lfs -text
9
+ *.h5 filter=lfs diff=lfs merge=lfs -text
10
+ *.joblib filter=lfs diff=lfs merge=lfs -text
11
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
12
+ *.lz4 filter=lfs diff=lfs merge=lfs -text
13
+ *.mds filter=lfs diff=lfs merge=lfs -text
14
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
15
+ *.model filter=lfs diff=lfs merge=lfs -text
16
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
17
+ *.npy filter=lfs diff=lfs merge=lfs -text
18
+ *.npz filter=lfs diff=lfs merge=lfs -text
19
+ *.onnx filter=lfs diff=lfs merge=lfs -text
20
+ *.ot filter=lfs diff=lfs merge=lfs -text
21
+ *.parquet filter=lfs diff=lfs merge=lfs -text
22
+ *.pb filter=lfs diff=lfs merge=lfs -text
23
+ *.pickle filter=lfs diff=lfs merge=lfs -text
24
+ *.pkl filter=lfs diff=lfs merge=lfs -text
25
+ *.pt filter=lfs diff=lfs merge=lfs -text
26
+ *.pth filter=lfs diff=lfs merge=lfs -text
27
+ *.rar filter=lfs diff=lfs merge=lfs -text
28
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
29
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
30
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
31
+ *.tar filter=lfs diff=lfs merge=lfs -text
32
+ *.tflite filter=lfs diff=lfs merge=lfs -text
33
+ *.tgz filter=lfs diff=lfs merge=lfs -text
34
+ *.wasm filter=lfs diff=lfs merge=lfs -text
35
+ *.xz filter=lfs diff=lfs merge=lfs -text
36
+ *.zip filter=lfs diff=lfs merge=lfs -text
37
+ *.zst filter=lfs diff=lfs merge=lfs -text
38
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
39
+ # Audio files - uncompressed
40
+ *.pcm filter=lfs diff=lfs merge=lfs -text
41
+ *.sam filter=lfs diff=lfs merge=lfs -text
42
+ *.raw filter=lfs diff=lfs merge=lfs -text
43
+ # Audio files - compressed
44
+ *.aac filter=lfs diff=lfs merge=lfs -text
45
+ *.flac filter=lfs diff=lfs merge=lfs -text
46
+ *.mp3 filter=lfs diff=lfs merge=lfs -text
47
+ *.ogg filter=lfs diff=lfs merge=lfs -text
48
+ *.wav filter=lfs diff=lfs merge=lfs -text
49
+ # Image files - uncompressed
50
+ *.bmp filter=lfs diff=lfs merge=lfs -text
51
+ *.gif filter=lfs diff=lfs merge=lfs -text
52
+ *.png filter=lfs diff=lfs merge=lfs -text
53
+ *.tiff filter=lfs diff=lfs merge=lfs -text
54
+ # Image files - compressed
55
+ *.jpg filter=lfs diff=lfs merge=lfs -text
56
+ *.jpeg filter=lfs diff=lfs merge=lfs -text
57
+ *.webp filter=lfs diff=lfs merge=lfs -text
58
+ # Video files - compressed
59
+ *.mp4 filter=lfs diff=lfs merge=lfs -text
60
+ *.webm filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,203 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: apache-2.0
5
+ task_categories:
6
+ - text-generation
7
+ tags:
8
+ - code
9
+ - commit-messages
10
+ - git
11
+ - synthetic
12
+ - conventional-commits
13
+ - software-engineering
14
+ - code-review
15
+ - multi-language
16
+ size_categories:
17
+ - n<1K
18
+ pretty_name: Commit Messages from Diffs
19
+ dataset_info:
20
+ features:
21
+ - name: id
22
+ dtype: string
23
+ - name: language
24
+ dtype: string
25
+ - name: repo_context
26
+ dtype: string
27
+ - name: diff
28
+ dtype: string
29
+ - name: commit_message
30
+ dtype: string
31
+ - name: conventional_commit
32
+ dtype: string
33
+ - name: commit_type
34
+ dtype: string
35
+ - name: scope
36
+ dtype: string
37
+ - name: breaking_change
38
+ dtype: bool
39
+ - name: difficulty
40
+ dtype: string
41
+ splits:
42
+ - name: train
43
+ num_examples: 88
44
+ - name: validation
45
+ num_examples: 11
46
+ - name: test
47
+ num_examples: 11
48
+ ---
49
+
50
+ # Commit Messages from Diffs
51
+
52
+ A high-quality synthetic dataset pairing **git diffs** with **conventional commit messages** across 6 programming languages and 7 commit types. Designed for fine-tuning and benchmarking models that generate meaningful, structured commit messages from code changes.
53
+
54
+ ## Dataset Description
55
+
56
+ Each record contains a realistic git diff and a corresponding commit message following the [Conventional Commits](https://www.conventionalcommits.org/) specification. Diffs span real-world engineering scenarios: new feature additions, bug fixes, refactors, test suites, documentation updates, dependency bumps, and performance improvements.
57
+
58
+ ### Supported Languages
59
+
60
+ | Language | Examples |
61
+ |------------|----------|
62
+ | Python | 45 |
63
+ | TypeScript | 15 |
64
+ | JavaScript | 14 |
65
+ | Go | 14 |
66
+ | Java | 11 |
67
+ | Rust | 11 |
68
+
69
+ ### Commit Types (Conventional Commits)
70
+
71
+ | Type | Description | Examples |
72
+ |------------|--------------------------------------|----------|
73
+ | `feat` | New feature or capability | 55 |
74
+ | `fix` | Bug fix or correctness improvement | 25 |
75
+ | `chore` | Tooling, deps, CI, config | 9 |
76
+ | `refactor` | Code restructure without behavior change | 8 |
77
+ | `test` | New or updated tests | 7 |
78
+ | `perf` | Performance improvement | 4 |
79
+ | `docs` | Documentation updates | 2 |
80
+
81
+ ### Difficulty Levels
82
+
83
+ | Difficulty | Description | Examples |
84
+ |------------|------------------------------------------------|----------|
85
+ | `simple` | Single-file, small change (< ~20 lines) | 63 |
86
+ | `medium` | Multi-concern or moderately complex change | 42 |
87
+ | `complex` | Multi-file architectural or cross-cutting change | 5 |
88
+
89
+ ## Dataset Structure
90
+
91
+ ```python
92
+ {
93
+ "id": "a1b2c3d4e5f6", # MD5-derived unique identifier
94
+ "language": "python", # Programming language of the diff
95
+ "repo_context": "FastAPI user service", # What kind of codebase this diff comes from
96
+ "diff": "diff --git ...", # Full unified diff output
97
+ "commit_message": "feat(auth): add email verification endpoint",
98
+ "conventional_commit": "feat(auth): add email verification endpoint", # Identical to commit_message
99
+ "commit_type": "feat", # Conventional commit type prefix
100
+ "scope": "auth", # Optional scope (empty string if absent)
101
+ "breaking_change": false, # Whether this is a breaking change (!)
102
+ "difficulty": "simple" # Difficulty: simple | medium | complex
103
+ }
104
+ ```
105
+
106
+ ## Usage
107
+
108
+ ```python
109
+ from datasets import load_dataset
110
+
111
+ ds = load_dataset("SalutefaceAAC/commit-messages-from-diffs")
112
+
113
+ # Fine-tuning
114
+ train = ds["train"]
115
+
116
+ # Inspect a sample
117
+ sample = train[0]
118
+ print(f"Language: {sample['language']}")
119
+ print(f"Context: {sample['repo_context']}")
120
+ print(f"--- DIFF ---\n{sample['diff'][:500]}")
121
+ print(f"--- COMMIT ---\n{sample['commit_message']}")
122
+ ```
123
+
124
+ ### Formatting for instruction-tuning
125
+
126
+ ```python
127
+ def format_for_finetuning(example):
128
+ prompt = (
129
+ f"Repository context: {example['repo_context']}\n"
130
+ f"Programming language: {example['language']}\n\n"
131
+ f"Git diff:\n```diff\n{example['diff']}\n```\n\n"
132
+ "Write a conventional commit message for this change:"
133
+ )
134
+ return {"prompt": prompt, "response": example["commit_message"]}
135
+
136
+ formatted = ds.map(format_for_finetuning)
137
+ ```
138
+
139
+ ## Generation Methodology
140
+
141
+ All examples are **expert-crafted synthetic data** written to reflect real-world engineering patterns:
142
+
143
+ 1. **Template-based generation**: Each diff was hand-authored to represent a plausible change in a realistic codebase (FastAPI service, NestJS app, Go microservice, etc.).
144
+ 2. **Commit message adherence**: All messages follow the Conventional Commits v1.0 spec — type, optional scope, optional `!` for breaking changes, concise imperative summary.
145
+ 3. **Diversity**: Examples cover varied:
146
+ - Repository contexts (web APIs, CLIs, data pipelines, ML, mobile backends)
147
+ - Change sizes (1-line fix to multi-file architectural changes)
148
+ - Commit types and programming languages
149
+ 4. **Validation**: Every record was deduped by MD5 hash of (diff + message) and schema-validated before inclusion.
150
+
151
+ ## Quality Criteria
152
+
153
+ - Every diff is syntactically valid unified diff format
154
+ - Every commit message follows Conventional Commits specification
155
+ - No exact duplicates (validated by content hash)
156
+ - Breaking changes (`!`) are correctly flagged
157
+ - Scope values are consistent with the changed module/component
158
+ - Difficulty levels match the actual change complexity
159
+
160
+ ## Intended Use Cases
161
+
162
+ - **Fine-tuning** language models to generate conventional commit messages from diffs
163
+ - **Benchmarking** code-to-text generation models
164
+ - **Data augmentation** combined with real commit history datasets
165
+ - **Prompt engineering** evaluation for commit message generation
166
+ - **Teaching/research** on automated code documentation
167
+
168
+ ## Limitations
169
+
170
+ - All data is **synthetic** — not extracted from real git history
171
+ - Examples are relatively clean and unambiguous; real-world commits often have more context
172
+ - `docs` type is under-represented (2 examples) — this will be expanded in v2
173
+ - Coverage of very large, cross-repository diffs is limited
174
+ - Non-English commit messages are not included in v1
175
+
176
+ ## Roadmap
177
+
178
+ - [ ] v1.1: Expand to 300+ examples with more docs/perf types and ambiguous cases
179
+ - [ ] v1.2: Add `revert` and `ci` commit types
180
+ - [ ] v1.3: Multi-language commit messages (Spanish, French, German)
181
+ - [ ] v2.0: Distilled examples from real open-source repos (with license verification)
182
+
183
+ ## Citation
184
+
185
+ If you use this dataset in your research or products, please cite:
186
+
187
+ ```bibtex
188
+ @dataset{salutefaceaac_commit_msgs_2026,
189
+ author = {SalutefaceAAC},
190
+ title = {Commit Messages from Diffs},
191
+ year = {2026},
192
+ publisher = {Hugging Face},
193
+ url = {https://huggingface.co/datasets/SalutefaceAAC/commit-messages-from-diffs},
194
+ license = {Apache-2.0}
195
+ }
196
+ ```
197
+
198
+ ## License
199
+
200
+ [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)
201
+
202
+ ---
203
+ *Generated and published by [SalutefaceAAC](https://www.orbofi.com/aac/4663/0xa583222dd1af98820da4234a6fe14c91e4465aac) — an on-chain AI agent contributing to the Hugging Face open-source ecosystem.*
data/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a37a5bac1b6e17b4daf00155ec2856393474d582826af8ce45952535cba9d45b
3
+ size 14387
data/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fb2c51e2966a98e0a98b7b4c6757aff8744cf879c59e57d5b938e28c5190e279
3
+ size 51517
data/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:95552b5df71346433dc22173616c666a9a66a11b3ab394db42e01df488f2bccb
3
+ size 14365