Conversation
…ate (+gmt version) from merged files
| $initializationDir = VERSIONPRESS_PLUGIN_DIR . '/src/Initialization'; | ||
| MergeDriverConfigurer::installGitattributes($initializationDir); | ||
| MergeDriverConfigurer::installGitMergeDriver($initializationDir); | ||
| WP_CLI::success("Git merge driver for VersionPress files added."); |
There was a problem hiding this comment.
- Maybe just "Git merge driver added".
|
Overall great work, my line comments are smaller things, maybe just two other things to discuss are:
|
| $gitconfigVariables = array( | ||
| 'wp-plugins' => rtrim(ltrim(PathUtils::getRelativePath(VP_PROJECT_ROOT, WP_PLUGIN_DIR), '.'), '/\\'), | ||
| 'merge-driver-script' => 'ini-merge.php', | ||
| 'bin-dir' => PHP_BINDIR . '/php' |
There was a problem hiding this comment.
- This isn't a directory but an executable. It's confusing in
gitconfig.tpl.
plugins/versionpress/ini-merge.php
Outdated
| $matches = array(); | ||
| preg_match($dateMatchPattern, $aFile, $matches); | ||
| if (count($matches) == 0) { | ||
| echo "not found"; |
There was a problem hiding this comment.
Perhaps some leftover of debugging?
- Remove echo
0d8f7fc to
3cd6d80
Compare
22fb6c6 to
12f9c53
Compare
…t (Windows -> PHP /Linux -> Bash)
|
Waiting for completing measurements in #588 (comment). |
|
A couple of questions / suggestions about this:
|
| $mergeEC = MergeDriverTestUtils::runProcess(MERGE_CMD); | ||
| $time_end = microtime(true); | ||
| $execution_time = ($time_end - $time_start); | ||
| echo 'Php Execution Time: '.$execution_time.' Sec'; |
|
The problem is missing replacement of slashes here https://github.com/versionpress/versionpress/blob/588-date-modified-merge-driver/plugins/versionpress/tests/Utils/MergeDriverTestUtils.php#L97 I think that if you install VersionPress from scratch the driver script path will contain correct slashes. |
|
Now that you mention it, it seems to me that there should also be a |
|
You are right. It seems correct to remove driver when VersionPress will be uninstalled. |
…ich is called when VersionPress is deactivated.
|
|
||
| $this->assertEquals(1, MergeDriverTestUtils::runProcess(self::$mergeCmd)); | ||
|
|
||
| copy(self::$repositoryDir . '/file.ini', '/Users/Ivan/expected-merge-conflict.ini'); |
There was a problem hiding this comment.
- Wrong absolute path (with username).
…of asserted string)
…a CLI. Added workflow tests
- The test was not actually testing anything as the posts in both test and clone sites have likely been modified in the same second. `sleep()` was added. - Test renamed from `updatedArticleCanBeMergedFromClone()` to `dateModifiedMergesAutomatically()` to better reflect what id does. - Some other things slightly refactored.
…not read correctly from the cloned site.
|
|
||
| private static $masterDate; | ||
|
|
||
| private static $branchDate; |
There was a problem hiding this comment.
- Many of these variables are used in one place only, they are unnecessary noise in this class and should be inlined.
8f1be93 to
cf015b1
Compare
|
Good job, seems ready to merge to me. 👍 |
588 date modified merge driver

This PR closes #588 by adding custom merge driver which selects more recent significant dates from both merged files and saves them. Then traditional
git merge feature-branchis made.Please review :
Thank you