spock icon indicating copy to clipboard operation
spock copied to clipboard

Spock doesn't track unpublished collection entry

Open aerni opened this issue 7 years ago • 4 comments

When unpublishing a collection entry, Spock adds, commits and pushes the unpublished file with the underscore e.g. _entry.md as expected. But it doesn't track the deleted file entry.md. I had to add, commit and push it myself. Great, if this can be fixed.

aerni avatar Oct 12 '18 10:10 aerni

The same thing happens when publishing an unpublished entry. Spock adds, commits and pushed the published file e.g. entry.md but doesn't track the deleted file _entry.md.

aerni avatar Oct 12 '18 10:10 aerni

Oh interesting. Maybe we should be firing an event for that from Statamic... Will look into it, thanks!

jesseleite avatar Oct 12 '18 17:10 jesseleite

Can't reproduce.

commit 93c4795e7649b64892005edd32fb07769921ed3e (HEAD -> testing)
Author: Captain Spock <[email protected]>
Date:   Fri Oct 26 11:02:06 2018 -0400

    Entry saved by jlo

diff --git a/app/site/content/collections/things/_a-new-entry-from-spock.md b/app/site/content/collections/things/a-new-entry-from-spock.md
similarity index 100%
rename from app/site/content/collections/things/_a-new-entry-from-spock.md
rename to app/site/content/collections/things/a-new-entry-from-spock.md

It's committing both fine for me 🤔 What versions of statamic and spock are you running?

jesseleite avatar Oct 26 '18 15:10 jesseleite

I am also running into this issue using the following setup:

  • Statamic 2.11.3
  • Spock 2.1.0

Ignored events:

  - Statamic\Events\Data\AssetUploaded
  - Statamic\Events\Data\AssetMoved
  - Statamic\Events\Data\AssetDeleted
  - Statamic\Events\Data\FileUploaded

My current solution is to use a custom after command:

- if (( $(git status -s | wc -l) > 0 )); then git add --all && git commit -m "[skip-ci] Additional changes after running Spock" && git push; fi

wanze avatar Dec 14 '18 14:12 wanze