summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranonym <anonym@riseup.net>2015-05-16 11:14:12 +0200
committeranonym <anonym@riseup.net>2015-05-16 11:14:12 +0200
commitcdb369afa95bcaf0a691ddab083ee951b65b0754 (patch)
treeaf0276e1ccf6b9c711c8f0c81a5829151d113428
parentc4b6e311645d22134a7691a3d324cb532ec57c6b (diff)
parent05b715a8b25c19591145894d83f4f7eeab3830f3 (diff)
Merge remote-tracking branch 'origin/feature/8617-delete-obsolete-Git-branches' into stable
Fix-committed: #8617
-rw-r--r--.gitmodules3
-rwxr-xr-xbin/delete-merged-git-branches55
l---------lib/python3/tailslib1
m---------submodules/pythonlib0
-rw-r--r--wiki/src/contribute/git.mdwn36
-rw-r--r--wiki/src/contribute/release_process.mdwn11
6 files changed, 106 insertions, 0 deletions
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..227416c
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "submodules/pythonlib"]
+ path = submodules/pythonlib
+ url = https://git-tails.immerda.ch/pythonlib
diff --git a/bin/delete-merged-git-branches b/bin/delete-merged-git-branches
new file mode 100755
index 0000000..3f174d2
--- /dev/null
+++ b/bin/delete-merged-git-branches
@@ -0,0 +1,55 @@
+#!/usr/bin/python3
+
+import argparse
+import pprint
+import sys
+
+from distutils.util import strtobool
+from tailslib.git import Git
+
+### Functions
+
+def yes_no_input(prompt, default=True):
+ if default:
+ options = 'Y/n'
+ else:
+ options = 'N/y'
+ sys.stdout.write('%s [%s] ' % (prompt, options))
+ while True:
+ answer = input().lower()
+ if len(answer) == 0:
+ return default
+ else:
+ try:
+ return strtobool(answer)
+ except ValueError:
+ print("Please respond with 'y' or 'n'.")
+
+### Parse command-line arguments
+
+parser = argparse.ArgumentParser(description='Delete merged Git branches.')
+parser.add_argument('--repo', type=str, dest='repo',
+ help='Path to an up-to-date (bare) Tails Git repository.')
+parser.add_argument('--remote', type=str, dest='remote', default='origin',
+ help='Push to the specified remote instead of "origin".')
+parser.add_argument('--batch', type=bool, dest='batch',
+ nargs='?', const=True, default=False,
+ help='Assume "yes" as answer to all prompts.')
+args = parser.parse_args()
+
+### Main
+
+pp = pprint.PrettyPrinter()
+tailsgit = Git(args.repo)
+branches_to_delete = tailsgit.branches_to_delete()
+
+if not branches_to_delete:
+ print("No branch to delete was found.")
+ sys.exit(0)
+
+print("The following branches will be deleted:")
+pp.pprint(branches_to_delete)
+if not args.batch and not yes_no_input("Remove these branches?", default=False):
+ sys.exit(0)
+
+tailsgit.push(args.remote, [':%s' % branch for branch in branches_to_delete])
diff --git a/lib/python3/tailslib b/lib/python3/tailslib
new file mode 120000
index 0000000..270ed68
--- /dev/null
+++ b/lib/python3/tailslib
@@ -0,0 +1 @@
+../../submodules/pythonlib/tailslib \ No newline at end of file
diff --git a/submodules/pythonlib b/submodules/pythonlib
new file mode 160000
+Subproject 20150c3de083569570a87c82f2e3da463668350
diff --git a/wiki/src/contribute/git.mdwn b/wiki/src/contribute/git.mdwn
index 5bc6754..678af42 100644
--- a/wiki/src/contribute/git.mdwn
+++ b/wiki/src/contribute/git.mdwn
@@ -85,9 +85,23 @@ Developers with write access to the repositories should instead:
git clone boum_org_amnesia@webmasters.boum.org:wiki.git
+And then, in any case, in your new Git clone's directory:
+
+ git submodule update --init
+
+For more information about our usage of Git submodules, see
+[[the dedicated section|git#submodules]].
+
We have a [web interface](https://git-tails.immerda.ch/tails/)
available for the main repository.
+### Configuration
+
+Developers with write access to the repositories should:
+
+ git config --global url.tails@git.tails.boum.org:.insteadOf \
+ https://git-tails.immerda.ch/
+
### Branches
Tails development uses several branches modeled a bit like the
@@ -241,3 +255,25 @@ Unauthenticated access is of the form:
Developers with write access to the repositories should instead:
git clone tails@git.tails.boum.org:$REPOSITORY
+
+<a id="submodules"></a>
+
+Submodules
+==========
+
+We use Git submodules to track external repositories from the main
+Tails source tree.
+
+The main practical consequence thereof so far, for most Tails
+contributors, is that one should generally run the following command
+after checking out a branch:
+
+ git submodule update --init
+
+For more information, see:
+
+* the [chapter about
+ submodules](https://git-scm.herokuapp.com/book/en/v2/Git-Tools-Submodules)
+ in the *Pro Git* book;
+* the [`git-submodule(1)`](http://manpages.debian.org/git-submodule)
+ man page.
diff --git a/wiki/src/contribute/release_process.mdwn b/wiki/src/contribute/release_process.mdwn
index c125b83..641c9eb 100644
--- a/wiki/src/contribute/release_process.mdwn
+++ b/wiki/src/contribute/release_process.mdwn
@@ -971,6 +971,17 @@ this, and skip what does not make sense for a RC.
-delete \
\"
+1. Delete Git branches that were merged:
+
+ bare_repo=$(mktemp -d)
+ (cd "$MASTER_CHECKOUT" && git fetch) && \
+ git clone --bare --reference "$MASTER_CHECKOUT" \
+ boum_org_amnesia@webmasters.boum.org:wiki.git \
+ "$bare_repo" && \
+ PYTHONPATH=lib/python3 ./bin/delete-merged-git-branches \
+ --repo "$bare_repo" && \
+ rm -rf "$bare_repo"
+
1. Pull `master` back and merge it into `devel`.
1. Follow the
[[post-release|contribute/APT_repository#workflow-post-release]] APT