mislav / hub

A command-line tool that makes git easier to use with GitHub.
https://hub.github.com/
MIT License
22.82k stars 2.19k forks source link

Add `hub show` for commits #382

Open bantu opened 11 years ago

bantu commented 11 years ago
afischer@leonard:~$ hub show https://github.com/Prosk8er/phpbb3/commit/b1864431e1e123c71642f9f8378b908a5343bebd
fatal: Not a git repository (or any parent up to mount point /home)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
afischer@leonard:/var/www/projects/phpbb3 (develop) $ hub show https://github.com/Prosk8er/phpbb3/commit/b1864431e1e123c71642f9f8378b908a5343bebd
fatal: Invalid object name 'https'.

The expected result would be having the commit show just like git show shows commits, i.e.

commit b1864431e1e123c71642f9f8378b908a5343bebd
Author: Prosk8er <prosk8er@gotskillslounge.com>
Date:   Mon Aug 19 10:49:47 2013 -0400

    [ticket/11801] removed some whitespace and added missing semi colon's in css

diff --git a/phpBB/styles/prosilver/theme/colours.css b/phpBB/styles/prosilver/theme/colours.css
...
mislav commented 11 years ago

Not sure about this one. You expect this to work even when you don't have the "Prosk8er/phpbb3" repo cloned locally? hub is designed for operations pertaining to the local git repo, so this doesn't fit in that philosophy. The only commands that don't require a local repo are hub clone and hub browse USER/REPO.

And if you have the commit URL, then you just viewed that commit online. Why would you want to view it again in the terminal?

bantu commented 11 years ago

I edited the report earlier. Not sure whether you noticed. Hub show in the upstream repository (i.e. a clone of phpbb/phpbb3) would be sufficient for me.

Someone may send me a link e.g. via IRC. Also, the webinterface makes some things impossible to see. E.g. chars per line in commit message or whitespace changes (tabs vs spaces) in the diff.

mislav commented 11 years ago

Good point about IRC. What happens if you paste a URL that doesn't match the current project?

Care to take a stab at the implementation? It shouldn't be hard.

bantu commented 11 years ago

@mislav Not sure when I'll have the time to do this. It has rather low priority for me.

glittershark commented 9 years ago

What about hub show --browse? Way easier than hub browse -- commit/$(git rev-parse HEAD) for refs

OliverJAsh commented 9 years ago

:+1:

mislav commented 9 years ago

@glittershark That's not a bad idea. I wish it were shorter to type, though.