Fluent Git
Features:
- git-notes basic subcommand (add, remove, show, etc) with handler:
- atCommit()
- atFile()
- atFolder()
- atSubmodule()
- atTag()
- git-log...
- search and list notes
- search and list commit
- git-checkout...
- git-hooks...
Getting Started
To begin, you'll need to install fluent-git
:
npm install fluent-git
or if you use yarn
yarn add fluent-git
man]
git-notes [tl;dr -- see example on each operation or handler
;
notes([text|][,options])
is a function that take 2 arguments and both of them are optional:
text
-string
that can be either SHA-1,HEAD
, or notes.options
-string
that point to --ref. OrObject
which represent the Options.
When text
is undefined
notes......// ornotes...... // in case you need autocompletion in typescript
- Available operation:
add
,overwriteWith
,copyFrom
,append
,remove
,show
- Available handler:
at
,atCommit
,atFile
,atFolder
When text
is a notes (not identified as string HEAD
or hash)
notes'some long notes'... // in case you need autocompletion in typescript
- Available operation:
add
,overwrite
,copy
,append
- Available handler:
at
,atCommit
,atFile
,atFolder
When text
is a hash string
notessha... // in case you need autocompletion in typescript
- Available operation:
add
,overwriteWith
,copyFrom
,append
,remove
,show
- Available handler:
at
,atCommit
,atFile
,atFolder
Operation
add
Add notes on specific git-object (commit, blob/file, tree/folder, submodule, or tag)
- Arguments:
string
- Expected value: any string that represent notes but it can not be hash string or word
HEAD
- Return: ~
Example
;add;;
remove
Remove notes on specific git-object (commit, blob/file, tree/folder, submodule, or tag)
- Arguments: ~
- Expected value: ~
- Return: ~
Example
;;
show
Read notes on specific git-object (commit, blob/file, tree/folder, submodule, or tag)
- Arguments: ~
- Expected value: ~
- Return:
string
Example
mynotes1 = ;mynotes2 = ;console;
append
Append notes on specific git-object (commit, blob/file, tree/folder, submodule, or tag) that has/hasn't a notes.
- Arguments:
string
- Expected value: any string that represent notes but it can not be hash string or word
HEAD
- Return: ~
Example
;append;;
overwrite
or overwriteWith
Overwrite notes on specific git-object (commit, blob/file, tree/folder, submodule, or tag). The source can be notes on another git-object or provided manually
- Arguments:
string
- Expected value: any string that represent notes, hash string, or word
HEAD
- Return: ~
Example
const sourceNotes = "HEAD";;;overwrite;;;
copy
or copyFrom
Copy notes from git-object (commit, blob/file, tree/folder, submodule, or tag) to another git-object.
- Arguments:
string
- Expected value: must be hash string or word
HEAD
- Return: ~
Example
;copy; // same as `add` operation;
Handler
at(sha)
- Arguments:
string
- Expected value: must be hash string or word
HEAD
Example
;;
atCommit(message)
- Arguments:
string
- Expected value: must be valid commit message
Example
;
atFile(filename, commit)
- Arguments:
- filename -
string
- commit -
string
- filename -
- Expected value:
- commit - commit message or commit-id (SHA-1)
- filename - a valid filename of that specific commit. Can include relative path (without
./
) but not with absolute path
Example
;;;
atFolder(folder, commit)
- Arguments:
- folder -
string
- commit -
string
- folder -
- Expected value:
- commit - commit message or commit-id (SHA-1)
- folder - a valid folder of that specific commit. Must be relative path without prefix
./
and suffix '/'
Example
;;;
Options
The options are the combination of execa options plus this:
Who use this?
- guc-desktop
- [add yours 😉]
Contributing
- CONTRIBUTING.md for how you can make contribution
- HACKING.md for technical details