dotfiles
dotfiles copied to clipboard
Add open PR alias
git compare && git log --format=short master..HEAD | gh pull-request -F -
Or the equivalent that works...
how would this differ from what hub
/gh
already do?
I want to compose PR details locally, but this would add two things:
- Editor opens with the commit messages from
master..HEAD
- It opens the code in the github compare view (I like to see what PR reviewers are going to see)
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
#
Oh, you know what, I do see that. My bad.
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
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
This might do everything you need: https://github.com/gabebw/dotfiles/blob/master/bin/git-create-pull-request
Plus this git pr
alias: https://github.com/gabebw/dotfiles/blob/af4bde0dca231fef1f65190a579d9eefad10bf52/tag-git/gitconfig#L42