Repository specific git commands
From: Ciprian Dorin Craciun <hidden>
Date: 2016-06-15 22:44:02
Hello all!
I have a question / proposal: I see on the mailing list a lot of
situations when some commands (or group of commands) are very often
used and the users demand (or would like to have) a special "git xxx"
command for them. But adding such a command -- in almost all cases --
is not worth the effort or increases the number of available commands
(thus confusing even more the users).
Thus the users are left with only two possibilities:
-- either define an alias -- but usually it is very restrictive in
terms of what the alias can do;
-- create a custom git command "git-xxx" and place it in the
executable path -- but this requires root access.
(-- or write a custom script but this can not be invoked as "git xxx")
=> Thus neither option is very useful.
So my proposal is to let the users create a special folder inside
the .git directory, for example ".git/bin" where they can place custom
built git files like "git-xxx", and when they issue "git xxx" this
folder is searched first, and if the command is found it will be
executed as any other "git-xxx".
For this I attach a very simple patch that implements it. (It
modifies the execv_git_cmd function by adding a new path in the paths
array.)
Comments? Opinions? Other solutions that I am not aware of?
(Please note that I am a git user for only a couple of months, and
this is the first time I look over git source code...)
Thanks,
Ciprian Craciun. Attachments
- patch.diff [text/x-diff] 779 bytes · preview