git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Git internal command line parser

From
Lemuria <nekadek457@gmail.com>
Date
Dec 25, 2021, 08:32 UTC
Message-ID
<65fdfd25-736f-5105-6eba-b70cd51cc780@gmail.com>
In-Reply-To
<bZ5IKn77iTM5gCits_kl5lZ7uiOOkkt8dcHPT1UVlPWsrnqapXBtAkYB4uGGBA3Oizq4J7BN4GC6mLR8wQ7x_qqLJPbae6IMTqxW9JFJSbg=@protonmail.com>
On 25/12/2021 10:55 am, João Victor Bonfim wrote:
Show 7 quoted lines
>> 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.
> 
> That seems undesirable...
> I know operating otherwise would be even more complicated and might create undue complexity or diminish performance, but I guess that, if it works, don't mess with it.
> 
Was this directed towards Lemuria (me)?
Show 10 quoted lines
>> And I likely will consider this "front-end to many separate
> executable apps" approach for my future large projects.
> 
> Lemuria, please consider those points as, sometimes, what is great at performance might not help with scalability and other matters, therefore, as the designer/engineer of a software system, a choice must be made and an evaluation of the properties of each possibility is a necessity.
> 
> Do with that what you will.
> 
>> I'm also a beginner to C, not quite an expert at it.
> 
> Practice programming a lot and never forget two things: [1] you are working with a man made machine, therefore its limitations and capabilities are by design, so you must consider them every step of the way when developing (like how computers send information, how computers process informations, how machine behaviour can be altered, abused or exploited through alteration of the environment or mechanism and through the use of sleight of hand). [2] Your code always has real life consequences and it is your moral responsibility to consider them and make sure that prejudice isn't codified into them.

Okay, I understand. I'll do everything to keep my code bias-free. I'm working on a project in C and if it's okay, I'll link you to the GitHub repository.

I'm sure the git mailing list isn't the right place for me to get criticism on that project however.

Show 51 quoted lines
> Those are my two tid bits about being a responsible and effective programmer.
> 
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> 
> Em sexta-feira, 24 de dezembro de 2021 às 15:36, Philip Oakley <philipoakley@iee.email> escreveu:
> 
>> On 24/12/2021 18:30, Lemuria wrote:
>>
>>> 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.
>>
>>>>> 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
Previous: João Victor BonfimNext: João Victor Bonfim
Message 7 of 11 in “Git internal command line parser”
  1. LemuriaDec 24, 2021
  2. Philip OakleyDec 24, 2021
  3. LemuriaDec 24, 2021
  4. Philip OakleyDec 24, 2021
  5. LemuriaDec 24, 2021
  6. João Victor BonfimDec 25, 2021
  7. LemuriaDec 25, 2021
  8. João Victor BonfimDec 26, 2021
  9. LemuriaDec 26, 2021
  10. Philip OakleyDec 27, 2021
  11. João Victor BonfimDec 29, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.