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

Re: [PATCH] git-archive: document CWD effect

From
Junio C Hamano <junkio@cox.net>
Date
Apr 9, 2007, 20:00 UTC
Message-ID
<7v7islz5bw.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<461A55FB.6070600@lsrfire.ath.cx>
René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:
Show 19 quoted lines
> Junio C Hamano schrieb:
> ...
>> Since people who _really_ want a subtree can
>> just say "git archive --format=tar HEAD:Documentation", I
>> suspect we may be better off not doing "current directory only"
>> by default.  This changes the behaviour, but (1) it affects only
>> people who run from a subdirectory, (2) it is counterintuitive
>> that your location in the working tree matters when you say "I
>> want a tarball of that commit", and (3) it is an undocumented
>> behaviour anyway.
>
> I agree with (1) and (3), meaning that we are free to change the
> behaviour.  I don't agree with (2), though.  I'd find it strange if
> changing the working directory wouldn't change the archive contents.
>
> We should keep consistency with the rest of git here.  Since git-archive
> is just a fancy git-ls-tree, I think we should mirror its behaviour with
> respect to the working directory.  (Which is what the current code does.
> Modulo bugs, of course.)

I am tempted to say "fair enough", but I would wait for others to come up with objections I did not think of.

Previous: René ScharfeNext: Andy Parkins
Message 6 of 10 in “bug in git-archive?”
  1. Nick WilliamsMar 3, 2007
  2. Johannes SchindelinMar 3, 2007
  3. git-archive: document CWD effectRené Scharfe, Apr 8, 2007
  4. Junio C HamanoApr 8, 2007
  5. René ScharfeApr 9, 2007
  6. Junio C HamanoApr 9, 2007
  7. Andy ParkinsApr 9, 2007
  8. René ScharfeApr 10, 2007
  9. Junio C HamanoApr 10, 2007
  10. René ScharfeApr 11, 2007

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.