# git-diff-generator

> generates a set of git diffs given commit hashes

Latest version **0.0.3** (published 2016-08-12) · ISC license · 0 weekly downloads

## Install

```sh
npm install git-diff-generator
pnpm add git-diff-generator
yarn add git-diff-generator
bun add git-diff-generator
```

Provides the command `git-diff-generator`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2016-08-12 |
| First published | 2016-08-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | cdaringe |
| Maintainers | cdaringe |
| Keywords | git, diff, set |

## Links

- npm: https://www.npmjs.com/package/git-diff-generator
- Repository: https://gitlab.com/cdaringe/git-diff-generator
- Homepage: https://gitlab.com/cdaringe/git-diff-generator#readme
- Issues: https://gitlab.com/cdaringe/git-diff-generator/issues
- npm.io page: https://npm.io/package/git-diff-generator

## Dependencies (2)

- [commander](https://npm.io/package/commander.md) ^2.9.0
- [lodash.toarray](https://npm.io/package/lodash.toarray.md) ^4.3.0

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2016-08-12
- 0.0.2 — 2016-08-12
- 0.0.1 — 2016-08-12

## README

# git-diff-generator

## what

generate a series of diffs, provided a list of inorder commits.

## install

`npm install -g git-diff-generator`

## usage

of course, you can see your options from the cli
```
$ git-diff-generator -h

  Usage: git-diff-generator [options]

  Options:

    -h, --help            output usage information
    -V, --version         output the version number
    -c, --config [file]   config // <== MOST IMPORTANT!
    -o, --out [dir]       output dir. defaults to cwd
    -r, --repo [path]     path to repo. otherwise, defaults to cwd
    -v, --verbose         get loud
```

```json
// config.json
{
  // REQUIRED
  // we will `git diff --full-index commit1...commit2 > /out/path/formatted-filename.dff
  // ordering: latest commits on top/first, oldest commits on bottom/last. just as out of `git log`
  "commits": [
    "d63bf42",
    "a99bc56"
  ],
  // OPTIONAL
  // file output format accepts the following template inputs
  // %ndx, index of the diff in the set of commited diffs (1 indexed)
  // %commit1, earlier commit
  // %commit2, later commit
  "format": "%ndx-%commit1...$commit2.diff" 
}
```

## example

from this repo itself, i can perform the following:

```bash
$ git-diff-generator -c test/input/this-repo-config.json -o test/output/ -v
[git-differ] VERBOSE: SETTINGS
[git-differ] VERBOSE:  	 out: test/output/
[git-differ] VERBOSE:  	 repo: /Users/cdieringer/node/git-diff-generator
[git-differ] VERBOSE:  	 format: %ndx-%commit1...%commit2.diff
[git-differ] VERBOSE: running diff: git diff --full-index a99bc56...d63bf42 > test/output/1-a99bc56...d63bf42.diff
```

sure enough, `test/output/1-a99bc56...d63bf42.diff` is ready to go!

---
_Source: https://npm.io/package/git-diff-generator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
