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

Consider GIT_AUTHOR_EMAIL/GIT_COMMITTER_EMAIL as current author/committer #72

Open blueyed opened 1 year ago

blueyed commented 1 year ago

When using $GIT_AUTHOR_EMAIL and $GIT_COMMITTER_EMAIL with something else than git config user.email, it will display a warning:

WARN Will not fix up past commits not authored by you, use --force to override, commit: …

I think that it should consider the env settings as the current owner - not sure if alone or additionally.

(FWIW, I am using the env variables to use different emails per projects.

It is easy enough to configure user.email there additionally, but that might require to do it with many sub-directories / projects for a company stored in a common ancestor dir, where setting the env can be done for all sub-directories more easily)

tummychow commented 1 year ago

would prefer to wait for upstream (https://github.com/libgit2/libgit2/issues/3751) rather than hacking this in myself. i only accepted https://github.com/tummychow/git-absorb/pull/22 because upstream explicitly declined to support it.

petski commented 1 month ago

FWIW, libgit2/libgit2#3751 is closed. The feature seems to be implemented.

tummychow commented 1 month ago

ah, that's good to know. ping this issue again when it's available in a git2-rs release and i'll bump for it