git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Git archive and trailing "/" in prefix

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Oct 8, 2009, 20:35 UTC
Message-ID
<alpine.LFD.2.01.0910081329570.3432@localhost.localdomain>
In-Reply-To
<loom.20091008T172303-658@post.gmane.org>
On Thu, 8 Oct 2009, Sergio Callegari wrote:
> 
> The git-archive man page indicates that if the --prefix option is passed to
> git-archive, it is compulsory to end the prefix with a "/"
Yeah, that part is intentional. And:
> As a matter of fact, the archiver behaves quite strangely if that slash is
> missing. Files in the root of the working dir are added to the archive with
> their own name modified by the prefix and the same happens for working dir
> sub-directories.
So far so good. But
> However, no file present in the sub-directories, nor sub-sub-directories 
> are added.

Ok, that is a bug. It's supposed to just add the prefix to everything, and it sounds like it's simply broken. I wonder how long it's been broken? Perhaps forever.

> I would like to know if there some reason why a trailing "/" is not added
> automatically to the prefix when it is missing and the prefix is not empty.
> Would that break anything?

It really was meant to be useful to prefix things without forcing a directory structure. IOW, being able to use "--prefix=compat-" and just have everything unpack with their own names, but with the prefix.

Whether anybody uses that, and whether it's worth it, I can't say.
			Linus
Previous: Junio C Hamano
Message 7 of 7 in “Git archive and trailing "/" in prefix”
  1. Sergio CallegariOct 8, 2009
  2. Junio C HamanoOct 8, 2009
  3. Sergio CallegariOct 8, 2009
  4. René ScharfeOct 9, 2009
  5. René ScharfeOct 8, 2009
  6. Junio C HamanoOct 9, 2009
  7. Linus TorvaldsOct 8, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.