aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpsyc://loupsycedyglgamf.onion/~lynX <BM-NB7xa9gEpmJgYp9PVnEdACiZcGmmEJcY>1984-04-04 00:44:10 +0000
committerpsyc://loupsycedyglgamf.onion/~lynX <BM-NB7xa9gEpmJgYp9PVnEdACiZcGmmEJcY>1984-04-04 00:44:10 +0000
commit5ec300e92e0d2be27986856d4424a1d9f25f7713 (patch)
tree1ed209719bc590258e0531059e35c839411fe085
parent46b256c8417f926f8959c5b59ed56d75b2e0ed24 (diff)
downloadyoubroketheinternet-overlay-5ec300e92e0d2be27986856d4424a1d9f25f7713.tar.gz
youbroketheinternet-overlay-5ec300e92e0d2be27986856d4424a1d9f25f7713.zip
added 'git-update' - the transparent auto-torifying git pull
-rwxr-xr-xdev-vcs/gitprivacy/files/git-update47
-rw-r--r--dev-vcs/gitprivacy/gitprivacy-1.1.ebuild (renamed from dev-vcs/gitprivacy/gitprivacy-1.0.ebuild)3
2 files changed, 49 insertions, 1 deletions
diff --git a/dev-vcs/gitprivacy/files/git-update b/dev-vcs/gitprivacy/files/git-update
new file mode 100755
index 0000000..afb0496
--- /dev/null
+++ b/dev-vcs/gitprivacy/files/git-update
@@ -0,0 +1,47 @@
1#!/bin/sh
2#
3# A variant of git pull which operates over Tor and
4# - figures out when 'torify' needs to be used
5# - shows the changes that were made to the repository
6# - before attempting to merge
7# --lynX & heldensaga, 2017
8#
9# I recommend piping the output into
10# vim -R "+set syntax=diff"
11# but since that isn't everybody's choice of editor
12# I won't work it into this script...
13
14# would be more elegant to tell you how to
15# configure this in your .git/config?
16gitdiff="git diff -b -M77% --minimal"
17
18# 'resolve' has served me well as default strategy
19gitmerge="git merge -s resolve"
20
21branch="$*"
22if test x"$*" = x; then
23 branch="origin"
24fi
25# echo $branch
26
27url=`git remote get-url $branch`
28if test x"$url" = x; then
29 exit
30fi
31# echo $url
32
33case $url in
34http*)
35 torify=""
36 echo "*** Fetching from $url via web proxy"
37 ;;
38*)
39 torify="torsocks"
40 echo "*** Fetching from $url via torsocks"
41esac
42# echo $torify
43
44$torify git fetch $branch \
45&& $gitdiff master..$branch/master \
46&& exec $gitmerge $branch/master
47
diff --git a/dev-vcs/gitprivacy/gitprivacy-1.0.ebuild b/dev-vcs/gitprivacy/gitprivacy-1.1.ebuild
index 33ba4b8..b2adbe5 100644
--- a/dev-vcs/gitprivacy/gitprivacy-1.0.ebuild
+++ b/dev-vcs/gitprivacy/gitprivacy-1.1.ebuild
@@ -3,7 +3,7 @@
3 3
4EAPI=5 4EAPI=5
5 5
6DESCRIPTION="git commit command that preserves the privacy of working habits" 6DESCRIPTION="git commands that preserve the privacy of working habits"
7 7
8LICENSE="AGPL" 8LICENSE="AGPL"
9SLOT="0" 9SLOT="0"
@@ -17,5 +17,6 @@ S="$WORKDIR"
17src_install() { 17src_install() {
18 exeinto /usr/bin 18 exeinto /usr/bin
19 doexe "${FILESDIR}"/git-commit-private 19 doexe "${FILESDIR}"/git-commit-private
20 doexe "${FILESDIR}"/git-update
20} 21}
21 22