Skip to content

Commit

Permalink
docs(from-context): extend documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed Aug 23, 2024
1 parent 30f09b6 commit 3e7c395
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions website/docs/usage/load-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,36 @@ sidebar_position: 11

# Load context

:::tip

This is useful if you want to [print context](/docs/usage/print-context), modify it with an external tool and then "pipe" it back into **git-cliff**.

:::

To load a context from a file and output the generated changelog:

```bash
# create a context
git cliff --context -o context.json

# process context and generate a changelog
git cliff --from-context context.json

# process context loaded from stdin
git cliff --from-context -

# process context loaded from a file
git cliff --from-context context.json
# or simply
cat context.json | git-cliff
```

This is useful if you want to [print context](/docs/usage/print-context), modify it with an external tool and then "pipe" it back into git cliff. Free-form metadata can be added to release objects and commit objects in the context using the `extra` field.
Free-form metadata can be added to release objects and commit objects in the context using the `extra` field:

```json
{
"id": "5061081d6272b1da2146fab49d803c193db309d9",
"message": "commit message",
"extra": {
"note": "this is some arbitrary data"
}
}
```

0 comments on commit 3e7c395

Please sign in to comment.