threads / patch / 39768

patch, 2 partsDocumentation/branch: document -M and -D in terms of --force

Subject: [PATCH 2/2] Documentation/branch: document -M and -D in terms of --force

## tl;dr

2 messages between Jul 2, 2015 and Jul 2, 2015. Diffs are folded; open one to read it.

replies: 1people: 1as markdown or json

Matthieu Moy· Jul 2, 2015, 14:07 UTC · lore

[PATCH 1/2] Documentation/branch: document -d --force and -m --force

The --force option was modified in 356e91f (branch: allow -f with -m and -d, 2014-12-08), but the documentation was not updated.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
 Documentation/git-branch.txt | 4 ++++
 1 file changed, 4 insertions(+)
Show changes to Documentation/git-branch.txt +4 −0
diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
index 359619b..b2e7963 100644
--- a/Documentation/git-branch.txt
+++ b/Documentation/git-branch.txt
@@ -95,6 +95,10 @@ OPTIONS
 --force::
 	Reset <branchname> to <startpoint> if <branchname> exists
 	already. Without `-f` 'git branch' refuses to change an existing branch.
+	In combination with `-d` (or `--delete`), allow deleting the
+	branch irrespective of its merged status. In combination with
+	`-m` (or `--move`), allow renaming the branch even if the new
+	branch name already exists.
 
 -m::
 --move::
-- 
2.5.0.rc0.7.ge1edd74.dirty
Matthieu Moy· Jul 2, 2015, 14:07 UTC · re: Matthieu Moy · lore

Now that we have proper documentation for --force's interaction with -d and -m, we can avoid duplication and consider -M and -D as convenience aliases for -m --force and -d --force.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
I'm not 100% sure it's a good idea (too many levels of indirections in
a documentation can make it painful), so if people don't like this
patch, I won't fight for it. The important is PATCH 1/2.
 Documentation/git-branch.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Show changes to Documentation/git-branch.txt +2 −2
diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
index b2e7963..a67138a 100644
--- a/Documentation/git-branch.txt
+++ b/Documentation/git-branch.txt
@@ -81,7 +81,7 @@ OPTIONS
 	`--track` or `--set-upstream`.
 
 -D::
-	Delete a branch irrespective of its merged status.
+	Shortcut for `--delete --force`.
 
 -l::
 --create-reflog::
@@ -105,7 +105,7 @@ OPTIONS
 	Move/rename a branch and the corresponding reflog.
 
 -M::
-	Move/rename a branch even if the new branch name already exists.
+	Shortcut for `--move --force`.
 
 --color[=<when>]::
 	Color branches to highlight current, local, and
-- 
2.5.0.rc0.7.ge1edd74.dirty

← back to recent threads