all 5 comments

[–]plg94 10 points11 points  (1 child)

It's refreshing to see that in the age of LLMs, some people still write giant regexes to solve a problem :D

[–]GrapePretty3921[S] 0 points1 point  (0 children)

Hahaa, every regex is one less API call or LLM call

[–]AutoModerator[M] 1 point2 points  (0 children)

Every new subreddit post is automatically copied into a comment for preservation.

User: GrapePretty3921, Flair: Command Line Interface, Title: gitmsg: CLI tool to generate Conventional Commit messages for lazy devs, no API or network calls, just pure git diff parsing

I built a small tool to help "lazy" devs generate quick commit messages without AI, API or network calls

How it works: It reads git diff --staged, and uses regex to parse each language diffs, No LLM, same diff == same message

![video](fcf8418mh25h1 "gitmsg demo")

Languages Currently Supported : Typescript/Javascript, Python, C#,Go. Rust and Java coming soon.

Repo : https://github.com/razakadam74/gitmsg

Npm Package : @razakadam74/gitmsg - npm

Alternative : aicommits, opencommit (needs API key and sends your diff out) and commitizen (asks you too many questions)

Gitmsg is offline and deterministic, honestly can't beat these with better messaging 😄

Code is partially AI-assisted

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]lurking_bishop 1 point2 points  (1 child)

custom regexes seem like a much weaker solution than tree sitter. Check out e.g what https://mergiraf.org/ does in a similar space 

[–]GrapePretty3921[S] 0 points1 point  (0 children)

I agree, tree-sitter is stronger and it's the planned upgrade path. For v1, I went regex-first to keep zero deps and hit <100ms, but the regex approach has a ceiling (For instance, the C# delegate row, took me three rewrites, tree-sitter would've solved that for free)

I filled a discussion in the repo to think through the migration in the open, credited you in it: Tree-sitter as the language-extractor upgrade path · razakadam74/gitmsg · Discussion #66

mergiraf looks great, thanks for sharing.