Use only one git push for each push through gitception://
This commit is contained in:
parent
d677056404
commit
f0c85162c8
2 changed files with 21 additions and 6 deletions
8
README
8
README
|
@ -1,5 +1,5 @@
|
||||||
# git-remote-gcrypt
|
# git-remote-gcrypt
|
||||||
# Copyright 2013 by Ulrik
|
# Copyright 2013 by Ulrik Sverdrup
|
||||||
# License: GPLv2 or any later version, see http://www.gnu.org/licenses/
|
# License: GPLv2 or any later version, see http://www.gnu.org/licenses/
|
||||||
# Use GnuPG to use encrypted git remotes
|
# Use GnuPG to use encrypted git remotes
|
||||||
|
|
||||||
|
@ -10,10 +10,14 @@ INTRODUCTION
|
||||||
|
|
||||||
Install as `git-remote-gcrypt` in $PATH
|
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 config --global gcrypt.recipients KEYID1
|
||||||
git remote add gcryptrepo gcrypt::ssh://hostname.com:MyNewRepo
|
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
|
git push --all gcryptrepo
|
||||||
|
|
||||||
CONFIGURATION
|
CONFIGURATION
|
||||||
|
|
|
@ -81,8 +81,6 @@ update_tree()
|
||||||
# Put repo $1, file $2 or fail
|
# Put repo $1, file $2 or fail
|
||||||
PUT()
|
PUT()
|
||||||
{
|
{
|
||||||
local REPO
|
|
||||||
|
|
||||||
if isurl ssh "$1"
|
if isurl ssh "$1"
|
||||||
then
|
then
|
||||||
splitcolon "${1#ssh://}"
|
splitcolon "${1#ssh://}"
|
||||||
|
@ -92,17 +90,28 @@ PUT()
|
||||||
curl -s -S -k --ftp-create-dirs -T - "$1/$2"
|
curl -s -S -k --ftp-create-dirs -T - "$1/$2"
|
||||||
elif isurl gitception "$1"
|
elif isurl gitception "$1"
|
||||||
then
|
then
|
||||||
REPO=${1#gitception://}
|
|
||||||
OBJID=$(git hash-object -w --stdin) && \
|
OBJID=$(git hash-object -w --stdin) && \
|
||||||
TREEID=$(update_tree "$GREF" "$2" "$OBJID") &&
|
TREEID=$(update_tree "$GREF" "$2" "$OBJID") &&
|
||||||
COMMITID=$(anon_commit "$TREEID" -m "x") && \
|
COMMITID=$(anon_commit "$TREEID" -m "x") && \
|
||||||
git push -f "$REPO" "$COMMITID":master && \
|
|
||||||
git update-ref "$GREF" "$COMMITID"
|
git update-ref "$GREF" "$COMMITID"
|
||||||
else
|
else
|
||||||
cat > "$1/$2"
|
cat > "$1/$2"
|
||||||
fi
|
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
|
# Put directory for repo $1
|
||||||
PUTREPO()
|
PUTREPO()
|
||||||
{
|
{
|
||||||
|
@ -363,6 +372,8 @@ do_push()
|
||||||
printf "%s\n%s\n" "$BRANCHLIST" "$PACKLIST" | \
|
printf "%s\n%s\n" "$BRANCHLIST" "$PACKLIST" | \
|
||||||
CLEARSIGN | ENCRYPT | PUT "$URL" "manifest"
|
CLEARSIGN | ENCRYPT | PUT "$URL" "manifest"
|
||||||
|
|
||||||
|
PUT_FINAL "$URL"
|
||||||
|
|
||||||
# ok all updates (not deletes)
|
# ok all updates (not deletes)
|
||||||
printf "%s\n" "$1" | while read LINE
|
printf "%s\n" "$1" | while read LINE
|
||||||
do
|
do
|
||||||
|
|
Loading…
Reference in a new issue