Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding workflow for pull requests #139

Merged
merged 24 commits into from
Apr 1, 2015
Merged

Adding workflow for pull requests #139

merged 24 commits into from
Apr 1, 2015

Conversation

TheJefe
Copy link
Contributor

@TheJefe TheJefe commented Mar 28, 2015

Sorry this PR became so big, but it didn't make sense to open a PR until an entire workflow was implemented. It might be best to review it commit by commit.

The general purpose of this change was to support a pull request based workflow. I started working on the vim-prreview plugin before I knew that this project exisited. So after finding github-issues.vim, I chose to simply open github-issues.vim up to allow access from other plugins. Then since this was for a pull request workflow, it only made since to be able to view commit lists and changes, very much like github has from its pull requests view on the webpage.

This PR does a few things, that I have listed below.

  • use a file to get github access token, because it is not secure to store it in your vimrc when you back it up to github.
  • allow other plugins to use this one by allowing passing params in for repo and number of an issue
  • add "Commits" and "Files Changed" tags to an issue display. When pressing enter on them, you'll get a list of commits or it will show the file diffs for the pull request
  • allow a user to press enter on the commit list to open "Gedit" for that commit.
  • hit github's api for commit diffs rather then use fugitive, because this way we don't have to worry about having the repo available locally.
  • open links in a new tab or split. 's' mapped for split, <CR> for new tab

Demos from vim-prreview

vim-prreview

Commits using the-jefe/github-issues.vim

commits

File Diff using the-jefe/github-issues.vim

file_diff

TheJefe and others added 21 commits February 3, 2015 08:41
this way it opens this plugin up to be used in other work flows
so that you can press enter on certain headers and continue the workflow
to see commits or file diffs
You can now press the enter key on [Commits] or [Files Changed] and get
a commit list or full diff for the issue
for getting commits and file diffs
When creating or upating a git issue
Also, I set buftype=nofile so that certain things like 'saving' isn't
weird
Doing this ourselves rather then relying on fugitive gives us the chance
to specify the repo the sha is for, and then we don't have to be in that
repo's directory
This should make things more easy to follow
because before we were adding to the already existing buffers
@jaxbot
Copy link
Owner

jaxbot commented Mar 29, 2015

This is awesome! Gimme a bit to sort through this all ;)

@jaxbot
Copy link
Owner

jaxbot commented Mar 29, 2015

Note about:

use a file to get github access token, because it is not secure to store it in your vimrc when you back it up to github.

Well, I don't expect people to put it in their vimrc, just source it from somewhere. But if it works seamlessly, no reason not to switch it, so long as it's backwards compatible somehow

@jaxbot
Copy link
Owner

jaxbot commented Mar 29, 2015

Also, where is :PR defined?

@TheJefe
Copy link
Contributor Author

TheJefe commented Mar 29, 2015

as far as the github token goes, I'm just as happy to define it as an environment variable, as long as it is not in a config file that is likely to be checked in, I don't really care.

PR is defined in vim-prreview . I did that work before I knew this plugin existed, otherwise I would have likely added that stuff to this project.

@jaxbot
Copy link
Owner

jaxbot commented Mar 29, 2015

Ah, duh. Gotcha. Alright, I'll test out GHI.vim and make sure everything works as usual, then add in vim-prreview and give that a whurl. Sorry for the delay on getting back to you. It's a homework weekend :\

@TheJefe
Copy link
Contributor Author

TheJefe commented Mar 29, 2015

Delay? I'm surprised you got back to me this quick :) . thanks again for
reviewing

On Sun, Mar 29, 2015, 1:57 PM Jonathan Warner notifications@github.com
wrote:

Ah, duh. Gotcha. Alright, I'll test out GHI.vim and make sure everything
works as usual, then add in vim-prreview and give that a whurl. Sorry for
the delay on getting back to you. It's a homework weekend :\


Reply to this email directly or view it on GitHub
#139 (comment)
.

@jaxbot
Copy link
Owner

jaxbot commented Apr 1, 2015

Gissues seems to work, diff looks alright. I'm going to merge it in, but I'm going to diverge it from your branch after that for some formatting changes, so if you have more changes to make, just make sure you pull in my master.

jaxbot added a commit that referenced this pull request Apr 1, 2015
Adding workflow for pull requests
@jaxbot jaxbot merged commit d6ec2f9 into jaxbot:master Apr 1, 2015
@TheJefe
Copy link
Contributor Author

TheJefe commented Apr 1, 2015

Excellent! thanks very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants