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

Re: [PATCH] reftable: honor core.fsync

From
John Cai <johncai86@gmail.com>
Date
Jan 23, 2024, 21:42 UTC
Message-ID
<0F4C94D3-B81E-4E88-B5F7-7A3746A6DB79@gmail.com>
In-Reply-To
<xmqq34unn8x4.fsf@gitster.g>
Hi Junio,
On 23 Jan 2024, at 14:31, Junio C Hamano wrote:
Show 14 quoted lines
> "John Cai via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
>> This commits adds a flush function pointer as a new member of
>> reftable_writer because we are not sure that the first argument to the
>> *write function pointer always contains a file descriptor. In the case of
>> strbuf_add_void, the first argument is a buffer. This way, we can pass
>> in a corresponding flush function that knows how to flush depending on
>> which writer is being used.
>
> A comment and a half.
>
>  * Can't the new "how to flush" go to the write-option structure?
>    If you represent "no flush" as a NULL pointer in the flush member,
>    most of the changes to the _test files can go, no?
That's a good option and cuts down on code changes. Thanks for the suggestion.
Show 14 quoted lines
>
>  * For a function
>
> 	int func(int ac, char **av);
>
>    a literal pointer to it can legally be written as either
>
> 	int (*funcp)(int, char **) = &func;
> 	int (*funcp)(int, char **) = func;
>
>    but it is my understanding that this codebase prefers the latter,
>    a tradition which goes back to 2005 when Linus was still writing
>    a lot of code, i.e. the identifier that is the name of the
>    function, without & in front.
good to know, thanks
John
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 10 in “reftable: honor core.fsync”
  1. reftable: honor core.fsyncJohn Cai via GitGitGadget, Jan 23, 2024
  2. Junio C HamanoJan 23, 2024
  3. John CaiJan 23, 2024
  4. Junio C HamanoJan 23, 2024
  5. Patrick SteinhardtJan 24, 2024
  6. Junio C HamanoJan 24, 2024
  7. Kristoffer HaugsbakkJan 23, 2024
  8. John CaiJan 23, 2024
  9. Patrick SteinhardtJan 29, 2024
  10. Junio C HamanoJan 29, 2024

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.