Use only one git push for each push through gitception://

This commit is contained in:
root 2013-02-14 00:00:00 +00:00
parent d677056404
commit f0c85162c8
2 changed files with 21 additions and 6 deletions

8
README
View file

@ -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

View file

@ -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