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

Re: git archive

From
KJkenneth johansson <ken@kenjo.org>
Date
Oct 22, 2008, 18:45 UTC
Message-ID
<gdnsca$92r$2@ger.gmane.org>
In-Reply-To
<20081022130829.GC2015@riemann.deskinm.fdns.net>
On Wed, 22 Oct 2008 09:08:29 -0400, Deskin Miller wrote:
Show 12 quoted lines
> On Wed, Oct 22, 2008 at 08:42:01AM +0000, kenneth johansson wrote:
>> I was going to make a tar of the latest stable linux kernel. Done it
>> before but now I got a strange problem.
>> 
>> >git archive --format=tar v2.6.27.2
>> fatal: Not a valid object name
> 
> I had the same thing happen to me, while trying to make an archive of
> Git. Were you perchance working in a bare repository, as I was?  I spent
> some time looking at it and I think git archive sets up the environment
> in the wrong order, though of course I never finished a patch so I'm
> going from memory:
Yes it was a bare repository.
Show 9 quoted lines
> 
> After looking at the code again, I think the issue is that git_config is
> called in builtin-archive.c:cmd_archive before setup_git_directory is
> called in archive.c:write_archive.  The former ends up setting GIT_DIR
> to be '.git' even if you're in a bare repository.  My coding skills
> weren't up to fixing it easily; moving setup_git_directory before
> git_config in builtin-archive caused last test of t5000 to fail:
> GIT_DIR=some/nonexistent/path git archive --list should still display
> the archive formats.

if I do GIT_DIR=. git archive --format=tar v2.6.27.2

it does work so it looks like you are on the right track.
Previous: Deskin MillerNext: Deskin Miller
Message 3 of 14 in “git archive”
  1. kenneth johanssonOct 22, 2008
  2. Deskin MillerOct 22, 2008
  3. kenneth johanssonOct 22, 2008
  4. archive: fix setup to work in bare repositoriesDeskin Miller, Oct 22, 2008
  5. Jeff KingOct 22, 2008
  6. Charles BaileyOct 22, 2008
  7. Fixed git archive for bare reposCharles Bailey, Oct 22, 2008
  8. Deskin MillerOct 23, 2008
  9. René ScharfeOct 24, 2008
  10. Fixed git archive for bare reposDeskin Miller, Oct 25, 2008
  11. Junio C HamanoOct 25, 2008
  12. Nguyen Thai Ngoc DuyOct 23, 2008
  13. Deskin MillerOct 23, 2008
  14. Nguyen Thai Ngoc DuyOct 24, 2008

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.