All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
To: "Joshua T. Corbin" <jcorbin@wunjo.org>
Cc: Petr Baudis <pasky@ucw.cz>, git@vger.kernel.org
Subject: Re: [PATCH] cg-export to tarball
Date: Wed, 27 Apr 2005 00:24:14 +0200	[thread overview]
Message-ID: <426EBF8E.5000906@lsrfire.ath.cx> (raw)
In-Reply-To: <20050426202014.GJ13224@pasky.ji.cz>

Petr Baudis schrieb:
> Dear diary, on Tue, Apr 26, 2005 at 09:12:46AM CEST, I got a letter 
> where "Joshua T. Corbin" <jcorbin@wunjo.org> told me that...
> 
>> The following patch to cg-export will simlpy create a tarball if 
>> the argument ends in .tar.gz, .tar.bz2, or .tar.
>> 
>> Signed-off-by; Joshua T. Corbin <jcorbin@wunjo.org>
> 
> 
> What about cooperating with Rene Scharfe and using his tar-tree? I 
> didn't actually try it yet (not even look at the code so far), it'd 
> be cool if someone would give it some review and testing.

Yes, this looks like a job for tar-tree.  You could do something like this:

   destbasename=${destdir##*/}
   case "$destdir" in
   *.tar)
       tar-tree $id "${destbasename%.tar}" > "$destdir"
       ;;
   *.tgz)
       tar-tree $id "${destbasename%.tgz}" | gzip -9 > "$destdir"
       ;;
   # *.tar.gz, *.tar.bz2, ...
   *)
       mkdir -p "$destdir" || die "cannot create $destdir"
       export GIT_INDEX_FILE="$destdir/.git-index"
       read-tree $id
       checkout-cache "--prefix=$destdir/" -a
       rm "$GIT_INDEX_FILE"
       ;;
   esac

The second parameter to tar-tree is an optional prefix for all paths
inside the archive (official kernel tarballs always have linux-2.x.xx as
a prefix).  It makes some sense to set this value to the archive
filename, "cg-export linux-2.6.12-rc3.tar.bz2" would than work as expected.

What do you think?  If you like it I'll cook up a patch later unless you
beat me to it.

Thanks,
Rene

      reply	other threads:[~2005-04-26 22:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-26  7:12 [PATCH] cg-export to tarball Joshua T. Corbin
2005-04-26 20:20 ` Petr Baudis
2005-04-26 22:24   ` Rene Scharfe [this message]

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=426EBF8E.5000906@lsrfire.ath.cx \
    --to=rene.scharfe@lsrfire.ath.cx \
    --cc=git@vger.kernel.org \
    --cc=jcorbin@wunjo.org \
    --cc=pasky@ucw.cz \
    /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 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.