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

[Question] Where is the alias "git cache" defined? #54

Closed
jmarrec opened this issue Jan 28, 2025 · 1 comment
Closed

[Question] Where is the alias "git cache" defined? #54

jmarrec opened this issue Jan 28, 2025 · 1 comment

Comments

@jmarrec
Copy link

jmarrec commented Jan 28, 2025

I'm not familiar with Rust, and definitely not familiar with any of the crates you used, so after trying to look at the code I still don't understand where is the "git cache" (as opposed to git-cache) alias is stored. My ~/.gitconfig has no trace of it.

$ which git-cache 
~/.cargo/bin/git-cache

I'm genuinely curious to understand how this works, thanks!

@jmarrec
Copy link
Author

jmarrec commented Jan 28, 2025

Oh well, I actually found it https://stackoverflow.com/a/10978296/2543372, sorry for the question!

As you can see in the source code in execv_dashed_external, If you make the command git-my-custom-made-extension, then git will alias:

git my-custom-made-extension ... → git-my-custom-made-extension ...
git help my-custom-made-extension → man git-my-custom-made-extension

There's nothing special about "extending git". Just build a program as you would normally, and make sure the name starts with git-

TIL!

@jmarrec jmarrec closed this as completed Jan 28, 2025
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

No branches or pull requests

1 participant