statamic / spock

Automatically perform git commits, pushes, and other cli actions when Statamic content changes
95 stars 16 forks source link

Spock doesn't 'Git Add' localized content #29

Closed studiovlijmscherp closed 1 year ago

studiovlijmscherp commented 5 years ago

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'.

goldnead commented 5 years ago

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.

jesseleite commented 5 years ago

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

studiovlijmscherp commented 5 years ago

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

jesseleite commented 5 years ago

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

Indiku commented 5 years ago

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!

jasonvarga commented 5 years ago

Are those paths correct?

Indiku commented 5 years ago

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.

bluetidepro commented 5 years ago

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

bluetidepro commented 5 years ago

@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 commented 5 years ago

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