All of lore.kernel.org
 help / color / mirror / Atom feed
* Creating a tarball out of a directory in a bare git repository
@ 2010-03-01 22:47 jateeq
  2010-03-01 23:00 ` Julian Phillips
  2010-03-01 23:00 ` Randal L. Schwartz
  0 siblings, 2 replies; 3+ messages in thread
From: jateeq @ 2010-03-01 22:47 UTC (permalink / raw)
  To: git


Hello,

I am developing a web interface, part of which allows the user to download a
tarball of a directory (which is in a bare repostitory on the filesystem) on
clicking on a link.

This is how I am planning on doing it. Just wanted to assess whether this is
efficient enough, or if anyone knows of a better way. I haven't tried this
out yet though, so I don't know if it will work at all.

- list all the files/folders in the directory (i have the sha1 hash of the
directory)
- foreach file in the directory, get the file contents (recurse if there are
further subdirectories). Probably store the result in an array. 
- create a file somewhere on the filesystem out of each file output above.
Store it under the directory name.
- create a tarball out of the 'working' directory as usual.

I was wondering if I can get away without having to create a working version
out of the bare version of the directory (create each file in the directory
and store it somewhere on the filesystem), and then compress it as usual.

I hope someone has a much simpler answer to this problem!

Thanks,
Jawad.
-- 
View this message in context: http://old.nabble.com/Creating-a-tarball-out-of-a-directory-in-a-bare-git-repository-tp27750115p27750115.html
Sent from the git mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Creating a tarball out of a directory in a bare git repository
  2010-03-01 22:47 Creating a tarball out of a directory in a bare git repository jateeq
@ 2010-03-01 23:00 ` Julian Phillips
  2010-03-01 23:00 ` Randal L. Schwartz
  1 sibling, 0 replies; 3+ messages in thread
From: Julian Phillips @ 2010-03-01 23:00 UTC (permalink / raw)
  To: jateeq; +Cc: git

On Mon, 1 Mar 2010 14:47:45 -0800 (PST), jateeq <jawad_atiq@hotmail.com>
wrote:
> Hello,
> 
> I am developing a web interface, part of which allows the user to
download
> a
> tarball of a directory (which is in a bare repostitory on the
filesystem)
> on
> clicking on a link.
[..snip..]
> I hope someone has a much simpler answer to this problem!

Have a look at "git archive":

http://www.kernel.org/pub/software/scm/git/docs/git-archive.html

-- 
Julian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Creating a tarball out of a directory in a bare git repository
  2010-03-01 22:47 Creating a tarball out of a directory in a bare git repository jateeq
  2010-03-01 23:00 ` Julian Phillips
@ 2010-03-01 23:00 ` Randal L. Schwartz
  1 sibling, 0 replies; 3+ messages in thread
From: Randal L. Schwartz @ 2010-03-01 23:00 UTC (permalink / raw)
  To: jateeq; +Cc: git

>>>>> "jateeq" == jateeq  <jawad_atiq@hotmail.com> writes:

jateeq> - list all the files/folders in the directory (i have the sha1 hash of the
jateeq> directory)
jateeq> - foreach file in the directory, get the file contents (recurse if there are
jateeq> further subdirectories). Probably store the result in an array. 
jateeq> - create a file somewhere on the filesystem out of each file output above.
jateeq> Store it under the directory name.
jateeq> - create a tarball out of the 'working' directory as usual.

Sounds like you're reinventing "git archive". :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-03-01 23:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-01 22:47 Creating a tarball out of a directory in a bare git repository jateeq
2010-03-01 23:00 ` Julian Phillips
2010-03-01 23:00 ` Randal L. Schwartz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.