threads / patch / 39876

patchbranch: fix usage string for specific git-branch options

Subject: [PATCH] branch: fix usage string for specific git-branch options

## tl;dr

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

replies: 1people: 2as markdown or json

Ralf Thielow· Jul 17, 2015, 18:17 UTC · lore

The usage string of git-branch shows generic options and specific options. However, the specific options are called "actions". Call them both options.

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
---
 builtin/branch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to builtin/branch.c +1 −1
diff --git a/builtin/branch.c b/builtin/branch.c
index 1d15037..709dfc4 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -844,7 +844,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
 		},
 		OPT__ABBREV(&abbrev),
 
-		OPT_GROUP(N_("Specific git-branch actions:")),
+		OPT_GROUP(N_("Specific git-branch options:")),
 		OPT_SET_INT('a', "all", &kinds, N_("list both remote-tracking and local branches"),
 			REF_REMOTE_BRANCH | REF_LOCAL_BRANCH),
 		OPT_BIT('d', "delete", &delete, N_("delete fully merged branch"), 1),
-- 
2.5.0.rc2.379.ga7d8b34
Junio C Hamano· Jul 17, 2015, 19:16 UTC · re: Ralf Thielow · lore

Re: [PATCH] branch: fix usage string for specific git-branch options

Ralf Thielow <ralf.thielow@gmail.com> writes:
> The usage string of git-branch shows generic options and specific
> options. However, the specific options are called "actions".
> Call them both options.

I think this is a valid problem to address, but I do not know if the proposed solution is the right one.

Originally, the word "action" there really meant to mean "action". "git branch" can "list" existing ones, "create" new ones, "delete" existing ones, "edit" upstream info or description for, etc. These are distinct actions.

For a single "action", there are various ways to perform it. Different ways to affect "list", for example, are like "choosing which ones are listed", "deciding if the output is colored", etc.. The "options" section was meant to cover these modifiers.

I think the real issues may be coming from one or both of the two:
 (1) some are grossly miscategorized.  "--all" is not an action.  It
     just affects how "listing" works.  "--no-merged" and "--merged"
     are the same way and should sit next to "--contains".
     "--set-upstream" and "--unset-upstream" on the other hand are
     not modifiers for some other actions, but are their own actions.
 (2) "Generic options" would need to show things like "-v/-q/-f"
     that would want to consistently apply to any action that you
     might want to invoke.  Because not all modifiers apply to all
     actions, there is no good place to put things like "-t" (that
     has no meaning when you are invoking "delete" action) that are
     specific to only a subset of available actions, i.e. "Not
     generic" ones.
So the real way forward would be probably to do three things.
 * Keep the same two categorization as we have, i.e. "generic
   options" and "specific actions";
 * Move the miscategorized non-actions to "generic options" section;
 * Move action-specific modifiers out of "generic options" and
   clearly state what action they work with to modify the behaviour
   of the action.

← back to recent threads