Skip to content
This repository was archived by the owner on Jul 28, 2024. It is now read-only.

Fix merge driver on Debian-based systems#1385

Merged
borekb merged 1 commit intoversionpress:masterfrom
candrews:busybox-fix-merge-driver.sh
Mar 6, 2019
Merged

Fix merge driver on Debian-based systems#1385
borekb merged 1 commit intoversionpress:masterfrom
candrews:busybox-fix-merge-driver.sh

Conversation

@candrews
Copy link
Copy Markdown
Contributor

@candrews candrews commented Mar 6, 2019

Fixes #1384

Using "" to escape "-" in tr isn't standard so move "-" to the end to avoid having to escape it.

@candrews
Copy link
Copy Markdown
Contributor Author

candrews commented Mar 6, 2019

@borekb What do you think?

@borekb
Copy link
Copy Markdown
Member

borekb commented Mar 6, 2019

I'm trying to run tests for it, and doing a full suite was not the best idea :) It's been almost an hour an a half since it started.

Do you have a couple of examples of how the replacements actually look, before and after the fix?

@candrews
Copy link
Copy Markdown
Contributor Author

candrews commented Mar 6, 2019

Do you have a couple of examples of how the replacements actually look, before and after the fix?

test

Begin
post_modified = "2013-03-03 13:13:13"
End

test2

Begin
post_modified = "2014-03-03 13:13:13"
End

test3

Begin
post_modified = "2015-03-03 13:13:13"
End

test2 is the file that will change.

Testing done on by running ini-merge.sh on versionpress/wordpress:cli (which uses Alpine and therefore busybox tr, not gnu tr).

Before this change, test2:

Begin
post_modified = "2014-03-03 13:13:13"
End

Also, this error is output to stdout: sh: 2014-03-0313:13:13: bad number

With this change, test2:

Begin
post_modified = "2015-03-03 13:13:13"
End

and no error is output to stdout.

@borekb
Copy link
Copy Markdown
Member

borekb commented Mar 6, 2019

Awesome! When the tests finish (I'm now running only CloneMergeTest and it still takes ages!), I'm going to merge this.

Really glad you managed to fix this. We already have some friends working on the Go implementation but it might take a while so this is greatly appreciated 👍.

@pavelevap
Copy link
Copy Markdown
Collaborator

I tried only dateModifiedMergesAutomatically test and it works for me 🎉

@borekb
Copy link
Copy Markdown
Member

borekb commented Mar 6, 2019

For me too. Thanks, @candrews!

@borekb borekb merged commit ecbcd61 into versionpress:master Mar 6, 2019
@borekb borekb added this to the 4.0 milestone Mar 6, 2019
@pavelevap
Copy link
Copy Markdown
Collaborator

I am not sure if it is related, but running similar mergedDatesWithoutConflict test leads me to following Warning:

Warning: chmod(): Read-only file system in /opt/versionpress/src/Git/MergeDriverInstaller.php on line 97

@chmod($mergeDriverScript, 0750); // Catching warning in case of read-only FS. However, it should already be 0750.

Oh, now I see, that I removed @ yesterday during tests, so probably nothing important.

@borekb borekb changed the title Using "\" to escape "-" in tr isn't standard so move "-" to the end to avoid having to escape it Fix merge driver on Debian-based systems Apr 14, 2019
@borekb borekb added scope: core Core VersionPress functionality like tracking actions, creating Git commits, etc. noteworthy Significant issue or PR, to be highlighted in release notes labels Apr 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

noteworthy Significant issue or PR, to be highlighted in release notes scope: core Core VersionPress functionality like tracking actions, creating Git commits, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Merge driver doesn't work on Debian-based systems

3 participants