Coder Social home page Coder Social logo

Comments (16)

jackmcdade avatar jackmcdade commented on June 14, 2024 2

Sure thing, nothing holding you up from configuring your own tooling. Spock is a swiss army knife that just reacts to events, which happens to be super useful for auto committing changes in most circumstances. That's it :)

from spock.

jasonvarga avatar jasonvarga commented on June 14, 2024 1

Interesting ideas, but I'd say this is outside the scope of Spock.

from spock.

jackmcdade avatar jackmcdade commented on June 14, 2024 1

You could just have a cron job that does git add --all && git commit "regular push from prod" and you wouldn't need Spock.

from spock.

jesseleite avatar jesseleite commented on June 14, 2024

A file limit? Confused about your use case?

from spock.

timichango avatar timichango commented on June 14, 2024

Sounds like he's wanting to set a threshold number for how many files need to be changed before a commit gets triggered β€” ie. rather than initiating a commit each time a file is altered, Spock would hold off until the threshold number (of changed files) is reached, and then commit them en-masse in a single commit, rather than individually. No? I'd guess this is coming from experiencing an overwhelming number of commits in the repo?

from spock.

Christophvh avatar Christophvh commented on June 14, 2024

Could be useful, we currently have an importer running every hour for a load of entries. So every our we get about 100 git-commits. 1 for each entry changed instead of a bundled commit.

from spock.

timichango avatar timichango commented on June 14, 2024

To some extent I can't help wondering if a scheduled commit wouldn't be more appropriate for most use-cases? Like commit every X hours, if anything's changed β€” rather than every X files. Both scenarios kinda seem like setting a risk-tolerance threshold (ie. we can tolerate losing X amount of data if something goes wrong between commits), but I'm more accustomed to seeing that tolerance expressed in time-based commit (or, rather, backup, more broadly) intervals, than as change-count based intervals β€”Β since a change-count based interval, could, for example, if the change frequency was low, mean that no backups/commits happen for a long time.

from spock.

pxwee5 avatar pxwee5 commented on June 14, 2024

Well, right now it's commiting on every action, my editor saves like 30 times for 1 blog post. So I have 30 commits.

What if we put all the changed files in an array buffer, and then have the menubar say how many unsaved changes.

Users can click the button to make a commitment to save the page. It's 1 more step to the whole process but it'll make the repository squeaky clean.

from spock.

Christophvh avatar Christophvh commented on June 14, 2024

Sad to hear it, because this seems like exactly within the scope of Spock since it has nothing to do with statamic itself but with the way Spock commits. Gonna add this image here. Our site is still running on staging and we almost have 1000 commits just from a week that seems very dirty.

screenshot 2019-01-10 at 10 15 14

from spock.

pxwee5 avatar pxwee5 commented on June 14, 2024

It has everything to do with Spock. What @Christophvh has uploaded is a very real issue experienced by many teams running their marketing website on Statamic and rely on Spock to properly save the content creator's work.

My team's git repository looks exactly like Chris'.

from spock.

jesseleite avatar jesseleite commented on June 14, 2024

This seems like exactly within the scope of Spock since it has nothing to do with statamic itself but with the way Spock commits.

It has everything to do with Spock.

There's definitely room for future improvements, but it's out of scope for Spock because it's not Spock's job to group commits; Spock simply listens to events and commits once per event. A lot of what's being asked here would require fundamentally large changes in the Statamic core itself. Maybe we can improve some of this for Spock in v3.

To some extent I can't help wondering if a scheduled commit wouldn't be more appropriate for most use-cases.

"Most" is subjective here, and as you said there's added risk because of what could go wrong in between scheduled commits. Spock's ears are designed for events, but if you want a schedule based commit instead, it wouldn't be too hard to whip up your own command and task addon 😊

from spock.

timichango avatar timichango commented on June 14, 2024

@jesseleite I totally agree re: scheduling not really being Spock's purview β€” to clarify, I was thinking of commit scheduling in the same context you mentioned: as something performed by another tool.

I've got my own issues with Spock/Core (the whole thing with reordering entries triggering a litany of commits, rather than a single commit for the reorder), but fundamentally I think the one-change/one-commit paradigm fits for what it is trying to achieve.

from spock.

timichango avatar timichango commented on June 14, 2024

^ precisely

from spock.

timichango avatar timichango commented on June 14, 2024

For my purposes, I'm looking into structuring my projects as pairs of repositories: one for the core/theme/etc, and another for the /content directory, so they can have different commit strategies applied that are relevant to the needs of both. That way it ultimately is less relevant (at least insofar as a heap of content commits makes navigating dev-related commits unwieldy) if the content commits go go bananas all over the(ir own) repo.

from spock.

timichango avatar timichango commented on June 14, 2024

Is there an event tied to the expiry of a CP login session? That might be something useful to leverage, with Spock, if so...

from spock.

jesseleite avatar jesseleite commented on June 14, 2024

@timichango I notice you've mentioned the entry re-ordering thing here which is valid, but a separate issue. Created a new issue for that specifically #33 πŸ™‚

from spock.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.