Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shinnn/is-unautosquashed-commit-message
Check if the value is a commit message that'll be melded into another by `git -i --autosquash`
https://github.com/shinnn/is-unautosquashed-commit-message
autosqash commit-message git javascript
Last synced: 27 days ago
JSON representation
Check if the value is a commit message that'll be melded into another by `git -i --autosquash`
- Host: GitHub
- URL: https://github.com/shinnn/is-unautosquashed-commit-message
- Owner: shinnn
- License: mit-0
- Created: 2017-01-12T06:20:58.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-05-26T09:57:52.000Z (over 5 years ago)
- Last Synced: 2024-05-29T03:01:41.798Z (6 months ago)
- Topics: autosqash, commit-message, git, javascript
- Language: JavaScript
- Size: 62.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# is-unautosquashed-commit-message
[![npm version](https://img.shields.io/npm/v/is-unautosquashed-commit-message.svg)](https://www.npmjs.com/package/is-unautosquashed-commit-message)
[![Build Status](https://travis-ci.com/shinnn/is-unautosquashed-commit-message.svg?branch=master)](https://travis-ci.com/shinnn/is-unautosquashed-commit-message)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/is-unautosquashed-commit-message.svg)](https://coveralls.io/github/shinnn/is-unautosquashed-commit-message)Check if a given value is a message of [Git](https://git-scm.com/) commit that'll be melded into another by [`git -i --autosquash`](https://git-scm.com/docs/git-rebase#git-rebase---autosquash):
> When the commit log message begins with "squash! …" (or "fixup! …"), and there is a commit whose title begins with the same …, automatically modify the todo list of rebase -i so that the commit marked for squashing comes right after the commit to be modified, and change the action of the moved commit from `pick` to `squash` (or `fixup`).
```javascript
isUnautosquashedCommitMessage('Update README'); //=> false
isUnautosquashedCommitMessage('fixup! Update README'); //=> true
```## Installation
[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/).
```
npm install is-unautosquashed-commit-message
```## API
```javascript
import isUnautosquashedCommitMessage from 'is-unautosquashed-commit-message';
```### isUnautosquashedCommitMessage(*message*)
*message*: any type (but always return `false` when non-string value is passed)
Return: `boolean````javascript
// Returns `true`
isUnautosquashedCommitMessage('fixup! add index.js');
isUnautosquashedCommitMessage('squash! use Set\n\ninstead of Array');
isUnautosquashedCommitMessage(' fixup! bump version');
isUnautosquashedCommitMessage('\tsquash!\n🔧');// Returns `false`
isUnautosquashedCommitMessage('add index.js');
isUnautosquashedCommitMessage('fixup!add index.js');
isUnautosquashedCommitMessage('squash!');
isUnautosquashedCommitMessage('fixup! ');
isUnautosquashedCommitMessage(['this', 'is', 'a', 'non-string', 'value']);
isUnautosquashedCommitMessage();
```## License
[MIT No Attribution](./LICENSE) © 2019 Shinnosuke Watanabe