diff options
author | psyc://loupsycedyglgamf.onion/~lynX <BM-NB7xa9gEpmJgYp9PVnEdACiZcGmmEJcY> | 1984-04-04 00:44:10 +0000 |
---|---|---|
committer | psyc://loupsycedyglgamf.onion/~lynX <BM-NB7xa9gEpmJgYp9PVnEdACiZcGmmEJcY> | 1984-04-04 00:44:10 +0000 |
commit | 5ec300e92e0d2be27986856d4424a1d9f25f7713 (patch) | |
tree | 1ed209719bc590258e0531059e35c839411fe085 | |
parent | 46b256c8417f926f8959c5b59ed56d75b2e0ed24 (diff) | |
download | youbroketheinternet-overlay-5ec300e92e0d2be27986856d4424a1d9f25f7713.tar.gz youbroketheinternet-overlay-5ec300e92e0d2be27986856d4424a1d9f25f7713.zip |
added 'git-update' - the transparent auto-torifying git pull
-rwxr-xr-x | dev-vcs/gitprivacy/files/git-update | 47 | ||||
-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? | ||
16 | gitdiff="git diff -b -M77% --minimal" | ||
17 | |||
18 | # 'resolve' has served me well as default strategy | ||
19 | gitmerge="git merge -s resolve" | ||
20 | |||
21 | branch="$*" | ||
22 | if test x"$*" = x; then | ||
23 | branch="origin" | ||
24 | fi | ||
25 | # echo $branch | ||
26 | |||
27 | url=`git remote get-url $branch` | ||
28 | if test x"$url" = x; then | ||
29 | exit | ||
30 | fi | ||
31 | # echo $url | ||
32 | |||
33 | case $url in | ||
34 | http*) | ||
35 | torify="" | ||
36 | echo "*** Fetching from $url via web proxy" | ||
37 | ;; | ||
38 | *) | ||
39 | torify="torsocks" | ||
40 | echo "*** Fetching from $url via torsocks" | ||
41 | esac | ||
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 | ||
4 | EAPI=5 | 4 | EAPI=5 |
5 | 5 | ||
6 | DESCRIPTION="git commit command that preserves the privacy of working habits" | 6 | DESCRIPTION="git commands that preserve the privacy of working habits" |
7 | 7 | ||
8 | LICENSE="AGPL" | 8 | LICENSE="AGPL" |
9 | SLOT="0" | 9 | SLOT="0" |
@@ -17,5 +17,6 @@ S="$WORKDIR" | |||
17 | src_install() { | 17 | src_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 | ||