Emilstud

Chatlog emilengler, instagibbs_ on Bitcoin Core PR #16345

Jul 10th, 2019
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1. <instagibbs_> hey my IRC bouncer is being stupid, here i am
  2. <instagibbs_> need some assistance splitting the commit?
  3. <emilengler> Ok nice, yes I do^^
  4. <emilengler> I'm currently in the getblockbyheight branch on my local repository
  5. <instagibbs_> ok so if it's the last commit you can always `git reset HEAD~`
  6. <instagibbs_> which will "back out" the commit but keep the diff
  7. <emilengler> git log shows only one commit now
  8. <instagibbs_> `git diff`
  9. <emilengler> The "rpc: Add getblockbyheight"
  10. <instagibbs_> should see all your changes in last commit
  11. <instagibbs_> right?
  12. <emilengler> I got this output "Unstaged changes after reset:
  13. <emilengler> M src/rpc/blockchain.cpp
  14. <emilengler> M test/functional/rpc_blockchain.py
  15. <emilengler> "
  16. <instagibbs_> luckily these changes are in two files which makes this easier. Next you can `git commit src/rpc/blockchain.cpp -m "fixup! rpc: Add getblockbyheight"`
  17. <instagibbs_> after that `git diff` should only show the test changes
  18. <instagibbs_> from there `git commit -am "rpc: Add test for getblockbyheight"`
  19. <instagibbs_> you'll have 3 commits
  20. <instagibbs_> tell me if you make it there or are confused
  21. <emilengler> I made it, git log now shows 3 commits
  22. <instagibbs_> ok great, and one is a fixup! right?
  23. <instagibbs_> now my favorite mode of operation: `git rebase -i HEAD~3` which means "interactive rebase the last 3 commits"
  24. <emilengler> Yes, but I did a small typo hope it isn't a big deal. I've forgot the space after "rpc:"
  25. <instagibbs_> will give you a commit list of 3 last commits
  26. <instagibbs_> it's fine
  27. <instagibbs_> you'll se esomething like :
  28. <instagibbs_> pick deadbeef Commit message
  29. <emilengler> I know
  30. <emilengler> I think I need to change the pick
  31. <instagibbs_> correct
  32. <instagibbs_> 2nd pick to "f" aka fixup
  33. <instagibbs_> drops the commit message and squashes
  34. <instagibbs_> f(ixup) both work. s(quash) keeps the commit message
  35. <instagibbs_> then exit and save changes, should be good to go
  36. <emilengler> So on line to "pick" => "fixup"
  37. <instagibbs_> yep, or just "f"
  38. <emilengler> Done
  39. <instagibbs_> ok you should have two good-looking commits now
  40. <emilengler> Yes I do
  41. <instagibbs_> once you're satisfied force-push to your repo
  42. <instagibbs_> ok, sorry if im patronizing
  43. <instagibbs_> not sure of git level
  44. <instagibbs_> of expertise
  45. <emilengler> Done
  46. <instagibbs_> now, if the two sets of changes were in one file, the fix is a bit more subtle
  47. <instagibbs_> instead of `git commit` those two files separately, I use `git add -p <filename>` which lets you pick and choose the sub-parts
  48. <emilengler> Ok, thank you a lot :-)
  49. <emilengler> Can I post this chat on github (As a link to a pastebin)?
  50. <emilengler> So others can benefit from it in future
  51. <instagibbs_> sure
  52. <emilengler> Ok thanks :)
Advertisement
Add Comment
Please, Sign In to add comment