summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2020-02-11 14:34:08 -0700
committerSean Whitton <spwhitton@spwhitton.name>2020-02-16 15:48:07 -0700
commit89b581c6fa663d8a9db728d98e7f56c83c991444 (patch)
tree1e4247118c26fb47e9353bc1344b65466d23969b /bin
downloadp5-API-GitForge-89b581c6fa663d8a9db728d98e7f56c83c991444.tar.gz
rework script into API::GitForge generic interface
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/git-clean-forge-fork63
-rwxr-xr-xbin/git-clean-forge-repo74
-rwxr-xr-xbin/git-nuke-forge-fork61
3 files changed, 198 insertions, 0 deletions
diff --git a/bin/git-clean-forge-fork b/bin/git-clean-forge-fork
new file mode 100755
index 0000000..bcfd592
--- /dev/null
+++ b/bin/git-clean-forge-fork
@@ -0,0 +1,63 @@
+#!/usr/bin/perl
+# PODNAME: git-clean-forge-fork
+# ABSTRACT: create tidy forks for pull requests
+#
+# Copyright (C) 2017, 2020 Sean Whitton
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+=head1 SYNOPSIS
+
+B<git clean-forge-fork> [B<--upstream=>I<REMOTE>]
+
+=head1 DESCRIPTION
+
+Creates a fork for proposing changes to a project hosted on a git
+forge, like GitHub or GitLab. Also configures the fork to make it
+obvious that it only exists for submitting changes, so that the fork
+clutters up your git forge profile a bit less. Also adds a 'fork'
+remote to which you can push your proposed changes.
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<--upstream=>I<REMOTE>
+
+Specify the name of the upstream git remote, i.e., what you want to
+fork. Defaults to "origin".
+
+=back
+
+=head1 FILES
+
+=over 4
+
+=item $XDG_CONFIG_HOME/.config/gitforge/access_tokens/I<DOMAIN>
+
+Where I<DOMAIN> is the domain name of the git forge
+(e.g. "github.com", "salsa.debian.org"), this file should contain an
+API access token to log in to your account at the git forge. If
+unset, $XDG_CONFIG_HOME defaults to ~/.config.
+
+=back
+
+=head1 SEE ALSO
+
+git-nuke-forge-fork(1), git-clean-forge-repo(1)
+
+=cut
+
+use App::git::clean_forge_fork;
+exit App::git::clean_forge_fork->main;
diff --git a/bin/git-clean-forge-repo b/bin/git-clean-forge-repo
new file mode 100755
index 0000000..57afb14
--- /dev/null
+++ b/bin/git-clean-forge-repo
@@ -0,0 +1,74 @@
+#!/usr/bin/perl
+# PODNAME: git-clean-forge-repo
+# ABSTRACT: create repos on git forges with optional features disabled
+#
+# Copyright (C) 2017, 2020 Sean Whitton
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+=head1 SYNOPSIS
+
+B<git clean-forge-repo> [B<--remote=>I<REMOTE>]
+
+=head1 DESCRIPTION
+
+Creates repos on git forges like GitHub and GitLab, and disables all
+optional features of those forges. Useful for when you want to use
+the forge only as an ordinary git host, and nothing more.
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<--remote=>I<REMOTE>
+
+Specify the name of the git remote you will use to push changes to the
+repository created by this script. You should already have created
+this git remote; see "EXAMPLE" below. Defaults to "origin".
+
+=back
+
+=head1 EXAMPLE
+
+=over 4
+
+ % git init
+ % # work on new project
+ % git remote add origin https://salsa.debian.org/spwhitton/foo
+ % git clean-forge-repo
+ % git push -u origin master
+
+=back
+
+=head1 FILES
+
+=over 4
+
+=item $XDG_CONFIG_HOME/.config/gitforge/access_tokens/I<DOMAIN>
+
+Where I<DOMAIN> is the domain name of the git forge
+(e.g. "github.com", "salsa.debian.org"), this file should contain an
+API access token to log in to your account at the git forge. If
+unset, $XDG_CONFIG_HOME defaults to ~/.config.
+
+=back
+
+=head1 SEE ALSO
+
+git-clean-forge-fork(1)
+
+=cut
+
+use App::git::clean_forge_repo;
+exit App::git::clean_forge_repo->main;
diff --git a/bin/git-nuke-forge-fork b/bin/git-nuke-forge-fork
new file mode 100755
index 0000000..7690a87
--- /dev/null
+++ b/bin/git-nuke-forge-fork
@@ -0,0 +1,61 @@
+#!/usr/bin/perl
+# PODNAME: git-nuke-forge-fork
+# ABSTRACT: delete forks created by git-clean-forge-fork(1)
+#
+# Copyright (C) 2020 Sean Whitton
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+=head1 SYNOPSIS
+
+B<git nuke-forge-fork> [B<--upstream=>I<REMOTE>]
+
+=head1 DESCRIPTION
+
+Deletes forks created by git-clean-forge-fork(1). Useful to clean up
+your git forge profile after your proposed changes have been included
+upstream.
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<--upstream=>I<REMOTE>
+
+Specify the name of the upstream git remote, i.e., what you previously
+forked. Defaults to "origin".
+
+=back
+
+=head1 FILES
+
+=over 4
+
+=item $XDG_CONFIG_HOME/.config/gitforge/access_tokens/I<DOMAIN>
+
+Where I<DOMAIN> is the domain name of the git forge
+(e.g. "github.com", "salsa.debian.org"), this file should contain an
+API access token to log in to your account at the git forge. If
+unset, $XDG_CONFIG_HOME defaults to ~/.config.
+
+=back
+
+=head1 SEE ALSO
+
+git-clean-forge-fork(1)
+
+=cut
+
+use App::git::nuke_forge_fork;
+exit App::git::nuke_forge_fork->main;