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

Re: [PATCHv3 2/2] submodule: port init from shell to C

From
Stefan Beller <sbeller@google.com>
Date
Jan 20, 2016, 22:33 UTC
Message-ID
<CAGZ79kajF9zR_m0+hbvasf+rwQcuDeywCzmdjuT6C4M5MBvmUQ@mail.gmail.com>
In-Reply-To
<xmqq60yo55jh.fsf@gitster.mtv.corp.google.com>
On Wed, Jan 20, 2016 at 1:01 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 24 quoted lines
> Stefan Beller <sbeller@google.com> writes:
>
>> By having the `init` functionality in C, we can reference it easier
>> from other parts in the code.
>>
>> Signed-off-by: Stefan Beller <sbeller@google.com>
>> Signed-off-by: Junio C Hamano <gitster@pobox.com>
>> ---
>
> How faithful a conversion is this aiming to be?  For example, one
> thing I noticed is that some messages that were originally given
> with "say" and sent to the standard output, which is emitted to the
> standard error with this rewrite.  I didn't read both patches
> carefully, so there may be other discrepancies I didn't spot.
>
> I think you would want to do this in three steps:
>
>  - A faithful rewrite from shell to C;
>
>  - s/printf/fprintf(stderr, / for some messages; and finally
>
>  - Hiding of some messages under --quiet.
>
> in the above order.

"say" respects the setting of GIT_QUIET, which is usually set when --quiet is passed, so I think I want:

-  A faithful rewrite from shell to C including messages respecting
   --quiet, such that the "say" behavior is kept.
- s/printf/fprintf(stderr, / for some messages
and then be done with it.

Thanks, Stefan

>
Previous: Junio C HamanoNext: Junio C Hamano
Message 12 of 16 in “Port `git submodule init` from shell to C”
  1. 0/2 Port `git submodule init` from shell to CStefan Beller, Jan 15, 2016
  2. 1/2 submodule: Port resolve_relative_url from shell to CStefan Beller, Jan 15, 2016
  3. 2/2 submodule: Port init from shell to CStefan Beller, Jan 15, 2016
  4. Junio C HamanoJan 19, 2016
  5. 0/2 Port `git submodule init` from shell to CStefan Beller, Jan 20, 2016
  6. 1/2 submodule: port resolve_relative_url from shell to CStefan Beller, Jan 20, 2016
  7. Johannes SixtJan 22, 2016
  8. Stefan BellerJan 22, 2016
  9. 2/2 submodule: port init from shell to CStefan Beller, Jan 20, 2016
  10. 2/2 submodule: port init from shell to CStefan Beller, Jan 20, 2016
  11. Junio C HamanoJan 20, 2016
  12. Stefan BellerJan 20, 2016
  13. Junio C HamanoJan 20, 2016
  14. 2/2 submodule: port init from shell to CStefan Beller, Jan 21, 2016
  15. Junio C HamanoJan 22, 2016
  16. Stefan BellerJan 22, 2016

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.