]> Nutra Git (v1) - gamesguru/git-remote-gcrypt.git/commitdiff
Use only one git push for each push through gitception://
authorroot <root@localhost>
Thu, 14 Feb 2013 00:00:00 +0000 (00:00 +0000)
committerroot <root@localhost>
Thu, 14 Feb 2013 00:00:00 +0000 (00:00 +0000)
README
git-remote-gcrypt

diff --git a/README b/README
index 92b8b8e4d10140259adbcc9ae71abec05b4bf4ea..d39e55c9ac184f39e6af9b0b140c13166ae744b6 100644 (file)
--- 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://<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
index be50fa60fa9ee9d7b90ed50ceaf2586484827ca0..94860bdcd25900bb7fa410db57ae47d796d2847d 100755 (executable)
@@ -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