From: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
To: Petr Baudis <pasky@ucw.cz>
Cc: git@vger.kernel.org
Subject: [PATCH] cogito: honour SHA1_FILE_DIRECTORY env var
Date: Fri, 29 Apr 2005 14:57:31 +0200 [thread overview]
Message-ID: <20050429125731.GA23018@lsrfire.ath.cx> (raw)
Three scripts have their object store directory hardcoded to
.git/objects/. This patch makes them honour the environment variable
SHA1_FILE_DIRECTORY like core GIT.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Index: cg-admin-lsobj
===================================================================
--- c3aa1e6b53cc59d5fbe261f3f859584904ae3a63/cg-admin-lsobj (mode:100755 sha1:c68d9176d843700df17b109389102ae84eab3888)
+++ 4e32eadd27409a1352f17cb43703aa33420ac1fd/cg-admin-lsobj (mode:100755 sha1:8410960a067f93a9457b250fea7b3636fb0eab42)
@@ -21,7 +21,7 @@
target=$1
-subdir=.git/objects/
+subdir=${SHA1_FILE_DIRECTORY:-.git/objects}
for high in 0 1 2 3 4 5 6 7 8 9 a b c d e f ; do
for low in 0 1 2 3 4 5 6 7 8 9 a b c d e f ; do
Index: cg-pull
===================================================================
--- c3aa1e6b53cc59d5fbe261f3f859584904ae3a63/cg-pull (mode:100755 sha1:5cd67519fc5399886f22e8758d6d34e0e3014cbb)
+++ 4e32eadd27409a1352f17cb43703aa33420ac1fd/cg-pull (mode:100755 sha1:52d686091f2d04a0d532a3ea1d622d6da4bad14c)
@@ -94,8 +94,9 @@
fi
[ "$rsyncerr" ] && die "unable to get the head pointer of branch $rembranch"
-[ -d .git/objects ] || mkdir -p .git/objects
-$fetch -s -u -d "$uri/objects" ".git/objects" || die "rsync error"
+sha1_dir=${SHA1_FILE_DIRECTORY:-.git/objects}
+[ -d "$sha1_dir" ] || mkdir -p "$sha1_dir"
+$fetch -s -u -d "$uri/objects" "$sha1_dir" || die "rsync error"
# FIXME: Warn about conflicting tag names?
# XXX: We now throw stderr to /dev/null since not all repositories
Index: commit-id
===================================================================
--- c3aa1e6b53cc59d5fbe261f3f859584904ae3a63/commit-id (mode:100755 sha1:4efcb6bdfdb2b2c5744f5d4d47d92beb7777ed59)
+++ 4e32eadd27409a1352f17cb43703aa33420ac1fd/commit-id (mode:100755 sha1:7f04b10cf8805cf2eb950a5dc3d451882e9d4929)
@@ -23,8 +23,9 @@
idpref=$(echo "$id" | cut -c -2)
idpost=$(echo "$id" | cut -c 3-)
-if [ $(find ".git/objects/$idpref" -name "$idpost*" 2>/dev/null | wc -l) -eq 1 ]; then
- id=$idpref$(basename $(echo .git/objects/$idpref/$idpost*))
+sha1_dir=${SHA1_FILE_DIRECTORY:-.git/objects}
+if [ $(find "$sha1_dir/$idpref" -name "$idpost*" 2>/dev/null | wc -l) -eq 1 ]; then
+ id=$idpref$(basename $(echo "$sha1_dir/$idpref/$idpost"*))
fi
if echo $id | egrep -vq "$SHA1ONLY"; then
reply other threads:[~2005-04-29 13:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20050429125731.GA23018@lsrfire.ath.cx \
--to=rene.scharfe@lsrfire.ath.cx \
--cc=git@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox