wndhydrnt / saturn-bot

Automatically create pull requests. Create, modify or delete files across repositories.
https://saturn-bot.readthedocs.io
GNU Affero General Public License v3.0
0 stars 0 forks source link

CRUD of file contents in git repos #54

Open gedw99 opened 3 weeks ago

gedw99 commented 3 weeks ago

From what I can see this cant send Git Unified diffs, in order to change file contents in a git repo ?

The docs do say "Insert, replace or delete lines in files." though. I guess it's not using Git Unified diffs ?

as distinct from what it does now which is whole files ?

wndhydrnt commented 3 weeks ago

Hello, thank you for your interest in saturn-bot.

Right now, saturn-bot doesn't use unified diffs. Or maybe it does and I'm misunderstanding what they are. Any links to resources appreciated.

Not entirely sure what you want to achieve, but here are the steps saturn-bot takes:

  1. Check if all filters match the repository.
  2. If all filters match, clone the repository to the local file system.
  3. Create a new branch locally.
  4. Apply all actions defined in the task file to the local clone of the repository. Since you mentioned "Insert, replace or delete lines in files.", the actions lineDelete, lineInsert and lineReplace might be of interest.
  5. If any of the actions has added, modified or deleted files in the local clone, create a commit.
  6. Push the commit and branch to the remote.
  7. Create a pull request.

Hope that answers your question.

gedw99 commented 3 weeks ago

Thanks

this is a git unified diff for golang

https://github.com/aymanbagabas/go-udiff

It works well as a way to take a git repo and establish the did and then it as a path to a git repo .

I use nats Jetstream to update many repos at once, by sending the diff as the payload to nats and the other repo agents subscribing to it it’s a simple pub sub approach .

Thank you the tips . It help ms ! I will try it out and see how it goes.