oblikstudio / kirby-git Goto Github PK
View Code? Open in Web Editor NEWKirby plugin for updating content in the panel via Git
License: MIT License
Kirby plugin for updating content in the panel via Git
License: MIT License
Staging all files could be undesirable at times. There should be an option to pick what to stage and another option to unstage changes.
The composer.json
in the current release requires "getkirby/cms": "^3.7",
, which ^4.0.0
does not satisfy.
Full error:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- oblik/kirby-git[1.0.0, ..., 1.1.0] require getkirby/cms ^3.3 -> found getkirby/cms[3.3.0, ..., 3.9.8] but it conflicts with your root composer.json require (^4.0.0).
- oblik/kirby-git 1.2.0 requires getkirby/cms ^3.4 -> found getkirby/cms[3.4.0, ..., 3.9.8] but it conflicts with your root composer.json require (^4.0.0).
- oblik/kirby-git 1.3.0 requires getkirby/cms ^3.6 -> found getkirby/cms[3.6.0, ..., 3.9.8] but it conflicts with your root composer.json require (^4.0.0).
- oblik/kirby-git 1.4.0 requires getkirby/cms ^3.7 -> found getkirby/cms[3.7.0, ..., 3.9.8] but it conflicts with your root composer.json require (^4.0.0).
- Root composer.json requires oblik/kirby-git * -> satisfiable by oblik/kirby-git[1.0.0, ..., 1.4.0].
(Originally published at: https://srijan.ch/notes/2023-11-28-001)
By default, the plugin runs Git commands like this:
exec('git --version');
...which is a problem if there are multiple versions of Git on the system and the wrong one is used. There should be an option like oblik.git.bin
that determines the path to the Git executable so that commands can turn to this instead:
exec('/usr/local/bin/git --version');
It would be useful to notify the user of potential updates by running git fetch
when the Git tab is opened and then showing something like:
3 commits can be pulled from origin/master
Hi,
just realised if no name is definied for a kirby user the commit's author is "oblikweare". I would prefer to just use the email addresse. Or is there a way to define the other?
Even if you can stage separate files as #3 suggests, you'd have to do a lot of clicking just to stage the children of a single page. You should be able to navigate directories and stage them as needed.
The AJAX response is this:
To https://git-codecommit.eu-central-1.amazonaws.com/v1/repos/my-repo
c8dd520..6859a72 master -> master
error: update_ref failed for ref 'refs/remotes/origin/master': cannot update the ref 'refs/remotes/origin/master': unable to append to '.git/logs/refs/remotes/origin/master': Permission denied
...but nothing is shown in the panel as if the push was successful.
I think it would be awesome if one could easily customize the labels of status etc. on the commit overview. With that, one could set it up for non-technical users to be used.
When running on a staging environment, for example, it could be useful to have the ability to switch between branches and commit to them separately, without having to SSH on the server.
Leaving this here as a heads up for anyone who might run into the same problem. When adding the plugin to a kirby setup with a public folder, the Add
button on the unstaged
column does not work, which pretty much breaks the plugin.
To solve this add 'oblik.git.repo' => '../'
to your config.php
.
Hi,
I'm running this plugin along with another plugin for tracking redirects and 404s. This other plugin uses an SQLite DB and I'm trying to add the DB to my .gitignore
file on the repo, but kirby-git doesn't seem to be honouring it. The ignore works locally in VSCode, so I know it's not a problem with the file.
Any tips please?
Hi!
I've tried installing the plugin manually because I'm not sure I can use composer on my shared web hosting service. There is git though (2.24.1).
I've set my config file like this:
'oblik.git.repo' => 'path-repository',
'oblik.git.merge' => 'master',
'oblik.git.hooks' => [
'site.update:after',
'page.update:after'
],
I don't really understand the mistake here. Could you help me understand what's wrong?
When you checkout a new branch on the server, e.g. live
, but there's no live
branch on origin
yet, you get the following error in the panel:
fatal: ambiguous argument 'origin/live..live': unknown revision or path not in the working tree.↵Use '--' to separate paths from revisions, like this:↵'git [...] -- [...]'
When you've left an open browser tab with the Git view open, it can be useful to poll for changes so you don't have to refresh the page.
When updating to kirby 3.7, the changes list becomes invisible as soon as there are changes.
Not sure what happens here, and don't have any Kirby UI/Vue knowledge to understand what is going wrong.
It looks like its just a change in kirbys vue templating implementation. No errors in console, and the plugin works correctly apart from this visibility issue.
If you have a branch named content
, Git confuses it with the content
folder. All commands run by the plugin should make use of the --
argument to clearly separate the command options.
Hey!
I've setup Kirby Git in my Project.
Now my Deployment Platform only allows me, to have the repo on the server as core.bare = true.
That way, the .git folder is in a different path, not accessible from the served path for the files available on public.
Makes sense obviously.
Now sadly, this way, the Kirby-Git Plugin doesn't seem to work, is there a workaround or a better solution to get this up and running?
I always get this error when I try to implement the status pane: fatal: this operation must be run in a work tree
.
Additionally, I get this Error, when I open the "Git" Tab in the Panel:
fatal: ambiguous argument 'origin/live..live': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]'
Anything I can do?
That would be amazing!
Thanks for your work.
Sam
When I customize the repo path it gives me fatal error:
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 12288 bytes) in .../kirby/src/Cms/Core.php on line 348
I just want to only use the content's git repo. So I changed it to 'repo' => kirby()->roots()->content()
The content folder is excluded in the main repo and is a separate repo for its own. I use php 8.1.8 and git 2.37.1.
With the default value as repo it works great.
is there a way to autocommit changes and push them. That would be a great and easy backkup.
First off, I'm very excited about the plugin. Thank you for building it! It's so well thought out, and I can't wait to start using it.
Issue: When I visit the plugin page (/panel/git
), console shows two 500 errors on the API requests, resulting in a non-working page showing an empty dialog (see screenshots).
About my installation:
oblik/git
(installed via composer)This is the error response when I visit the API routes directly:
{"status":"error","message":"Unauthenticated","code":403,"exception":"Kirby\\Exception\\PermissionException","key":"error.permission","file":"\/kirby\/config\/api\/authentication.php","line":14,"details":[],"route":"git\/status"}
Any advice?
It'd be useful to be able to pull and push using the same branch. When you work alone, it's harder to produce conflicts and using separate branches could be unnecessary.
HI,
I try to use $git->push()
in a hook.
'hook' => [
'page.*:after' => function($newPage, $oldPage){
$git = new Git();
$git->add();
$git->commit('update from ' . $oldPage->uid() . ' to ' . $newPage->uid());
$git->push();
},
]
if I try to save a page I got this message:
The Form could not saved because
Exception: undefined
Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
If i comment $git->push()
out, the commitment works without error.
But I lost the push.
Have you an Idea whats going on?
Cheers
Hi,
how can I update kirby-git with the composer for Kirby 3.6?
If I use version "oblik/kirby-git": "^dev-dev", I get error messages.
What version number have I to use in the composer.json for updating?
Cheers
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.