spock icon indicating copy to clipboard operation
spock copied to clipboard

Spock doesn't 'Git Add' localized content

Open studiovlijmscherp opened this issue 5 years ago • 10 comments

When creating or updating localized content, Spock doesn't run Git Add. (Git status does display the changes).

Other content, fieldset-updates, etc. are added, committed and pushed as they should.

Using Statamic v2.11.3 Spock v2.1.0

Primary locale is set to 'NL'. Secondary locale is 'EN'.

studiovlijmscherp avatar Dec 07 '18 19:12 studiovlijmscherp

I can confirm this issue. Changes on localized content won't be added via git add. Only the main locales will be recognized. Our recent workaround is to add git add . in the commands_after array in the spock.yaml. That works, but also triggers a git error if changes were made to not localized content and everything was added through spock, because git tries to commit no changes. Leaving it alone leads to merging issues because edited content isn't pushed back intot the repository which is a huge issue if you have to rely on a functioning git/spock workflow for your deployments.

goldnead avatar Dec 11 '18 13:12 goldnead

This should be fixed in the next Statamic update @goldnead @studiovlijmscherp 🤘

jesseleite avatar Dec 11 '18 15:12 jesseleite

Does the 'fix' in v2.11.4 (Localized paths get used in DataSaved events) fix the issue?

studiovlijmscherp avatar Jan 07 '19 18:01 studiovlijmscherp

Should yes! Closing, but feel free to re-open if anything is still wonky with localization.

jesseleite avatar Jan 08 '19 15:01 jesseleite

Using Spock 2.2.1 and Statamic 2.11.6 with three locales (EN - Primary, SE, FI) it still doesn't seem to work unfortunately, wether on a local staging environment nor on a DI droplet.

Here's an excerpt from the log files:

[2019-01-17 10:07:29] production.ERROR: Spock command exited unsuccessfully: Command: git add /Users/MacBook/Apps/Statamic/site/content/pages/index.md Output: No output Error: fatal: /Users/MacBook/Apps/Statamic/site/content/pages/index.md: '/Users/MacBook/Apps/Statamic/site/content/pages/index.md' is outside repository [2019-01-17 10:07:29] production.ERROR: Spock command exited unsuccessfully: Command: git add /Users/MacBook/Apps/Statamic/site/content/pages/se.index.md Output: No output Error: fatal: /Users/MacBook/Apps/Statamic/site/content/pages/se.index.md: '/Users/MacBook/Apps/Statamic/site/content/pages/se.index.md' is outside repository [2019-01-17 10:07:29] production.ERROR: Spock command exited unsuccessfully: Command: git add /Users/MacBook/Apps/Statamic/site/content/pages/fi.index.md Output: No output Error: fatal: /Users/MacBook/Apps/Statamic/site/content/pages/fi.index.md: '/Users/MacBook/Apps/Statamic/site/content/pages/fi.index.md' is outside repository

Any idea how this can be solved? Thanks!

Indiku avatar Jan 17 '19 09:01 Indiku

Are those paths correct?

jasonvarga avatar Jan 17 '19 14:01 jasonvarga

Yes, they seem to be correct as far as I can tell. I tried using Spock and Statamic about two weeks ago with just one language and back then it worked perfectly fine. The multi-locale setup seems to have problems though.

Indiku avatar Jan 17 '19 14:01 Indiku

Yeah, I think ours is still haven't problems with multi-locale stuff, also.

bluetidepro avatar Feb 14 '19 21:02 bluetidepro

@Indiku @jasonvarga Any word on a fix for this? We are seeing this too on Spock 2.2.1 and Statamic 2.11.3

bluetidepro avatar Feb 20 '19 17:02 bluetidepro

(also, I wonder if we should re-open this, since it still seems to be a bug?)

bluetidepro avatar Feb 20 '19 17:02 bluetidepro