Re: What's cooking in git.git (Apr 2019, #01; Thu, 4)
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 8, 2019, 04:28 UTC
- Message-ID
- <xmqqa7h1aznl.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <87ef6eaoub.fsf@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 6 quoted lines
> unique (AFAICT "actually unique" in practice) in the parallel in-flight > jh/trace2-sid-fix > (https://public-inbox.org/git/4352952677a11776a18ec9b6862cf358307cfafd.1553879063.git.gitgitgadget@gmail.com/) > > I think it's fine to merge js/trace2-to-directory down as it is, but do > you/Josh think that retry logic needs to stay with that sort of SID?
I do not speak for Josh, but I think the only two logical choices are to open with (O_CREAT|O_EXCL) and
(1) fallback with .%d suffix, making it clear that we are not
willing to lose log files even when SID generation is botched; or (2) die/BUG when it fails, making it clear that we do rely on the
guanateed uniqueness of SID.A distant third may be to warn when open with O_CREAT|O_EXCL fails, but I am not sure what its value would be to do so---especially if we trust in the "actually unique in practice". Between (1) and (2), I have a slight preference to (1) over (2), as that is much easier to explain.
Those who want to have a "fixed width" thing could just ignore the ones with suffix---as long as the "actually unique in practice" claim holds, doing so will not lose any non-negligible amount of information anyway.