Git development
 help / color / mirror / Atom feed
From: jateeq <jawad_atiq@hotmail.com>
To: git@vger.kernel.org
Subject: Creating a tarball out of a directory in a bare git repository
Date: Mon, 1 Mar 2010 14:47:45 -0800 (PST)	[thread overview]
Message-ID: <27750115.post@talk.nabble.com> (raw)


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.

             reply	other threads:[~2010-03-01 22:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-01 22:47 jateeq [this message]
2010-03-01 23:00 ` Creating a tarball out of a directory in a bare git repository Julian Phillips
2010-03-01 23:00 ` Randal L. Schwartz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=27750115.post@talk.nabble.com \
    --to=jawad_atiq@hotmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox