octokit.rb
octokit.rb copied to clipboard
Cherry pick support
Was looking to cherry pick individual sha
s or PR's, and came across these instructions - https://github.com/tibdex/github-cherry-pick#how-it-works
The instructions are great (haven't used the tool itself as I am in Ruby land), but have a huge flaw. They let the conflicts get thru as well! I tested this myself by brining in a sha
from other branch (that is conflicting) into my current branch. :astonished: This is the code I have -
some_commit_from_other_branch = git_client.commit(repo_full_name, 'somecommitssha')]
new_commit = git_client.create_commit(repo_full_name, commit_message, some_commit_from_other_branch[:tree], some_commit_from_other_branch[:parentssha])
# Updating current branch's head to the new_commit
updated_ref = git_client.update_ref(repo_full_name, "heads/#{branch}", new_commit[:sha])
My understanding is, the new_commit
is just created in the "air" without getting attached to any branch. This could be why the API doesn't know about the conflict. But I was expecting to see the conflict
error as soon as I try to update the branch's ref with the conflict commit. Let me know if this doesn't make sense!
Wondering if there's any support for cherry-picks planned? Does anyone know how to handle conflicts while creating new commits using Github's API? Any help is greatly appreciated! :bow: