Hub: No documentation when installed as snap package

Created on 10 Nov 2019  路  12Comments  路  Source: github/hub

[@jaymzh] poked at a snap of this on Ubuntu, and no help works anymore, because of @mislav 's PR, plus the fact that these things are self-contained and thus can't drop off man pages:

$ hub help pull-request
No manual entry for hub-pull-request
exit status 16
$ hub --help pull-request
No manual entry for hub-pull-request
exit status 16
$ hub pull-request --help
No manual entry for hub-pull-request
exit status 16
$ hub pr --help
No manual entry for hub-pr
exit status 16

_Originally posted by @jaymzh in https://github.com/github/hub/issues/2352#issuecomment-552142575_


I'm running hub 2.13.0 on Ubuntu 19.04, installed as recommended in the README via snap install hub --classic.

$ hub help pull-request
No manual entry for hub-pull-request
exit status 16

$ which hub
/snap/bin/hub

$ ls /snap/share
ls: cannot access '/snap/share': No such file or directory

$ echo $MANPATH 
~/.npm-packages/share/man:/usr/local/man:/usr/local/share/man:/usr/share/man

No entries for hub in any of the MANPATH directories either.

bug

All 12 comments

I imagine this is the same with flatpak and any other self-contained distros...

@felicianotech: does the snap bundle man pages? (See here for how the new logic in hub help works)

I'll dig more into it today, but the primary thing is that snaps are mounted at /snap/$whatever (ala /snap/hub), and are self-contained... so the man pages wouldn't be in the MANPATH to be found. But clearly the binaries get into the PATH somehow, so I dunno what hooks into MANPATH.

Though, from a cursory google, this seems to imply the answer is "it doesn't work"...

So I can confirm they package ... some... man pages, but not in man format:

$ pwd
/snap/hub/current
$ find | grep man1
./go/src/github.com/github/hub/share/man/man1
./go/src/github.com/github/hub/share/man/man1/hub.1.md
$

And unsurprisingly even that one doesn't work, because they have no support for this:

$ man hub
No manual entry for hub
See 'man 7 undocumented' for help when manual pages are not available.

So I would argue a few things:

  1. @raphinesse should file a bug with upstream snap maintainer:
$ snap info hub
name:      hub
summary:   hub is a command-line wrapper for git that makes you better at GitHub.
publisher: Ricardo N Feliciano (felicianotech)
contact:   https://Feliciano.Tech/contact
  1. @mislav - would it be worth having a build option that doesn't execute man and uses the older method of printing the help internally for things like flatpak and snap that are trying not to install things into the system? I don't know if you consider that worth the effort or not, and I have no strong opinions, but it's worth at least considering.

@jaymzh Thanks for looking into this. There already exists a ticket for snapd.

@raphinesse - that's a different bug - that's overall man support in snapd... but there needs to be a separate bug for the hub snap, as it is not including any of the man pages into the snap itself.

@jaymzh Got it. Issue created at felicianotech/hub-snap#25.

  1. would it be worth having a build option that doesn't execute man and uses the older method of printing the help internally for things like flatpak and snap that are trying not to install things into the system?

@jaymzh We could consider adding that if there are no better avenues for fixing this. However, plain text help isn't as nice as man pages one.

I just ran into this same issue, but before digging around too deep I also tried installing hub with go get -u -v github.com/github/hub and then simply cloning the repo straight from github.

I found that there is only a single man page in the repo (per find <hubroot> -iname "*man*"):
https://github.com/github/hub/tree/master/share/man/man1

Is this correct? Shouldn't there be more content in that directory? On my macOS, its super convenient having the man pages for individual commands appear when running hub help <cmd>. From that experience I was expecting there were individual man pages somewhere for each command.

I guess I'm just asking where can I manually grab the man pages from? Any format is fine really, traditional man page or Markdown.

@ardnew make man-pages builds the man pages from source https://github.com/github/hub/blob/badc983ab52b7fece3e4dcf5d4363b1b41ad08d5/Makefile#L74

Or you can download them for a specific release from the Releases page (they will be under the share/man/ directory of the tarball)

@mislav @raphinesse and others, this issue has been fixed in the snap. See my update for the Issue on the snap repo: https://github.com/felicianotech/hub-snap/issues/25#issuecomment-596145451

@felicianotech Thank you!

Was this page helpful?
0 / 5 - 0 ratings