diff --git a/README b/README index 92b8b8e..d39e55c 100644 --- a/README +++ b/README @@ -1,5 +1,5 @@ # 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 @@ -10,10 +10,14 @@ INTRODUCTION 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:// 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 diff --git a/git-remote-gcrypt b/git-remote-gcrypt index be50fa6..94860bd 100755 --- a/git-remote-gcrypt +++ b/git-remote-gcrypt @@ -81,8 +81,6 @@ update_tree() # Put repo $1, file $2 or fail PUT() { - local REPO - if isurl ssh "$1" then splitcolon "${1#ssh://}" @@ -92,17 +90,28 @@ PUT() 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() { @@ -363,6 +372,8 @@ do_push() 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