stefanzweifel / git-auto-commit-action

Automatically commit and push changed files back to GitHub with this GitHub Action for the 80% use case.
MIT License
1.98k stars 227 forks source link

Does auto-commit support removes? #137

Closed retorquere closed 3 years ago

retorquere commented 3 years ago

And if it does, should I rm the file, or git rm the file beforehand?

stefanzweifel commented 3 years ago

If I understood your question correctly, yes git-auto-commit supports "removes".

If a step in your workflow removes a file or directory, git-auto-commit will detect that and create a commit where the file/directory is being deleted.

If you want to use rm or git-rm is up to you.

Notes

retorquere commented 3 years ago

Is there anything to configure for this? In this run on my repo, the deletes are detected, but the corresponding commit does not delete the files.

stefanzweifel commented 3 years ago

No, there isn't a way to configure git-auto-commit regarding how files are being deleted. git-auto-commit uses just git under the hood.

However, it's very weird that the /github/* files are being logged in the Workflow and apparently added to the commit, but will not be actually deleted.

I've also cloned your repo and ran git diff --stat 18f2416..8a314e4 which also shows that only 3 files have been updated.

DagOverzicht.ipynb              | 598 ++++++++++++++++---------------------------------------------------------------------------------
LeeftijdsgroepenLandelijk.ipynb | 478 ++++++++++++++++++++++++++++++++++++++---------------------------------------
RegioV2.ipynb                   |  90 +++++++--------
3 files changed, 382 insertions(+), 784 deletions(-)

Maybe you have to use git-rm instead of rm?

retorquere commented 3 years ago

Found it -- if I give it a file-spec like *.gz, that won't match the missing files of course, so they don't get taken along in the commit. If I add the folder they're in, it works. Fortunately for me the folders where I want to track deletes only have one type of file, so the result comes out the same.