Closed ScottHamper closed 6 years ago
Hey All,
Any chance this can get merged soon? :(
Sorry this took so long @ScottHamper . Thanks for reporting and exhaustively explaining the issue.
I was trying to replicate what you mentioned but I am not getting the error you mentions.
I only have pages setup for my folders and I was following your instructions by creating a test.txt
dummy file via command line under user/pages
.
After saving I did get the successful save banner but I haven't gotten the error message.
Am I missing something?
Hey @w00fz ,
Thanks! To reproduce the issue, move test.txt
into the root user
folder. The repo should look something like:
/.git
...
/pages
/plugins
/themes
...
test.txt
I tried that too and the file is completely ignored. Do you have folders configured differently other than pages?
Also which version of git
are you running and what's in your sparse-checkout file (user/.git/info/sparse-checkout
)?
The thing that confuses me is that anything at the root that is not what's in sparse-checkout shouldn't be caught as changes at all. So when I drop any file at the root of user
and then I git status
, there is no change detected (as expected).
Hey @w00fz ,
I've put together a more robust proof-of-concept in its own repo that you can play with.
Steps to reproduce:
sh deploy
, or manually enter the following commands from the project root:
composer build
cp -r .git build/user
git -C build/user checkout master
cd build/user
git commit
echo $?
Step four results in the following output:
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
deleted: .gitignore
deleted: .htaccess
deleted: LICENSE.txt
deleted: README.md
deleted: composer.json
deleted: deploy
deleted: web.config
Untracked files:
config/media.yaml
config/security.yaml
config/streams.yaml
plugins/
themes/
no changes added to commit
The removed/untracked files cause isWorkingCopyClean
to return false
, so GitSync then runs git commit
.
Step five shows that the git commit
command exits with a status code of 1
. This is where the guard clause in GitSync's execute
method throws an exception and causes an error message to be displayed. I'm running Git version 2.13.2.windows.1, but I'll try upgrading and report back if it changes things.
The composer.json
and deploy
scripts are based on my real-world scripts. I needed a reasonable way to have the entire site be version controlled, with consistent/reproducible builds (grav/plugins pinned to specific versions) and still allow non-devs to edit pages without knowing Git. This was the solution I came up with.
EDIT: Updated to Git 2.18.0.windows.1 and get the same behavior.
Thank you very much @ScottHamper that’s quite useful! I will try these steps out in the next few days and report back.
See Issue #101 for background.
Let me know if there's anything else I can do to make integrating this change easier/faster for you all.