Thread (16 messages) 16 messages, 4 authors, 2021-03-06

Re: [PATCH 1/2] pretty: add %(describe)

flat view

From: René Scharfe. <hidden>
Date: 2021-02-16 17:15:37

Am 16.02.21 um 14:00 schrieb Ævar Arnfjörð Bjarmason:
On Sun, Feb 14 2021, René Scharfe wrote:
quoted
Add a format placeholder for describe output.  Implement it by actually
calling git describe, which is simple and guarantees correctness.  It's
intended to be used with $Format:...$ in files with the attribute
export-subst and git archive.
Does it really guarantee correctness though? In "builtin/describe.c" we
first walk over the refs and use that to format all N items we're asked
about.

Under "git log" this is presumably in a race where refs added/deleted
during the run of "git log" will change the describe output to be
inconsistent with earlier lines.
Right, didn't think of that aspect.  So we'd better warn about the
raciness in the documentation.

We could improve that by keeping a single describe process around and
feeding it object names through a pipe as we go.  The results would
still become outdated after a ref is added or removed, but they'd be
consistent.  This would be faster as well.

René
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help