git-imerge icon indicating copy to clipboard operation
git-imerge copied to clipboard

Man pages aren't found when used as git subcommand

Open jasonkarns opened this issue 9 years ago • 5 comments

$ git imerge --help
No manual entry for git-imerge
$ git-imerge --help
usage: git-imerge [-h]
...

So for some reason git-imerge can print help, but git can't find the appropriate manpages when invoking imerge as a subcommand.

Installation method was via homebrew. Possible this is something missing from the brew formula?

jasonkarns avatar Sep 30 '16 14:09 jasonkarns

git imerge --help is intercepted by the git executable (i.e., git-imerge itself never runs). I believe that git then looks for and outputs a manpage called git-imerge. Since there is no such manpage, it doesn't work.

git-imerge --help invokes the git-imerge script itself, which asks argparse to generate help output based on the command-line options and their help strings, plus the file comment __doc__.

I don't think this is easy to fix, short of somebody writing a manpage for git-imerge. This, in turn, might be done by getting argparse to emit its output in TROFF format. I did something similar for the cvs2svn project, but haven't had time to do that yet here. Maybe argparse supports a standard way of doing this?

mhagger avatar Sep 30 '16 14:09 mhagger

Is there currently a build step? Could run help2man on git-imerge and package the output as the manpage. (First naive attempt failed because git-imerge doesn't yet have --version :) )

jasonkarns avatar Sep 30 '16 16:09 jasonkarns

Looks like no. Doing it in the makefile on install would require help2man on users' machines.

jasonkarns avatar Sep 30 '16 16:09 jasonkarns

Do you know that -h works even when --help does not? Do you know why?

$ git imerge --help No manual entry for git-imerge See 'man 7 undocumented' for help when manual pages are not available. $ git imerge -h
usage: git-imerge [-h] {start,merge,rebase,drop,revert,continue,finish,diagram,list,init,record,autofill,simplify,remove,reparent} ...

phord avatar Nov 15 '16 01:11 phord

Do you know that -h works even when --help does not?

I guess the git launcher hijacks --help but not -h.

mhagger avatar Nov 15 '16 02:11 mhagger