Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not respecting gitconfig #26

Open
djetelina opened this issue Oct 2, 2024 · 2 comments
Open

Not respecting gitconfig #26

djetelina opened this issue Oct 2, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@djetelina
Copy link

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 = [email protected]

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

@sharpvik
Copy link
Owner

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!

@sharpvik sharpvik added the bug Something isn't working label Oct 23, 2024
@djetelina
Copy link
Author

I quickly tried to scan go-git issues to understand whether it works or not and I didn't come to a conclusion (there is an issue for it but it's unclear whether it's supposed to work or not from the discussion, but i'm not a golang person), if bumping the version fixes it, then that seems like the easiest way to fix it. If it does not, I don't see the harm in exec/benefit of using the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants