# git-remote-gcrypt
-# Copyright 2013 by Ulrik
+# Copyright 2013 by Ulrik Sverdrup
# License: GPLv2 or any later version, see http://www.gnu.org/licenses/
# Use GnuPG to use encrypted git remotes
Install as `git-remote-gcrypt` in $PATH
-Supports local, ssh:// and sftp:// remotes at the moment::
+Supports local, ssh:// and sftp:// remotes at the moment,
+as well as the special gitception://<giturl> remote type::
git config --global gcrypt.recipients KEYID1
git remote add gcryptrepo gcrypt::ssh://hostname.com:MyNewRepo
+ ( or maybe:
+ git remote add gcryptrepo gcrypt::gitception://git@github.com/Secrets
+ )
git push --all gcryptrepo
CONFIGURATION
# Put repo $1, file $2 or fail
PUT()
{
- local REPO
-
if isurl ssh "$1"
then
splitcolon "${1#ssh://}"
curl -s -S -k --ftp-create-dirs -T - "$1/$2"
elif isurl gitception "$1"
then
- REPO=${1#gitception://}
OBJID=$(git hash-object -w --stdin) && \
TREEID=$(update_tree "$GREF" "$2" "$OBJID") &&
COMMITID=$(anon_commit "$TREEID" -m "x") && \
- git push -f "$REPO" "$COMMITID":master && \
git update-ref "$GREF" "$COMMITID"
else
cat > "$1/$2"
fi
}
+# Put all PUT changes for repo $1 at once
+PUT_FINAL()
+{
+ local REPO
+ if isurl gitception "$1"
+ then
+ REPO=${1#gitception://}
+ git push --quiet -f "$REPO" "$GREF":master
+ else
+ :
+ fi
+}
+
# Put directory for repo $1
PUTREPO()
{
printf "%s\n%s\n" "$BRANCHLIST" "$PACKLIST" | \
CLEARSIGN | ENCRYPT | PUT "$URL" "manifest"
+ PUT_FINAL "$URL"
+
# ok all updates (not deletes)
printf "%s\n" "$1" | while read LINE
do