Git problem in pull request

17 views
Skip to first unread message

Fernando Raya

unread,
Dec 13, 2018, 12:41:49 PM12/13/18
to dylan...@googlegroups.com
Hi guys,

I did a pull request #1169 to opendylan. My idea of best practice was to
make a commit with every change, so I sent a PR with 10 commits of 2
lines each in order to help with issue #95. Bruce M. suggested that I
need to squash the commits in one and I tried but..

I did a 'git rebase -i d6429b3' and squashed the commits in one. Then
when I did 'git pull' git ask me to comment the merge. I try to avoid
this last message with 'git pull --no-edit' but happens anyway when I
'push'. I don't know how to do it.

Been the first time that I work with git, obviously It's my fault, I
should have read a book on git before helping with the docs.

Should the PR be removed? Should I remove my fork too and start again?

Cheers

peter...@gmail.com

unread,
Dec 14, 2018, 11:06:42 AM12/14/18
to dylan-lang
On Thursday, 13 December 2018 17:41:49 UTC, fraya wrote:
I did a pull request #1169 to opendylan. My idea of best practice was to
make a commit with every change, so I sent a PR with 10 commits of 2
lines each in order to help with issue #95. Bruce M. suggested that I
need to squash the commits in one and I tried but..
There's no 'rule' but to me it makes sense if one commit represents one self-contained change. For example here all your commits are part of the same thing, fixing #95.
And if it's a really wide-ranging change it should then be able to be broken down into logical sub-steps.  (see https://github.com/dylan-lang/opendylan/pull/1161 for an example)
I did a 'git rebase -i d6429b3' and squashed the commits in one. Then
when I did 'git pull' git ask me to comment the merge. I try to avoid
this last message with 'git pull --no-edit' but happens anyway when I
'push'. I don't know how to do it.
I think, if you 'git pull' so that all the commits on dylanlang/opendylan master are in your branch, then re-order the commits during rebase so that your squashed changes come after the remote changes, you should be able to force push and not have a merge commit. BUT make sure you've got a backup somewhere because it's not too difficult to lose your changes (speaking from experience!!)

Pete 
Reply all
Reply to author
Forward
0 new messages