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.










share|improve this question






















  • 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










  • 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 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















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.










share|improve this question






















  • 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










  • 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 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













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.










share|improve this question













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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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 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










  • 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 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


















  • 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










  • 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 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
















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

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















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






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














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





















































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







Popular posts from this blog

Wiesbaden

Marschland

Dieringhausen