statamic / spock

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

Re-ordering entries causes multiple commits #33

Open jesseleite opened 5 years ago

jesseleite commented 5 years ago

Re-ordering entries causes multiple commits (one per entry), in contrast to re-ordering pages which fires a single PagesMoved event (and therefore a single commit).

This actually needs to be addressed in the Statamic core with a new EntriesMoved event that overrides the individual EntrySaved events, but since it's being reported in unrelated issues here (see https://github.com/statamic/spock/issues/32#issuecomment-452055537 and https://github.com/statamic/spock/issues/31#issuecomment-453615468), I thought I'd create a new issue to address this specifically 🙂

timichango commented 5 years ago

Hey Jesse — reckon this is a dupe/related to my other issue posted a few days ago, #32

timichango commented 5 years ago

Or... wait, is it?

timichango commented 5 years ago

Sorry, my bad, originally was confused and thought your comment mentioning me was on that other thread (the request someone else made for change count thresholds) #31 — and I'm a dumbass and hadn't read the whole issue thread. Derp.

jesseleite commented 5 years ago

Heyo! Adding a file limit (#31), and git hanging/performance (#32), are separate issues (though I know you mentioned the entry re-ordering thing in both of those threads).

We currently fire a single event/commit when re-ordering pages 👍, but not yet when re-ordering entries 👎 (hence the creation of this issue, to recognize this specifically as it's own bug/oversight).

timichango commented 5 years ago

Agreed re. file limit stuff (that wasn't my idea / I don't have a dog in that particular fight, so to speak) — was only commenting in that thread re. the multiple commits happening on reorder, on account of the broader commonality of both circumstances leading to a bloat of the commits. And it never once occurred to me that there was any relationship between the spock/git/hang issue and the notion of some sort of file count threshold.

See my comments on #32 re. the spock/reorder/hang thing (responded to a prior inquiry of yours in that thread earlier).

Cheers!

jesseleite commented 5 years ago

Haha no worries man! Just trying to separate these issues out so we can properly deal with them. Take care!

pxwee5 commented 5 years ago

This should be critical. I'm running into issues where:

jackmcdade commented 5 years ago

This is addressed in Statamic v3, coming pretty soon. Page trees are stored in a single file with references to their IDs, which means only one file change, and one commit!