merged branches in incorrect order

php.internals

Adam Baratz

9 years ago
I was following https://wiki.php.net/vcs/gitworkflow to make my first commit to ext/pdo_dblib. I made a little mistake. I committed first to PHP-7.0. I forgot about the PHP-7.1 branch and merged from PHP-7.0 to master. I went back and merged from PHP-7.0 to PHP-7.1. All merges applied cleanly, but will this cause git history issues? Figured it would be better to check what to do next than to do any preemptive cleanup. Thanks, Adam

Stas Malyshev

9 years ago
Hi! On 9/12/16 2:53 PM, Adam Baratz wrote:
> I was following https://wiki.php.net/vcs/gitworkflow to make my first > commit to ext/pdo_dblib. I made a little mistake. I committed first to > PHP-7.0. I forgot about the PHP-7.1 branch and merged from PHP-7.0 to > master. I went back and merged from PHP-7.0 to PHP-7.1. All merges applied > cleanly, but will this cause git history issues? Figured it would be better > to check what to do next than to do any preemptive cleanup.
As long as you merge up (7.0->7.1, 7.1->master) it's fine. Correct order is 7.0->7.1->master but if you did 7.0->master once it's no big deal. Main thing is to never merge down (master->7.0), that would mess up a lot of things.
-- Stas Malyshev smalyshev@gmail.com

Anatol Belski

9 years ago
Adam,
> -----Original Message----- > From: Adam Baratz [mailto:adambaratz@php.net] > Sent: Monday, September 12, 2016 11:54 PM > To: internals@lists.php.net > Subject: [PHP-DEV] merged branches in incorrect order > > I was following https://wiki.php.net/vcs/gitworkflow to make my first commit > to ext/pdo_dblib. I made a little mistake. I committed first to PHP-7.0. I forgot > about the PHP-7.1 branch and merged from PHP-7.0 to master. I went back and > merged from PHP-7.0 to PHP-7.1. All merges applied cleanly, but will this cause > git history issues? Figured it would be better to check what to do next than to do > any preemptive cleanup. >
To keep it clean, you can git checkout master git reset --hard origin/master and same for every branch containing a wrong merge. This will reset every branch to the state of remote, after that you can repeat the merge clean way. Regards Anatol

Adam Baratz

9 years ago
> To keep it clean, you can > > git checkout master > git reset --hard origin/master > > and same for every branch containing a wrong merge. This will reset every
branch to the state of remote, after that you can repeat the merge clean way. Yes, but in this case, I'd already pushed.