From: jidanni@jidanni.org
To: gitster@pobox.com
Cc: git@vger.kernel.org
Subject: [PATCH] git-cache-meta -- file owner and permissions caching, minimalist approach
Date: Sun, 11 Jan 2009 01:43:29 +0800 [thread overview]
Message-ID: <87eizb12gu.fsf_-_@jidanni.org> (raw)
In-Reply-To: 200901082229.46433.bss@iguanasuicide.net
Signed-off-by: jidanni <jidanni@jidanni.org>
---
contrib/metadata/git-cache-meta | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
create mode 100755 contrib/metadata/git-cache-meta
diff --git a/contrib/metadata/git-cache-meta b/contrib/metadata/git-cache-meta
new file mode 100755
index 0000000..5e1b740
--- /dev/null
+++ b/contrib/metadata/git-cache-meta
@@ -0,0 +1,19 @@
+#!/bin/sh -e
+# git-cache-meta -- file owner and permissions caching, minimalist approach
+: ${GIT_CACHE_META_FILE=.git_cache_meta} #simpler not to git-add it
+case $@ in
+ --store|--stdout)
+ case $1 in --store) exec > $GIT_CACHE_META_FILE; esac
+ git ls-files|xargs -I{} find {} \
+ \( -user ${USER?} -o -printf "chown %u '%p'\n" \) \
+ \( -group $USER -o -printf "chgrp %g '%p'\n" \) \
+ \( \( -type l -o -perm 755 -o -perm 644 \) \
+ -o -printf "chmod %#m '%p'\n" \);;#requires GNU Find
+ --apply) sh -e $GIT_CACHE_META_FILE;;
+ *) 1>&2 cat <<EOF; exit 1;;
+Usage: $0 --store|--stdout|--apply #Example:
+# git bundle create mybundle.bdl master; git-cache-meta --store
+# scp mybundle.bdl .git_cache_meta machine2: #then on machine2:
+# git init; git pull mybundle.bdl master; git-cache-meta --apply
+EOF
+esac
--
1.6.0.6
prev parent reply other threads:[~2009-01-10 17:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-09 0:13 git-cache-meta -- simple file meta data caching and applying jidanni
2009-01-09 0:22 ` Jay Soffian
2009-01-09 0:28 ` Jay Soffian
2009-01-09 2:50 ` jidanni
2009-01-09 4:29 ` Boyd Stephen Smith Jr.
2009-01-10 17:43 ` jidanni [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=87eizb12gu.fsf_-_@jidanni.org \
--to=jidanni@jidanni.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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.