Git development
 help / color / mirror / Atom feed
From: Timo Hirvonen <tihirvon@gmail.com>
To: junkio@cox.net
Cc: git@vger.kernel.org
Subject: [PATCH] Simplify packing public repositories
Date: Tue, 16 May 2006 14:46:35 +0300	[thread overview]
Message-ID: <20060516144635.010bb65f.tihirvon@gmail.com> (raw)

Support "git repack project.git" syntax which is more intuitive than
using the GIT_DIR environment variable.

Signed-off-by: Timo Hirvonen <tihirvon@gmail.com>

---

 git-repack.sh |   27 ++++++++++++++++++++++++---
 1 files changed, 24 insertions(+), 3 deletions(-)

c09c41750023e5b502312ddaa21bf5a2371e66ac
diff --git a/git-repack.sh b/git-repack.sh
index 4fb3f26..b24cd1a 100755
--- a/git-repack.sh
+++ b/git-repack.sh
@@ -3,8 +3,8 @@ #
 # Copyright (c) 2005 Linus Torvalds
 #
 
-USAGE='[-a] [-d] [-f] [-l] [-n] [-q]'
-. git-sh-setup
+unset CDPATH
+USAGE='[-a] [-d] [-f] [-l] [-n] [-q] [GIT_DIR]'
 
 no_update_info= all_into_one= remove_redundant=
 local= quiet= no_reuse_delta= extra=
@@ -19,11 +19,32 @@ do
 	-l)	local=--local ;;
 	--window=*) extra="$extra $1" ;;
 	--depth=*) extra="$extra $1" ;;
-	*)	usage ;;
+	-h|--h|--he|--hel|--help)
+		echo "Usage: $0 $USAGE"
+		exit
+		;;
+	*)
+		if test "$#" -gt 1
+		then
+			echo >&2 "Usage: $0 $USAGE"
+			exit 1
+		fi
+		export GIT_DIR="$1"
+		;;
 	esac
 	shift
 done
 
+: ${GIT_DIR=.git}
+: ${GIT_OBJECT_DIRECTORY="$GIT_DIR/objects"}
+
+# Make sure we are in a valid repository of a vintage we understand.
+GIT_DIR="$GIT_DIR" git repo-config --get core.nosuch >/dev/null
+if test $? = 128
+then
+    exit
+fi
+
 rm -f .tmp-pack-*
 PACKDIR="$GIT_OBJECT_DIRECTORY/pack"
 
-- 
1.3.3.g8701-dirty

             reply	other threads:[~2006-05-16 11:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-16 11:46 Timo Hirvonen [this message]
     [not found] ` <20060516074710.29ef67ca.seanlkml@sympatico.ca>
2006-05-16 11:47   ` [PATCH] Simplify packing public repositories Sean

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=20060516144635.010bb65f.tihirvon@gmail.com \
    --to=tihirvon@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /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