# Merging O+ into 5.5

- Thread: https://externals.io/message/66635
- Original archive: https://news-web.php.net/php.internals/66635
- Started by Patrick ALLAERT on 2013-03-15T09:16:54+00:00
- Messages: 8
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #66635 — Patrick ALLAERT — 2013-03-15T09:16:54+00:00

URL: https://externals.io/message/66635#66635

2013/3/15 Dmitry Stogov <dmitry@zend.com>:
> Hi,
>
> For now, I'm trying subtree merging (See http://git-scm.com/book/ch6-7.htmland
> https://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html
> )
>
> You may see the result at https://github.com/dstogov/php-src/tree/PHP-5.5/
>
> This is not an ideal solution:
> - "git log" doesn't show full history on O+ files (however it's stored in
> GIT)
> - merging from PHP to existing O+ git repo (for pecl release) is not
> trivial.
>
> Anyway I'm going to merge O+ into PHP-5.5 today.

Using "git subtree merge" you will definitely loose log, however, ZO+
hasn't been pushed to github with its full history anyway, which is a
bit sad.
You should use a merge technique that relies on "git filter-branch" if
you want to keep the history.

Patrick

---

## #66636 — Dmitry Stogov — 2013-03-15T09:24:36+00:00

URL: https://externals.io/message/66635#66636 · In reply to: #66635

I mean not "git subtree merge" but "git read-dir --prefix ...".
Actually it imports all the history form O+ repo, but it's recorded with
original patches (e.g. ZendAccelerator.h instead of moved
ext/ZendOptimizerPlus/ZendAccelerator.h), so you can see it running "git
log", but not "git log ext/ZendOptimizerPlus/ZendAccelerator.h".

Thanks. Dmitry.

On Fri, Mar 15, 2013 at 1:16 PM, Patrick ALLAERT <patrickallaert@php.net>wrote:

> 2013/3/15 Dmitry Stogov <dmitry@zend.com>:
> > […]
> http://git-scm.com/book/ch6-7.htmland
> > […]
> https://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html
> > […]
> https://github.com/dstogov/php-src/tree/PHP-5.5/
> > […]
>
> Using "git subtree merge" you will definitely loose log, however, ZO+
> hasn't been pushed to github with its full history anyway, which is a
> bit sad.
> You should use a merge technique that relies on "git filter-branch" if
> you want to keep the history.
>
> Patrick

---

## #66637 — Pierre Joye — 2013-03-15T09:33:30+00:00

URL: https://externals.io/message/66635#66637 · In reply to: #66636

> I mean not "git subtree merge" but "git read-dir --prefix ...".
> Actually it imports all the history form O+ repo, but it's recorded with
> original patches (e.g. ZendAccelerator.h instead of moved
> ext/ZendOptimizerPlus/ZendAccelerator.h), so you can see it running "git
> log", but not "git log ext/ZendOptimizerPlus/ZendAccelerator.h".

btw, it has to be renamed to opcache, aka ext/opcache. I suppose all
ini settings have to be updated as well.

Cheers,
-- 
Pierre

@pierrejoye

---

## #66638 — Dmitry Stogov — 2013-03-15T09:34:31+00:00

URL: https://externals.io/message/66635#66638 · In reply to: #66637

Yeah, I'm working in this direction.
Agree, it's better to do it before the merging.

Thanks. Dmitry.



> 
> > […]
>
> btw, it has to be renamed to opcache, aka ext/opcache. I suppose all
> ini settings have to be updated as well.
>
> Cheers,
> --
> Pierre
>
> @pierrejoye

---

## #66639 — Damien Tournoud — 2013-03-15T09:53:53+00:00

URL: https://externals.io/message/66635#66639 · In reply to: #66636

> I mean not "git subtree merge" but "git read-dir --prefix ...".
> Actually it imports all the history form O+ repo, but it's recorded with
> original patches (e.g. ZendAccelerator.h instead of moved
> ext/ZendOptimizerPlus/ZendAccelerator.h), so you can see it running "git
> log", but not "git log ext/ZendOptimizerPlus/ZendAccelerator.h".

Here you are:

$ git clone git://github.com/zend-dev/ZendOptimizerPlus.git
$ git clone git://github.com/php/php-src.git
$ cd php-src
  $ git remote add opcode ../ZendOptimizerPlus
  $ git checkout -b opcode opcode/master
  $ git filter-branch -f --index-filter 'git read-tree --empty ; git
read-tree --prefix=ext/opcode "$GIT_COMMIT"' HEAD
  $ git checkout -b master origin/master
  $ git merge opcode

Damien

---

## #66640 — Dmitry Stogov — 2013-03-15T10:08:19+00:00

URL: https://externals.io/message/66635#66640 · In reply to: #66639

This solution clones the history, but makes merging between PHP and O+ repo
(it's going to be used for pecl build for old PHP versions) even more
difficult.

Thanks. Dmitry.



> 
> > […]
>
> Here you are:
>
> $ git clone git://github.com/zend-dev/ZendOptimizerPlus.git
> $ git clone git://github.com/php/php-src.git
> $ cd php-src
>   $ git remote add opcode ../ZendOptimizerPlus
>   $ git checkout -b opcode opcode/master
>   $ git filter-branch -f --index-filter 'git read-tree --empty ; git
> read-tree --prefix=ext/opcode "$GIT_COMMIT"' HEAD
>   $ git checkout -b master origin/master
>   $ git merge opcode
>
> Damien

---

## #66641 — Damien Tournoud — 2013-03-15T10:19:40+00:00

URL: https://externals.io/message/66635#66641 · In reply to: #66640

> This solution clones the history, but makes merging between PHP and O+ repo
> (it's going to be used for pecl build for old PHP versions) even more
> difficult.
>
> Thanks. Dmitry.

Not sure. Merging between the two repositories using the subtree
strategy should be just fine.
… and having the history (ie. the common ancestors) should even help the merge
algorithm.

Damien

---

## #66642 — Dmitry Stogov — 2013-03-15T10:24:30+00:00

URL: https://externals.io/message/66635#66642 · In reply to: #66641

The problem that this approach renames the commits an they are not the same
anymore (as in O+ repo).

Usage of subtree strategy is not perfect, but it's something that more or
less works.

Thanks. Dmitry.



> 
> > […]
> repo
> > […]
>
> Not sure. Merging between the two repositories using the subtree
> strategy should be just fine.
> … and having the history (ie. the common ancestors) should even help the
> merge
> algorithm.
>
> Damien
