archive: expand only a single %(describe) per archive
commit96099726ddb00b45135964220ce56468ba9fe184
authorRené Scharfe <l.s.r@web.de>
Sun, 28 Feb 2021 11:22:47 +0000 (28 12:22 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 11 Mar 2021 21:22:44 +0000 (11 13:22 -0800)
tree67511a24e20bf148d232a8595719cb8bf48d4077
parent273c9901c2ebfb2dae0c52de912bf3f57be19aac
archive: expand only a single %(describe) per archive

Every %(describe) placeholder in $Format:...$ strings in files with the
attribute export-subst is expanded by calling git describe.  This can
potentially result in a lot of such calls per archive.  That's OK for
local repositories under control of the user of git archive, but could
be a problem for hosted repositories.

Expand only a single %(describe) placeholder per archive for now to
avoid denial-of-service attacks.  We can make this limit configurable
later if needed, but let's start out simple.

Reported-by: Jeff King <peff@peff.net>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/gitattributes.txt
archive.c
archive.h
pretty.c
pretty.h
t/t5001-archive-attr.sh