Skip to main content

No project description provided

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sample_git_diffs-0.5.2.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sample_git_diffs-0.5.2-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file sample_git_diffs-0.5.2.tar.gz.

File metadata

  • Download URL: sample_git_diffs-0.5.2.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.14.0 Darwin/25.3.0

File hashes

Hashes for sample_git_diffs-0.5.2.tar.gz
Algorithm Hash digest
SHA256 0a7054b4cb67b3683ea4347134ea95a115788f2e6828c088ca98442e64ffa4ac
MD5 1f050e95c49ad76c1eec6677f024cca9
BLAKE2b-256 55b4f00b90eea53a77f523651917159c844c23b4c90b3461a9cf47062f39f7f3

See more details on using hashes here.

File details

Details for the file sample_git_diffs-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: sample_git_diffs-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.14.0 Darwin/25.3.0

File hashes

Hashes for sample_git_diffs-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9f6900102ba79047eac67b2e8e6480c7242cb679204cf3709d45cd4d624aa35e
MD5 6e833be9e91097dc900a39f432ab2579
BLAKE2b-256 f1739647fbe4543bc03908a263824ffe423597eea28cd07e91357f4871ef568d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page