{"thread":{"id":"22873","subject":"Creating a tarball out of a directory in a bare git repository","startedAt":"2010-03-01T22:47:45Z","lastAt":"2010-03-01T23:00:28Z","messageCount":3,"participants":["jateeq","Julian Phillips","Randal L. Schwartz"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"135989","messageId":"27750115.post@talk.nabble.com","threadId":"22873","inReplyTo":null,"subject":"Creating a tarball out of a directory in a bare git repository","fromName":"jateeq","fromEmail":"jawad_atiq@hotmail.com","sentAt":"2010-03-01T22:47:45Z","receivedAt":"2010-03-01T22:47:45Z","isPatch":false,"sender":{"key":"jawad_atiq@hotmail.com","avatar":null},"body":"\nHello,\n\nI am developing a web interface, part of which allows the user to download a\ntarball of a directory (which is in a bare repostitory on the filesystem) on\nclicking on a link.\n\nThis is how I am planning on doing it. Just wanted to assess whether this is\nefficient enough, or if anyone knows of a better way. I haven't tried this\nout yet though, so I don't know if it will work at all.\n\n- list all the files/folders in the directory (i have the sha1 hash of the\ndirectory)\n- foreach file in the directory, get the file contents (recurse if there are\nfurther subdirectories). Probably store the result in an array. \n- create a file somewhere on the filesystem out of each file output above.\nStore it under the directory name.\n- create a tarball out of the 'working' directory as usual.\n\nI was wondering if I can get away without having to create a working version\nout of the bare version of the directory (create each file in the directory\nand store it somewhere on the filesystem), and then compress it as usual.\n\nI hope someone has a much simpler answer to this problem!\n\nThanks,\nJawad.\n-- \nView this message in context: http://old.nabble.com/Creating-a-tarball-out-of-a-directory-in-a-bare-git-repository-tp27750115p27750115.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"135990","messageId":"5e95aba2186b1f37f9292dadc8134bb6@212.159.54.234","threadId":"22873","inReplyTo":"27750115.post@talk.nabble.com","subject":"Re: Creating a tarball out of a directory in a bare git repository","fromName":"Julian Phillips","fromEmail":"julian@quantumfyre.co.uk","sentAt":"2010-03-01T23:00:15Z","receivedAt":"2010-03-01T23:00:15Z","isPatch":false,"sender":{"key":"julian@quantumfyre.co.uk","avatar":"https://avatars.githubusercontent.com/u/948888?v=4"},"body":"On Mon, 1 Mar 2010 14:47:45 -0800 (PST), jateeq <jawad_atiq@hotmail.com>\nwrote:\n> Hello,\n> \n> I am developing a web interface, part of which allows the user to\ndownload\n> a\n> tarball of a directory (which is in a bare repostitory on the\nfilesystem)\n> on\n> clicking on a link.\n[..snip..]\n> I hope someone has a much simpler answer to this problem!\n\nHave a look at \"git archive\":\n\nhttp://www.kernel.org/pub/software/scm/git/docs/git-archive.html\n\n-- \nJulian\n"},{"id":"135991","messageId":"86y6ibhckz.fsf@blue.stonehenge.com","threadId":"22873","inReplyTo":"27750115.post@talk.nabble.com","subject":"Re: Creating a tarball out of a directory in a bare git repository","fromName":"Randal L. Schwartz","fromEmail":"merlyn@stonehenge.com","sentAt":"2010-03-01T23:00:28Z","receivedAt":"2010-03-01T23:00:28Z","isPatch":false,"sender":{"key":"merlyn@stonehenge.com","avatar":"https://gravatar.com/avatar/dc528d210743ff0333e6213f9ee7b33b23f1b7bc1f3c5a8c2d819074ecd7ab19?d=mp&s=160"},"body":">>>>> \"jateeq\" == jateeq  <jawad_atiq@hotmail.com> writes:\n\njateeq> - list all the files/folders in the directory (i have the sha1 hash of the\njateeq> directory)\njateeq> - foreach file in the directory, get the file contents (recurse if there are\njateeq> further subdirectories). Probably store the result in an array. \njateeq> - create a file somewhere on the filesystem out of each file output above.\njateeq> Store it under the directory name.\njateeq> - create a tarball out of the 'working' directory as usual.\n\nSounds like you're reinventing \"git archive\". :)\n\n-- \nRandal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095\n<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>\nSmalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.\nSee http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion\n"}]}