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

[BUG] git archive formats and dashdash

From
ILIlari Liusvaara <ilari.liusvaara@elisanet.fi>
Date
Dec 10, 2009, 21:26 UTC
Message-ID
<20091210212636.GA27722@Knoppix>
--format option of git archive stops working if -- is used:

Shell session: ---------------- $ git archive -o test3.zip --format=zip master -- exec_cmd.c $ file test3.zip test3.zip: POSIX tar archive

# Eh...

$ git archive -o test4.zip --format=zip master exec_cmd.c $ file test4.zip test4.zip: Zip archive data, at least v1.0 to extract

# That worked.
----------------

The bug seems to be in that archive appends the --format option to its arguments, not taking into account that there may be -- before that point, disabling option interpretation.

Git version 1.6.6-rc2
-Ilari
Next: Junio C Hamano
Message 1 of 11 in “[BUG] git archive formats and dashdash”
  1. Ilari LiusvaaraDec 10, 2009
  2. Junio C HamanoDec 10, 2009
  3. Miklos VajnaDec 10, 2009
  4. Junio C HamanoDec 10, 2009
  5. Fix archive format with -- on the command lineJunio C Hamano, Dec 10, 2009
  6. Junio C HamanoDec 10, 2009
  7. René ScharfeDec 12, 2009
  8. Nanako ShiraishiDec 30, 2009
  9. Junio C HamanoDec 30, 2009
  10. Ilari LiusvaaraDec 10, 2009
  11. builtin-archive: insert --format before double dash if necessary.Miklos Vajna, Dec 10, 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.