Subject: Re: [PATCH v2] archive: make --add-virtual-file honor --prefix

From: Junio C Hamano <[email-masked]>
Date: Mon, 20 May 2024 10:55:26 -0700

Tom Scogland <[email-masked]> writes:

> That said, it sounds like both you and Junio prefer updating the
> docs rather than the code, which makes me think I'm in the
> minority in that opinion.  If that's the case, I can certainly
> update the docs, and I imagine we can backport that easily
> wherever it makes sense.  I would really like to have the option
> to have the prefix apply though, either adding a new flag or an
> option to the existing one that would be invalid given current
> syntax or similar to provide the option.

[jc: wrapped overly long lines]

Wouldn't

    #!/bin/sh
    prefix=foo/bar
    git archive --prefix="$prefix" --add-file=x --add-file=y \
	--add-virtual-file="$prefix/path:contents"

be an option enough?  You only have to define $prefix once.