Skip to content

Conversation

@cnaples79
Copy link

@cnaples79 cnaples79 commented Jan 19, 2026

Summary

  • resolve git aliases before dispatching hooks so aliased commands still trigger hook logic
  • expand aliases using git config (ignoring shell aliases) and prepend alias args to original args
  • add tests covering alias expansion and argument passthrough

Rationale

Commands invoked via git aliases (e.g., , ) were bypassing git-ai hooks. Resolving aliases to their underlying commands ensures hooks still run.

Changes

  • resolve alias definitions and rewrite parsed command/args prior to hook dispatch
  • ignore shell-style aliases
  • add unit tests for alias expansion behavior

Test Plan

  • unit tests added for alias expansion

Closes #377

@CLAassistant
Copy link

CLAassistant commented Jan 19, 2026

CLA assistant check
All committers have signed the CLA.

@svarlamov svarlamov self-assigned this Jan 19, 2026
@svarlamov
Copy link
Member

@cnaples79 Thank you so much for your first contribution to Git AI!

Excited to get this functionality merged in! Do you have a some time to add more end-to-end tests via the TestRepo harness and possibly take a look at a native git config implementation? #377

I think gix-config is production-ready: https://github.com/GitoxideLabs/gitoxide/tree/main/gix-config

I'm open to merging without a native git config implementation, however, in that case, I think we should add a benchmark to verify we're not adding more than 5-10ms per command. Thanks again and happy to talk this through https://calendly.com/acunniffe/meeting-with-git-ai-authors anytime

@svarlamov
Copy link
Member

@cnaples79 I would love to be able to merge this soon. Have you had a chance to look at the CLA?

@cnaples79
Copy link
Author

@svarlamov I've signed the CLA! Sorry I missed your first comment. I can definitely take some time for your requests, it may be a couple days though I'm currently out of town.

@svarlamov
Copy link
Member

Just a heads up #376 is being kindly picked up by @bernoussama so will probably have to try to sync up these PRs. Probably the fix for #376 first and hopefully it'll all just work with this PR. Thanks folks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ensure hooks work for git aliased commands

3 participants