Metadata-Version: 2.1
Name: sample-git-diffs
Version: 0.4.1
Summary: 
Home-page: https://github.com/ninpnin/sample-git-diffs
License: MIT
Author: ninpnin
Author-email: you@example.com
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: pandas
Project-URL: Repository, https://github.com/ninpnin/sample-git-diffs
Description-Content-Type: text/markdown

# sample-git-diffs

```
Sample git diffs uniformly wrt. number of changes per file. The output is formatted as a .diff file.

optional arguments:
  -h, --help            show this help message and exit
  --n N                 Total number of diffs to be sampled
  --diffstat DIFFSTAT   Custom git diff command for the sampling probabilities
  --diffcommand DIFFCOMMAND
                        Custom git diff command for the actual diff
```

For example, if you want to draw a sample of 25 diffs from the folder data/, you run

```
sample-git-diffs --diffstat "git diff --stat data/" --n 25
```

To save this to changes.diff, you run

```
sample-git-diffs --diffstat "git diff --stat data/" --n 25 > changes.diff
```

## diff2markdown

There's also a script that converts the generated .diff / .patch files into markdown.

```
usage: diff2markdown [-h] --path PATH [--username USERNAME] [--reponame REPONAME] [--branch BRANCH]

optional arguments:
  -h, --help           show this help message and exit
  --path PATH
  --username USERNAME
  --reponame REPONAME
  --branch BRANCH
```

For example, if you want to convert the changes.diff file into markdown, assuming that the repo is called 'sample-git-diffs', you're on branch 'main' and the github username is 'testuser', you run

```
diff2markdown --path changes.diff --username testuser --reponame sample-git-diffs --branch main
```

