Re: Git internal command line parser
- From
Philip Oakley <philipoakley@iee.email>
- Date
- Dec 24, 2021, 18:36 UTC
- Message-ID
- <cc6fa52a-d782-d4a8-eb93-936b8d83fc2f@iee.email>
- In-Reply-To
- <0e0f78e9-2cde-a20e-cd47-8542bc7bd314@gmail.com>
On 24/12/2021 18:30, Lemuria wrote:
Show 18 quoted lines
> > > On 25/12/2021 2:13 am, Philip Oakley wrote: >> On 24/12/2021 14:38, Lemuria wrote: >>> #=< TLDR: Where's the code for git's internal command line parser? >>> >===# >>> >>> I'm interested in the internals of git, more specifically it's command >>> line parser. >> >> One place to start is https://github.com/git/git/blob/master/git.c >> > > Wait, is all of Git just one big executable or are there many > executables and `git` is just the front-end for accessing the > separate git executables, such as say, the one for processing > commits? >
Yes, `git` is a front end.
If you are on Windows, it gets even more interesting because all the individual sub-commands are just hard links back to the single git.exe that then links to those sub-command's code.
Show 12 quoted lines
>>> >>> Does Git use a library like getopt for it's command line handling, or >>> does it use a custom parser? >>> >>> If possible, I would appreciate being redirected to the source code >>> files that handle this. >>> >>> Sincerely, >>> Lemuria >> >> Philip >>