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 9, 2013, 15:58 UTC
Message-ID
<1360425499.3369.10.camel@t520>
In-Reply-To
<CABURp0rMk-W8VMRhXoR9YYQSwjWTfPbXz5mhPX3-HKsBSu5_mw@mail.gmail.com>

After thinking a while about how to solve the problems I have, I consider the following things as a solution to my problem.

Add an option --isolated, -i to git checkout: Check out a branch / tag / revision but do not touch the index. This could be used together with --work-tree to check out a branch into an arbitrary directory. Also, it satisfies all 4 criteria from [1] and therefore is perfect for deployment from a bare repository.

What do you think about this feature request?
Yours, Robert Clausecker
[1]: http://sitaramc.github.com/the-list-and-irc/deploy.html
Am Dienstag, den 05.02.2013, 10:11 -0500 schrieb Phil Hord:
Show 64 quoted lines
> On Sun, Feb 3, 2013 at 7:42 PM, Sitaram Chamarty <sitaramc@gmail.com> wrote:
> > On 02/03/2013 11:41 PM, Robert Clausecker wrote:
> >>
> >> Am Sonntag, den 03.02.2013, 21:55 +0530 schrieb Sitaram Chamarty:
> >>> Could you help me understand why piping it to tar (actually 'tar -C
> >>> /dest/dir -x') is not sufficient to achieve what you want?
> >>
> >> Piping the output of git archive into tar is of course a possible
> >> solution; I just don't like the fact that you need to pipe the output
> >> into a separate program to do something that should be possible with a
> >> simple switch and not an extra command. It feels unintuitive and like a
> >> workaround to make an archive just to unpack it on-the-fly. Also, adding
> >> such a command (or at least documenting the way to do this using a pipe
> >> to tar somewhere in the man pages) is a small and simple change that
> >> improves usability.
> >
> > I realise it appears to be the fashion these days to get away from the
> > Unix philosophy of having different tools do different things and
> > combining them as needed.
> >
> > Ignoring the option-heavy GNU, and looking at the more traditional BSD
> > tar manpage [1], I notice the following flags that could still be
> > potentially needed by someone running 'git archive': '-t' (instead of
> > '-x'), '-C dir', '--exclude/include', '-k', '-m', '--numeric-owner', -o,
> > -P, -p, -q, -s, -T, -U, -v, -w, and -X.
> 
> OP did not ask about tar so I do not see why any of these tar options
> are relevant.  It seems like what he really wants is 'git archive
> --format=native' , maybe.   You can almost create this option by
> saying
> 
>    git config tar.native.command "tar -x"
> 
> except that you do not get the opportunity to specify a target directory.
> 
> But maybe he really wants a form of 'git checkout' instead.
> 
> 
> > And I'm ignoring the esoteric ones like "--chroot" and "-S" (sparse mode).
> >
> > How many of these options would you like included in git?  And if you
> > say "I don't need any of those; I just need '-x'", that's not relevant.
> >  Someone else may need any or all of those flags, and if you accept "-x"
> > you have to accept some of the others too.
> 
> This is only true if you cannot stop yourself from thinking about
> 'tar'.  What about zip, for example?
> 
> I think none of these options is relevant.
> 
> 
> > Also, I often want to deploy to a different host, and I might do that
> > like so:
> >
> >     git archive ... | ssh host tar -C /deploy/dir -x
> >
> > Why not put that ssh functionality into git also?
> 
> This slippery-slope argument is growing tiresome.
> 
> Phil
> 
> p.s. Conceded: OP set off this avalanche by disparaging the vaunted
> PIPE operation.
Previous: Phil HordNext: Junio C Hamano
Message 6 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.