These are chat archives for coala/coala-bears

30th
Apr 2018
Khuong Luu
@khashf
Apr 30 2018 09:23
I'm trying to squash 2 of my commits into one at PR https://github.com/coala/coala-bears/pull/2381#discussion_r179906308
However, my latest commit was made via Github.com (online), not from my local development machine.
So, when I went to my local machine and try to git rebase -i <my local branch I'm making PR from> I see many other commits from other people on my branch
Here is the image
image.png
What should I do in this case to squash 2 of my commits into one and push to my branch?
Khuong Luu
@khashf
Apr 30 2018 09:31
image.png
My 2 commits are RLintBear: Add asciinema link and RLintBear: Update asciinema link
image.png
John Vandenberg
@jayvdb
Apr 30 2018 09:33
Just squash the most recent commit into the secobd last one
Khuong Luu
@khashf
Apr 30 2018 09:34
If I were to pull, squash, and push, then my PR would involve a whole lots of other commits across different files
ok
John Vandenberg
@jayvdb
Apr 30 2018 09:35
The other commits you see should be identifiers that are also in
master
Khuong Luu
@khashf
Apr 30 2018 09:46
Here is the result
image.png
image.png
The merge from upstream resulted in an additional commit. So my PR still has 2 commits :worried: :(
John Vandenberg
@jayvdb
Apr 30 2018 09:48
Dont 'merge' upstream
You should rebase your single commit in top of master
You also did not squash your commits
Khuong Luu
@khashf
Apr 30 2018 09:53
Now on terminal, when I git rebase -i master, it shows
image.png
the yellow text is what I changed
should I proceed?
John Vandenberg
@jayvdb
Apr 30 2018 09:54
No
That will make a terrible mess
Khuong Luu
@khashf
Apr 30 2018 09:55
:worried:
John Vandenberg
@jayvdb
Apr 30 2018 09:55
your first commit should be pick then the next two are squash
Khuong Luu
@khashf
Apr 30 2018 09:56
image.png
John Vandenberg
@jayvdb
Apr 30 2018 09:57
Yes
And then you need to edit the commit message to comply with http://coala.io/commit
Dont worry, most ppl struggle with this the first time ;)
Khuong Luu
@khashf
Apr 30 2018 10:00
image.png
Is this commit message good, John?
John Vandenberg
@jayvdb
Apr 30 2018 10:01
Gift?
Khuong Luu
@khashf
Apr 30 2018 10:02
hmm, should be "link"
John Vandenberg
@jayvdb
Apr 30 2018 10:02
Ah
after that change it should be ok
Just push that commit to github and i can check
Khuong Luu
@khashf
Apr 30 2018 10:04
After exiting,
image.png
image.png
So git doesn't allow me to push unless I pull again
John Vandenberg
@jayvdb
Apr 30 2018 10:06
Dont pull
Ban pull from your toolkit
it is only telling you information and giving you a suggestion
But it is just a tool
On the command line do a git push
Khuong Luu
@khashf
Apr 30 2018 10:08
So should I use git push -u add-asciinema-for-rlintbear on terminal?
John Vandenberg
@jayvdb
Apr 30 2018 10:08
And use -f to force it
Khuong Luu
@khashf
Apr 30 2018 10:08
oh ok
John Vandenberg
@jayvdb
Apr 30 2018 10:09
A pull is a fetch + merge , and merging creates a mess
We use a fetch + rebase model
Khuong Luu
@khashf
Apr 30 2018 10:13
image.png
Yay!!
John Vandenberg
@jayvdb
Apr 30 2018 10:14
;)
Khuong Luu
@khashf
Apr 30 2018 10:14
Thank you so much!!
TIL: git pull is a mess
and commits squashing
John Vandenberg
@jayvdb
Apr 30 2018 10:18
Oh, the length of commit body is too long
Split evenly on two lines
Khuong Luu
@khashf
Apr 30 2018 10:19
ok
What is Shortlog of the HEAD commit?
John Vandenberg
@jayvdb
Apr 30 2018 10:26
Shortlog is the first line of the commit message of the commit at the top (HEAD)
Now we wait ~ 30 mins
Khuong Luu
@khashf
Apr 30 2018 10:29
for the CI/CD to finish?
John Vandenberg
@jayvdb
Apr 30 2018 10:32
Yup ;)
Then you can use gitmate-bot to rebase your commit
Khuong Luu
@khashf
Apr 30 2018 10:52
Oh, I thought I already rebased my commits and pushed it? So there is a final step where I use gitmate-bot to rebase? How can I do so?
John Vandenberg
@jayvdb
Apr 30 2018 11:32
You squashed. You did have a merge which we removed
You can add a comment '@gitmate-bot rebase' and the bot will do the rebase properly for you
Viresh Gupta
@virresh
Apr 30 2018 19:22
@jayvdb
About the upgrade to trusty, the build mentioned here passes
So are we going to get a trusty upgrade soon for the CI ? (I think the time is still a little too much compared to precise, but still curious)