What is git-raw-commits?
The git-raw-commits npm package is designed to generate raw git commits from your repository's history. It allows developers to programmatically access commit information, which can be useful for generating changelogs, analyzing project history, or automating versioning processes.
What are git-raw-commits's main functionalities?
Generating raw commits
This feature allows you to generate raw commit data between two tags (from 'v1.0.0' to 'v2.0.0' in this example). The output can be piped to any writable stream, such as `process.stdout` for display or a file stream for saving.
const gitRawCommits = require('git-raw-commits');
gitRawCommits({ from: 'v1.0.0', to: 'v2.0.0' }).pipe(process.stdout);
Filtering commits
This feature demonstrates how to filter commits by a specific pattern using the `grep` option. In this example, only commits with 'Fix' in their messages between 'v1.0.0' and the latest commit ('HEAD') are generated.
const gitRawCommits = require('git-raw-commits');
gitRawCommits({ from: 'v1.0.0', to: 'HEAD', grep: 'Fix' }).pipe(process.stdout);
Other packages similar to git-raw-commits
conventional-changelog
Similar to git-raw-commits, conventional-changelog is a tool for generating changelogs based on semantic versioning and commit conventions. While git-raw-commits provides raw commit data, conventional-changelog processes this data to create formatted changelog entries, offering a higher-level abstraction.
gitlog
gitlog is another npm package that allows you to retrieve commit logs from your git repository. Compared to git-raw-commits, gitlog offers a simpler interface for accessing commit information but lacks the fine-grained control over commit selection and formatting.