1 parent 33495e7 commit e6eb86bCopy full SHA for e6eb86b
1 file changed
zsh/.zshrc
@@ -198,6 +198,18 @@ alias gsha='git rev-parse HEAD'
198
alias gct='git checkout trunk'
199
alias gcmn='git checkout main'
200
alias ghprdesc='gh pr edit --title "$(git log -n1 --format="%s")" --body "$(git log -n1 --format="%b")"'
201
+# sync-down: amend HEAD commit message from the current PR title/body
202
+function ghprdescpull() {
203
+ local pr_json title body
204
+ pr_json=$(gh pr view --json title,body) || return 1
205
+ title=$(jq -r .title <<< "$pr_json")
206
+ body=$(jq -r .body <<< "$pr_json")
207
+ if [[ -n "$body" ]]; then
208
+ git commit --amend -m "$title" -m "$body"
209
+ else
210
+ git commit --amend -m "$title"
211
+ fi
212
+}
213
# run 'gh pr create --fill'
214
alias ghprfill='gh pr create --fill'
215
# get the gh pr url for the current branch
0 commit comments