dotfiles icon indicating copy to clipboard operation
dotfiles copied to clipboard

Add open PR alias

Open christoomey opened this issue 10 years ago • 8 comments

git compare && git log --format=short master..HEAD | gh pull-request -F -

Or the equivalent that works...

christoomey avatar Feb 20 '15 15:02 christoomey

how would this differ from what hub/gh already do?

gfontenot avatar Feb 20 '15 15:02 gfontenot

I want to compose PR details locally, but this would add two things:

  1. Editor opens with the commit messages from master..HEAD
  2. It opens the code in the github compare view (I like to see what PR reviewers are going to see)

christoomey avatar Feb 20 '15 15:02 christoomey

OK, here's what I see:

$ gh --version
2.3.0

My entire .gitconfig:

[user]
  name = Gabe Berke-Williams
  email = [email protected]
[url "[email protected]:thoughtbot/"]
  # thoughtbot, with write access
  insteadOf = tb:
[push]
  # Push current branch (and ONLY current branch) even if you've never pushed it
  # before.
  default = current

And this is what pops up in Vim when I run gh pull-request:


# Requesting a pull to thoughtbot:master from thoughtbot:gbw-use-a-presenter
#
# Write a message for this pull request. The first block
# of the text is the title and the rest is description.
#
# Changes:
#
# 42039f8 (Gabe Berke-Williams, 53 minutes ago)
#    Use `raw`, which is in the API, over `html_safe`
#
# ce89792 (Gabe Berke-Williams, 60 minutes ago)
#    Extract Authors class
#

gabebw avatar Feb 20 '15 17:02 gabebw

Oh, you know what, I do see that. My bad.

gfontenot avatar Feb 20 '15 19:02 gfontenot

Y'all crazy / I must have something weird. @gabebw where did you get gh version 2.3.0? Most recently tagged release is 2.1.0 https://github.com/jingweno/gh/releases

christoomey avatar Feb 20 '15 21:02 christoomey

Oh, it's git version 2.3.0. Friggin pass-through on options. gh version shows:

git version 2.3.0
gh version 2.1.0

gabebw avatar Feb 20 '15 21:02 gabebw

This might do everything you need: https://github.com/gabebw/dotfiles/blob/master/bin/git-create-pull-request

gabebw avatar Jun 02 '16 05:06 gabebw

Plus this git pr alias: https://github.com/gabebw/dotfiles/blob/af4bde0dca231fef1f65190a579d9eefad10bf52/tag-git/gitconfig#L42

gabebw avatar Jun 02 '16 05:06 gabebw