aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/git-maintenance.txt
diff options
context:
space:
mode:
authorDerrick Stolee <derrickstolee@github.com>2022-09-27 13:56:58 +0000
committerJunio C Hamano <gitster@pobox.com>2022-09-27 09:32:25 -0700
commit1ebe6b029703e4bebf413ec052918a81390797ac (patch)
tree0c495d84efc920b4aff285f27e852c005e9d195c /Documentation/git-maintenance.txt
parent1b3d6e17fe83eb6f79ffbac2f2c61bbf1eaef5f8 (diff)
downloadgit-1ebe6b029703e4bebf413ec052918a81390797ac.tar.gz
maintenance: add 'unregister --force'
The 'git maintenance unregister' subcommand has a step that removes the current repository from the multi-valued maitenance.repo config key. This fails if the repository is not listed in that key. This makes running 'git maintenance unregister' twice result in a failure in the second instance. This failure exit code is helpful, but its message is not. Add a new die() message that explicitly calls out the failure due to the repository not being registered. In some cases, users may want to run 'git maintenance unregister' just to make sure that background jobs will not start on this repository, but they do not want to check to see if it is registered first. Add a new '--force' option that will siltently succeed if the repository is not already registered. Also add an extra test of 'git maintenance unregister' at a point where there are no registered repositories. This should fail without --force. Signed-off-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-maintenance.txt')
-rw-r--r--Documentation/git-maintenance.txt6
1 files changed, 5 insertions, 1 deletions
diff --git a/Documentation/git-maintenance.txt b/Documentation/git-maintenance.txt
index 9c630efe19..bb888690e4 100644
--- a/Documentation/git-maintenance.txt
+++ b/Documentation/git-maintenance.txt
@@ -11,7 +11,7 @@ SYNOPSIS
[verse]
'git maintenance' run [<options>]
'git maintenance' start [--scheduler=<scheduler>]
-'git maintenance' (stop|register|unregister)
+'git maintenance' (stop|register|unregister) [<options>]
DESCRIPTION
@@ -79,6 +79,10 @@ unregister::
Remove the current repository from background maintenance. This
only removes the repository from the configured list. It does not
stop the background maintenance processes from running.
++
+The `unregister` subcommand will report an error if the current repository
+is not already registered. Use the `--force` option to return success even
+when the current repository is not registered.
TASKS
-----