vermiculus / magithub

**DEPRECATED - please use Forge instead!** -- Magit-based interfaces to GitHub
GNU General Public License v3.0
579 stars 62 forks source link

Add magithub-browse-file #377

Closed manateelazycat closed 5 years ago

vermiculus commented 5 years ago

I've done some light code cleanup (break up long lines, etc.) and revised the docstring. I'll merge after I finish testing and plan to push any necessary fixes to this branch.

vermiculus commented 5 years ago

Merged, thanks!

manateelazycat commented 5 years ago

@vermiculus Thank you so much!

stardiviner commented 5 years ago

There is a extension named github-browse-file, it also supports github-browse-file-blame and github-browse-commit. I hope it can be in magithub too. WDYT?

vermiculus commented 5 years ago

What do those functions do?

stardiviner commented 5 years ago

Here is the docstring:

(github-browse-commit)
Show the GitHub page for the current commit.
(github-browse-file-blame &optional FORCE-MASTER)

Show the GitHub blame page for the current file. The URL for the webpage is
added to the kill ring. With a prefix argument, "master" is used
regardless of the current branch.

In Transient Mark mode, if the mark is active, highlight the contents of the
region.
vermiculus commented 5 years ago

magihtub-commit-browse already exists; just press w on any commit section.

I'll look at implementing a magithub-browse-file-blame.

vermiculus commented 5 years ago

Added in https://github.com/vermiculus/magithub/commit/58b9750ec177e8e3e6474c668edfe17d395aee71.

stardiviner commented 5 years ago

@vermiculus Thanks for fast feature adding. I take a test, opened error URL. When I open blame from GitHub, it is https://github.com/stardiviner/emacs.d/blame/9461bc9408aa995a654cb5270d79916be8426143/init.el And I use magithub-browse-file-blame It is https://github.com/stardiviner/emacs.d/blame/f92a80c18ddc7faae5ed30c76cad47bd4551607f/init.el#L1-L1

The commit is different and invalid.

vermiculus commented 5 years ago

Can you expand on how it is 'invalid'? I don't understand what you're doing or what you expect to happen.

stardiviner commented 5 years ago

The second URL is opened by magithub which provide an invalid commit hash in URL. So I open URL, GitHub shows nothing there.

vermiculus commented 5 years ago

Ensure that commit has been pushed

stardiviner commented 5 years ago

I'm sure that line (with or without region selected) text is pushed already. But seems the commit hash is wrong. I indeed have unpushed content of the file. But it should not work like this.

vermiculus commented 5 years ago

please open an issue