tummychow / git-absorb

git commit --fixup, but automatic
https://crates.io/crates/git-absorb
BSD 3-Clause "New" or "Revised" License
3.35k stars 59 forks source link

absorb does't take `includeIf` gitconfig into account #112

Open skoch13 opened 4 months ago

skoch13 commented 4 months ago

I have a respective includeIf directive in my gitconfig which changes user (name, email) for repos in the configured directory. While executing git config user.email returns the proper result, absorb tries to use the default global user (and asks to force the commit creation as it's being unable to find my commits).

tummychow commented 4 months ago

this is almost certainly some kind of upstream issue. do you have a complete gitconfig example you can share that reproduces?

skoch13 commented 4 months ago

Sure,

[user]
 name = Sergey Kochetkov
 email = skoch13@***
 login = skoch13
[includeIf "hasconfig:remote.*.url:*://%URI%/**"]
  path = .gitconfig-override
#.gitconfig-override
[user]
 email = skoch13@test.com

1 - default git user 2 - user override

Screenshot 2024-04-15 at 16 24 18

tummychow commented 4 months ago

yup: https://github.com/libgit2/libgit2/issues/6641

you might be better served putting those overrides in the repository-level git config if it's important

skoch13 commented 4 months ago

that's a bummer. thank you