Where is the git documentation on creating custom subcommands?
up vote
1
down vote
favorite
It's easy to find documentation on creating git aliases [1] [2] or tutorials on creating custom subcommands (place git-your-subcommand
on your $PATH
to enable calling git your-subcommand
). However, apart from the docs on GIT_EXEC_PATH, I can find no documentation on https://git-scm.com about
creating custom subcommands or configuring how they are discovered.
git
|
show 3 more comments
up vote
1
down vote
favorite
It's easy to find documentation on creating git aliases [1] [2] or tutorials on creating custom subcommands (place git-your-subcommand
on your $PATH
to enable calling git your-subcommand
). However, apart from the docs on GIT_EXEC_PATH, I can find no documentation on https://git-scm.com about
creating custom subcommands or configuring how they are discovered.
git
I'm not sure what you mean to ask here. They are "discovered" by Git runninggit-blah
if you typegit blah
: Git sticksgit --exec-path
into$PATH
(at the front, actually) and then blindly attempts to run the git-blah command, and if that works, that must be the command. If it fails, there must not be any git-blah after all.
– torek
Nov 19 at 17:16
I'm looking for a URL to official-ish documentation on that process, preferably on git-scm.com, in the git repo, etc. I'm hoping make certain I understand the process, especially all configuration and environment variables involved.
– Steven Kalt
Nov 19 at 17:36
There isn't much, if anything, official here. The ultimate problem is that Git acquires new config and env settings all the time and the documentation for each is generally fairly scattered. The git-config documentation lists most of the formally-adopted config items, but some just get forgotten, e.g.,log.decorate
(added by Linus way back in late 1.x or early 2.x) went undocumented for several years.
– torek
Nov 19 at 17:47
1
That's the main bit of code, though there's a bunch of semi-related code for running hooks and filters as well, scattered through other source files. Note also that if Git can't find a command, it has a table of built in "known and common" commands and will do a Levenshtein distance calculation to suggest what you might have meant.
– torek
Nov 19 at 18:44
1
Look forrun_command
andrun_hook
inrun-command.c
; see also Documentation/technical/api-run-command.txt. See alsorun_builtin
ingit.c
andrun_shell
inshell.c
.
– torek
Nov 19 at 19:26
|
show 3 more comments
up vote
1
down vote
favorite
up vote
1
down vote
favorite
It's easy to find documentation on creating git aliases [1] [2] or tutorials on creating custom subcommands (place git-your-subcommand
on your $PATH
to enable calling git your-subcommand
). However, apart from the docs on GIT_EXEC_PATH, I can find no documentation on https://git-scm.com about
creating custom subcommands or configuring how they are discovered.
git
It's easy to find documentation on creating git aliases [1] [2] or tutorials on creating custom subcommands (place git-your-subcommand
on your $PATH
to enable calling git your-subcommand
). However, apart from the docs on GIT_EXEC_PATH, I can find no documentation on https://git-scm.com about
creating custom subcommands or configuring how they are discovered.
git
git
asked Nov 19 at 14:58
Steven Kalt
41059
41059
I'm not sure what you mean to ask here. They are "discovered" by Git runninggit-blah
if you typegit blah
: Git sticksgit --exec-path
into$PATH
(at the front, actually) and then blindly attempts to run the git-blah command, and if that works, that must be the command. If it fails, there must not be any git-blah after all.
– torek
Nov 19 at 17:16
I'm looking for a URL to official-ish documentation on that process, preferably on git-scm.com, in the git repo, etc. I'm hoping make certain I understand the process, especially all configuration and environment variables involved.
– Steven Kalt
Nov 19 at 17:36
There isn't much, if anything, official here. The ultimate problem is that Git acquires new config and env settings all the time and the documentation for each is generally fairly scattered. The git-config documentation lists most of the formally-adopted config items, but some just get forgotten, e.g.,log.decorate
(added by Linus way back in late 1.x or early 2.x) went undocumented for several years.
– torek
Nov 19 at 17:47
1
That's the main bit of code, though there's a bunch of semi-related code for running hooks and filters as well, scattered through other source files. Note also that if Git can't find a command, it has a table of built in "known and common" commands and will do a Levenshtein distance calculation to suggest what you might have meant.
– torek
Nov 19 at 18:44
1
Look forrun_command
andrun_hook
inrun-command.c
; see also Documentation/technical/api-run-command.txt. See alsorun_builtin
ingit.c
andrun_shell
inshell.c
.
– torek
Nov 19 at 19:26
|
show 3 more comments
I'm not sure what you mean to ask here. They are "discovered" by Git runninggit-blah
if you typegit blah
: Git sticksgit --exec-path
into$PATH
(at the front, actually) and then blindly attempts to run the git-blah command, and if that works, that must be the command. If it fails, there must not be any git-blah after all.
– torek
Nov 19 at 17:16
I'm looking for a URL to official-ish documentation on that process, preferably on git-scm.com, in the git repo, etc. I'm hoping make certain I understand the process, especially all configuration and environment variables involved.
– Steven Kalt
Nov 19 at 17:36
There isn't much, if anything, official here. The ultimate problem is that Git acquires new config and env settings all the time and the documentation for each is generally fairly scattered. The git-config documentation lists most of the formally-adopted config items, but some just get forgotten, e.g.,log.decorate
(added by Linus way back in late 1.x or early 2.x) went undocumented for several years.
– torek
Nov 19 at 17:47
1
That's the main bit of code, though there's a bunch of semi-related code for running hooks and filters as well, scattered through other source files. Note also that if Git can't find a command, it has a table of built in "known and common" commands and will do a Levenshtein distance calculation to suggest what you might have meant.
– torek
Nov 19 at 18:44
1
Look forrun_command
andrun_hook
inrun-command.c
; see also Documentation/technical/api-run-command.txt. See alsorun_builtin
ingit.c
andrun_shell
inshell.c
.
– torek
Nov 19 at 19:26
I'm not sure what you mean to ask here. They are "discovered" by Git running
git-blah
if you type git blah
: Git sticks git --exec-path
into $PATH
(at the front, actually) and then blindly attempts to run the git-blah command, and if that works, that must be the command. If it fails, there must not be any git-blah after all.– torek
Nov 19 at 17:16
I'm not sure what you mean to ask here. They are "discovered" by Git running
git-blah
if you type git blah
: Git sticks git --exec-path
into $PATH
(at the front, actually) and then blindly attempts to run the git-blah command, and if that works, that must be the command. If it fails, there must not be any git-blah after all.– torek
Nov 19 at 17:16
I'm looking for a URL to official-ish documentation on that process, preferably on git-scm.com, in the git repo, etc. I'm hoping make certain I understand the process, especially all configuration and environment variables involved.
– Steven Kalt
Nov 19 at 17:36
I'm looking for a URL to official-ish documentation on that process, preferably on git-scm.com, in the git repo, etc. I'm hoping make certain I understand the process, especially all configuration and environment variables involved.
– Steven Kalt
Nov 19 at 17:36
There isn't much, if anything, official here. The ultimate problem is that Git acquires new config and env settings all the time and the documentation for each is generally fairly scattered. The git-config documentation lists most of the formally-adopted config items, but some just get forgotten, e.g.,
log.decorate
(added by Linus way back in late 1.x or early 2.x) went undocumented for several years.– torek
Nov 19 at 17:47
There isn't much, if anything, official here. The ultimate problem is that Git acquires new config and env settings all the time and the documentation for each is generally fairly scattered. The git-config documentation lists most of the formally-adopted config items, but some just get forgotten, e.g.,
log.decorate
(added by Linus way back in late 1.x or early 2.x) went undocumented for several years.– torek
Nov 19 at 17:47
1
1
That's the main bit of code, though there's a bunch of semi-related code for running hooks and filters as well, scattered through other source files. Note also that if Git can't find a command, it has a table of built in "known and common" commands and will do a Levenshtein distance calculation to suggest what you might have meant.
– torek
Nov 19 at 18:44
That's the main bit of code, though there's a bunch of semi-related code for running hooks and filters as well, scattered through other source files. Note also that if Git can't find a command, it has a table of built in "known and common" commands and will do a Levenshtein distance calculation to suggest what you might have meant.
– torek
Nov 19 at 18:44
1
1
Look for
run_command
and run_hook
in run-command.c
; see also Documentation/technical/api-run-command.txt. See also run_builtin
in git.c
and run_shell
in shell.c
.– torek
Nov 19 at 19:26
Look for
run_command
and run_hook
in run-command.c
; see also Documentation/technical/api-run-command.txt. See also run_builtin
in git.c
and run_shell
in shell.c
.– torek
Nov 19 at 19:26
|
show 3 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53377287%2fwhere-is-the-git-documentation-on-creating-custom-subcommands%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I'm not sure what you mean to ask here. They are "discovered" by Git running
git-blah
if you typegit blah
: Git sticksgit --exec-path
into$PATH
(at the front, actually) and then blindly attempts to run the git-blah command, and if that works, that must be the command. If it fails, there must not be any git-blah after all.– torek
Nov 19 at 17:16
I'm looking for a URL to official-ish documentation on that process, preferably on git-scm.com, in the git repo, etc. I'm hoping make certain I understand the process, especially all configuration and environment variables involved.
– Steven Kalt
Nov 19 at 17:36
There isn't much, if anything, official here. The ultimate problem is that Git acquires new config and env settings all the time and the documentation for each is generally fairly scattered. The git-config documentation lists most of the formally-adopted config items, but some just get forgotten, e.g.,
log.decorate
(added by Linus way back in late 1.x or early 2.x) went undocumented for several years.– torek
Nov 19 at 17:47
1
That's the main bit of code, though there's a bunch of semi-related code for running hooks and filters as well, scattered through other source files. Note also that if Git can't find a command, it has a table of built in "known and common" commands and will do a Levenshtein distance calculation to suggest what you might have meant.
– torek
Nov 19 at 18:44
1
Look for
run_command
andrun_hook
inrun-command.c
; see also Documentation/technical/api-run-command.txt. See alsorun_builtin
ingit.c
andrun_shell
inshell.c
.– torek
Nov 19 at 19:26