Git development
 help / color / mirror / Atom feed
From: Martin Atukunda <matlads@dsmagic.com>
To: git@vger.kernel.org
Cc: Martin Atukunda <matlads@dsmagic.com>
Subject: [PATCH] Add git-explode-packs
Date: Sat, 25 Mar 2006 15:02:24 +0300	[thread overview]
Message-ID: <11432881443149-git-send-email-matlads@dsmagic.com> (raw)
In-Reply-To: 

This script does the opposite of git repack -a -d.

Signed-Off-By: Martin Atukunda <matlads@dsmagic.com>

---

 .gitignore                          |    1 +
 Documentation/git-explode-packs.txt |   45 +++++++++++++++++++++++++++++++++++
 Makefile                            |    2 +-
 git-explode-packs.sh                |   26 ++++++++++++++++++++
 4 files changed, 73 insertions(+), 1 deletions(-)
 create mode 100644 Documentation/git-explode-packs.txt
 create mode 100755 git-explode-packs.sh

277352dd9a0549cd626242b14454da37acbc72f3
diff --git a/.gitignore b/.gitignore
index b4355b9..0ac74e3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -133,3 +133,4 @@ libgit.a
 *.py[co]
 config.mak
 git-blame
+git-explode-packs
diff --git a/Documentation/git-explode-packs.txt b/Documentation/git-explode-packs.txt
new file mode 100644
index 0000000..9651a4e
--- /dev/null
+++ b/Documentation/git-explode-packs.txt
@@ -0,0 +1,45 @@
+git-explode-packs(1)
+====================
+
+NAME
+----
+git-explode-packs - Script used to explode packs in a repository into objects
+
+
+SYNOPSIS
+--------
+'git-explode-packs'
+
+DESCRIPTION
+-----------
+
+This script is used to explode all packs into the constituent objects.
+
+A pack is a collection of objects, individually compressed, with
+delta compression applied, stored in a single file, with an
+associated index file.
+
+Packs are used to reduce the load on mirror systems, backup
+engines, disk storage, etc.
+
+This script removes all the packs in the repository, replacing them with the
+objects that are stored inside them.
+
+Author
+------
+Written by Martin Atukunda <matlads@dsmagic.com>
+
+Documentation
+--------------
+Documentation by Martin Atukunda <matlads@dsmag.com>
+
+See Also
+--------
+gitlink:git-pack-objects[1]
+gitlink:git-prune-packed[1]
+gitlink:git-repack[1]
+
+GIT
+---
+Part of the gitlink:git[7] suite
+
diff --git a/Makefile b/Makefile
index 8d45378..71e31f0 100644
--- a/Makefile
+++ b/Makefile
@@ -125,7 +125,7 @@ SCRIPT_SH = \
 	git-applymbox.sh git-applypatch.sh git-am.sh \
 	git-merge.sh git-merge-stupid.sh git-merge-octopus.sh \
 	git-merge-resolve.sh git-merge-ours.sh git-grep.sh \
-	git-lost-found.sh
+	git-lost-found.sh git-explode-packs.sh
 
 SCRIPT_PERL = \
 	git-archimport.perl git-cvsimport.perl git-relink.perl \
diff --git a/git-explode-packs.sh b/git-explode-packs.sh
new file mode 100755
index 0000000..a7e9761
--- /dev/null
+++ b/git-explode-packs.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# Copyright (c) 2006 Martin Atukunda
+#
+
+USAGE=''
+. git-sh-setup
+
+PACKDIR="$GIT_OBJECT_DIRECTORY/pack"
+PRESDIR="./++preserve"
+
+mkdir "$PRESDIR" && (
+	for p in "$GIT_OBJECT_DIRECTORY"/pack/pack-*.pack; do
+		if test -f "$p"; then
+			mv "$p" "$PRESDIR"
+		fi
+	done
+
+	for p in "$PRESDIR"/pack-*.pack; do
+		if test -f "$p"; then
+			git-unpack-objects <$p
+			rm -- $p
+		fi
+	done
+	rmdir "$PRESDIR"
+)
-- 
1.2.4.gd3e1

             reply	other threads:[~2006-03-25 12:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-25 12:02 Martin Atukunda [this message]
2006-03-26  6:12 ` [PATCH] Add git-explode-packs Junio C Hamano
2006-03-26 12:54   ` Jan-Benedict Glaw
2006-03-27  3:53     ` Junio C Hamano

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=11432881443149-git-send-email-matlads@dsmagic.com \
    --to=matlads@dsmagic.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