Re: [RFC PATCH 4/5] t1700-split-index: date back files to avoid racy situations
- From
SZEDER Gábor <szeder.dev@gmail.com>
- Date
- Sep 6, 2018, 09:15 UTC
- Message-ID
- <20180906091539.GA8805@localhost>
- In-Reply-To
- <871sa7rr30.fsf@evledraar.gmail.com>
On Thu, Sep 06, 2018 at 10:02:43AM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 10 quoted lines
>
> On Thu, Sep 06 2018, SZEDER Gábor wrote:
>
> > +# Create a file named as $1 with content read from stdin.
> > +# Set the file's mtime to a few seconds in the past to avoid racy situations.
> > +create_file () {
>
> Nit: Would be easier to read in the future as
> e.g. s/create_file/create_old_file/ or something like that. I.e. so you
> can see at a glance from the tests themselves what this is doing.Perhaps; but then I'm not so sure about 'old', because that's just a property of the resulting file... I'm inclined to rename it to 'create_non_racy_file' to also imply "why" this function is used instead of plain old '>file'.