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

Re: Feature request: Allow extracting revisions into directories

From
Robert Clausecker <fuzxxl@gmail.com>
Date
Feb 10, 2013, 03:57 UTC
Message-ID
<1360468628.6610.5.camel@t520>
In-Reply-To
<7vpq08u903.fsf@alter.siamese.dyndns.org>

There are two things git archive is missing that are needed in my use case:

First, git archive in combination with tar won't remove unneeded files. You have to run rm -rf before manually which brings me to the next point; git archive can't really make incremental updates. Consider an export that overwrites a tree that resembles the state of an export two commits before and contains a lot of files. I don't like to idea of needing to remove all files and write all of them again just to change one or two lines.

Perhaps my real problem is not "export" but rather "Can I have multiple work trees with multiple checked out revisions?"...

Am Samstag, den 09.02.2013, 19:45 -0800 schrieb Junio C Hamano:
Show 26 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
> 
> > I am not Phil, but if you ask me, I think it is borderline between
> > "meh" and "no way we would give a short-and-sweet -i to something
> > like this".
> 
> I think one reason it was "meh" for me is that we never did an
> equivalent of "cvs export" and "svn export", primarily because
> we had "tar-tree" (aka "archive --format=tar") first, and it was
> sufficient to pipe its outputto "tar xf -" if somebody wanted to do
> the non-existent "git export".  Also "tar-tree" was more useful for
> people who wanted to eventually want to have a tarball (you can
> first "export" and then "tar cf" the resulting directory).
> 
> But I think it is fine to add "git export <revision> <directory>",
> which may look like this, perhaps.
> 
> 	#!/bin/sh
> 	# git export <rev> <directory>
> 	rev=${1?revision} dir=${2?directory}
> 	. $(git --exec-path)/git-sh-setup
> 
>         mkdir -p "$dir" || exit
>         git archive --format=tar "$rev" |
>         tar Cxf "$dir" -
> 
Previous: Junio C HamanoNext: Jonathan Nieder
Message 9 of 22 in “Feature request: Allow extracting revisions into directories”
  1. Robert ClauseckerFeb 3, 2013
  2. Sitaram ChamartyFeb 3, 2013
  3. Robert ClauseckerFeb 3, 2013
  4. Sitaram ChamartyFeb 4, 2013
  5. Phil HordFeb 5, 2013
  6. Robert ClauseckerFeb 9, 2013
  7. Junio C HamanoFeb 9, 2013
  8. Junio C HamanoFeb 10, 2013
  9. Robert ClauseckerFeb 10, 2013
  10. Jonathan NiederFeb 10, 2013
  11. Robert ClauseckerFeb 10, 2013
  12. Jonathan NiederFeb 10, 2013
  13. Konstantin KhomoutovFeb 3, 2013
  14. Michael J GruberFeb 4, 2013
  15. Robert ClauseckerFeb 4, 2013
  16. Tomas CarneckyFeb 4, 2013
  17. Junio C HamanoFeb 4, 2013
  18. Sitaram ChamartyFeb 5, 2013
  19. Andrew ArdillFeb 4, 2013
  20. Junio C HamanoFeb 4, 2013
  21. Andreas SchwabFeb 4, 2013
  22. Thomas KochFeb 10, 2013

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.