Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions magithub-issue.el
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,13 @@ If `issue' is nil, open the repository's issues page."
(plist-get issue :url)
(car (magithub--command-output "browse" '("--url-only" "--" "issues"))))))

(defun magithub-pr-merge-locally (issue)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The module/package/namespace is magithub-issue, so this would rather be named something like magithub-issue-merge-pr-locally.

"Merges `issue' locally using `hub am -3'."
(interactive (list (magit-section-value
(magit-current-section))))
(magithub--command-output "am" `("-3" ,(plist-get issue :url)))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can git-am fail?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, -3 looks like it's something that can be overridden with git config variables. Should we not respect the user's preferences?

All this could be mitigated by using magit's am sequencer.

(magithub-issue-refresh))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, why was this necessary? If we're applying the merge locally, that shouldn't impact GitHub's data.


(defun magithub-issue-refresh ()
(interactive)
(magithub-cache-clear (magithub-repo-id) :issues)
Expand Down
1 change: 1 addition & 0 deletions magithub.el
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
(?f "Fork" magithub-fork-popup)
(?i "Issues" magithub-issues-popup)
(?p "Submit a pull request" magithub-pull-request-popup)
(?m "Merge a pull request locally" magithub-pr-merge-locally)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do agree this is pretty strange. It'd be nice to have this as actionable from the pull-request itself. This popup seems more oriented to actions that are 'original sins' in a way (with the possible exception of submitting a pull request being based on a branch).

"Meta"
(?` "Toggle Magithub-Status integration" magithub-enabled-toggle)
(?g "Refresh all GitHub data" magithub-refresh)
Expand Down