Repository
https://github.com/DrSensor/fluent-git
About
fluent-git is a Javascript/Typescript library for operating git client easier yet powerfull by leveraging Fluent API Design. For example if I want to add notes on specific file at specific commit, I need to execute some of git
commands just to get the hash id of that file then use that hash id when adding a notes using git notes add
.

git
commandBy using this library, you can do that easily using this expression:
notes('some long notes').add.atFile('README.md', 'Initial commit')
Current features
Currently this library focus on making git-notes easier yet powerful. This library implement 58% of git-notes subcommands (excluding merge
, prune
, and list
) which each of them can operate on file, folder, and commit message.
Technology Stack
For more details see HACKING.md.
📦 Main Dependencies
I'm using execa for executing the git
commands. I use it because it has better perfomance than most of the methods in child_process module, especially when executed in Windows. However, I will switch that with child_process.execFileSync if it's not running well in electron base app.
✔️ Test Framework/Approach
As usual, I'm using Jest as my testing-framework of choice. As you may guest, this library is pretty much overtested because it support 3 different expression (see the README). Also, I'm not yet test the CLI and atSubmodule
handler which lower the test coverage. Code coverage is a good indicator to indicate if something is missing/deleted but it's not a metric for measuring if the projects are fully tested.

The way I test this project is a bit different.
- I create a git submodule which pointed to this repo.
- I change the working directory where the test is running (see here) by using globalSetup
- Re-fetch (with force) all notes before and after the test is running.
♻️ CI and Build Tools
As usual, I use CircleCI to do the automation test and build. The reason I don't test it in Node v6 is because I use object destructuring in rollup.config.js and I don't know how to babelify the config 😂

Future Plans
- 💪 Implement search notes feature. Probably I will use combination of
git grep
along withgit notes list
🤔 - 🏗 Test it on multiple platform by using AppVeyor (for Windows) and Travis CI (for MacOS).
- 📶 Cache-restore the notes instead of force-update when running the test. I need it in case I want to maintain it when traveling.
- 🤔 Don't know if it's a good idea. I have been thinking making this as a monorepo project using lerna. I want to publish it in multiple npm packages.
- 😋 Create a mocking module just like Enzyme or Vue Test Utils.
How to contribute?
Just DM's me via Discord, make a Github issue/PR, or write a comments below if anyone interested. For guidelines, see Contributing section (contribution is always welcome so don't be afraid to make mistakes 🙂).