Thumbnail for the post

git-changes

I'm the kind of guy who likes to write long commit messages, at least I try to sometimes. But the problem is that it's hard to keep track of all the changes that you have made for a specific feature or a fix. So, as always, I decided to make something that allows me to do that.

And here is a small documentation on how to use it.


What does it do?

At the very least, I wanted a way to add messages to each change that I add, and also what kind of change it was, something like this.

git add <files> -m messages [--type=feat]

Of course, I cannot change git-add (maybe I should try it someday), so I wrote a Python package that allows me to do what I want to do.

As an engineer, if something does not work the way you want it to, you make it work the way you want it to. - some engineer


Installation

You can easily install it with pip, you just need to have a Python version >=3.12. The package itself does not have any dependencies.

pip3 install git-changes

That's it.


Usage

Let's make a really simple example repo, with some test files to see how git-changes works.

mkdir git_changes_demo
cd git_changes_demo

Initializing

Now let's initialize a git repo !important, and also initialize git-changes

git init
gitc --init

Running gitc --init creates all the git aliases, adds a post-commit file, and also sets the commit template that it needs to work properly.

With that, we can now start adding messages to each change.

Add

Let's create two test files.

touch test.py something.py

Now this is a dead simple example, but you get the idea :)

$ git addm test.py -m 'Added test file' --type=test
[test] Added test file
$ git addm something.py -m 'Added something' --type=feat
[feat] Added something

Instead of add, you use addm in order to add a change along with a message.

--type refers to the "type" of change; by default, it's feat. The support types are feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert

Show Message

In order to list the messages that will be added in the next commit, you can use the show-messages command.

$ git show-messages
[test] Added test file
[feat] Added something

Commit

Not it's time to commit.

Simply run

git commit

This should open up your default terminal editor with all the change messages that you have set.

git-changes-commit-msg-image

NOTE: you have to make some changes to this file, as this is a template that git loads if you don't make any changes, git will complain about it and won't commit. I suggest adding a title at the top that summarizes all the changes,

Now we can look at the logs to see what the commit messages look like.

$ git show
commit 4f62c5f83154af7485817e51e9a4d0819fb43aa2 (HEAD -> dev)
Author: Adwaith-Rajesh <me@adwaith.dev>
Date:   Sun Aug 10 17:49:28 2025 +0530

 test commit
 [test] Added test file
 [feat] Added something

diff --git a/something.py b/something.py
new file mode 100644
index 0000000..e69de29
diff --git a/test.py b/test.py
new file mode 100644
index 0000000..e69de29

Once a successful commit is made, the messages will reset.

$ git show-messages
No commit messages yet!.. To add a new message, run
git addm -m <message> [--type]

Resetting Messages

You can manually reset commit messages by using --reset

gitc --reset

That's it, it's simple and easy to use (ig). Try it out, if you have any issues, report them and I will fix them :)


Bye...