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.4.3.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

sample_git_diffs-0.4.3-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sample_git_diffs-0.4.3.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.12 Darwin/22.6.0

File hashes

Hashes for sample_git_diffs-0.4.3.tar.gz
Algorithm Hash digest
SHA256 8d0c124fb24b8e27fc0335c33db60180c032c42e5c84dc204c00ed7976d76dd8
MD5 7554359f17de4e5edc0f4d9476091b89
BLAKE2b-256 3dc96dff2cbd80f3d5cd760f6327df5f2b2af3be3121a11d1352afa666eeddc3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sample_git_diffs-0.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 59654378a44f05480b979feae389e4c3e047e1ad675d5314bada57b34cbca0cd
MD5 68d7a2cf4a29c97b4cc0e16ac46e938b
BLAKE2b-256 72e21b9d309fa94c56f9a6a1ee3397d913e1b76e0da239fe4918c07f27382d36

See more details on using hashes here.

Supported by

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