Re: [PATCH] reftable: honor core.fsync
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 23, 2024, 19:31 UTC
- Message-ID
- <xmqq34unn8x4.fsf@gitster.g>
- In-Reply-To
- <pull.1654.git.git.1706035870956.gitgitgadget@gmail.com>
"John Cai via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 6 quoted lines
> 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?
* 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.