sharpvik / sema

Semantic commit tool
MIT License
56 stars 3 forks source link

Not respecting gitconfig #26

Open djetelina opened 3 weeks ago

djetelina commented 3 weeks ago

Hey, love the tool, but the very first use I already had to amend a commit to change the author email, because my git config wasn't respected :(

What I mean by that, I have different git configs loaded (overriding author email) base on the directory git is called from.

[includeIf "gitdir:~/Documents/work/company/**"]
        path = ~/Documents/work/company/.gitconfig
---
# the other .gitconfig
[user]
    name = Ma Name
    email = my.name@company.com

Unfortunately, sema doesn't seem to respect that :(

sharpvik commented 1 day ago

Hey there @djetelina!

Ye, that sounds very much plausible. During its early versions, sema used to rely on the native git command calling it directly though exec.Command. However, someone later suggested that we hop onto a git library that is supposed to be identical to the reference implementation CLI everyone uses.

Unfortunately, after making that switch, I realised that this library doesn't respect many things, including, for example, pre-commit hooks (which is a bummer).

Regarding the issue, here are some things that we can try:

  1. Bump the git library version and hope that they fixed it.
  2. Raise this issue with them and hope that they include things like hooks and .gitconfig into their implementation.
  3. Go back to the way it was, completely removing that library as a dependency but start depending on the user's git CLI currently installed on their machine.

I'd love to hear your opinion on the matter!