haydenull / logseq-plugin-git

A git plugin for logseq
MIT License
115 stars 24 forks source link

git commit & push is confusing #19

Open dezren39 opened 1 year ago

dezren39 commented 1 year ago

i like the idea, but i wish there was some way to say 'i dont care if there is no commit, either dont commit something or commit an empty message and then push' maybe a 'sync' button

reox commented 1 year ago

It was confusing for me as well, that if there is nothing to commit but to push, that this action fails. image Here, the only way is to deliberately add a new change and press commit&push again

It also shows as failed if nothing is to commit and nothing to push: image This message is annoying, because it is not an error.

My expected behavior would be:

maybe it helps to run git diff --cached --exit-code before calling git commit. If it returns a non-zero status, there is something staged but not yet commit. If git commit is called without anything staged it will return exit code 1 - which is however misleading in this case.

k2s commented 1 year ago

this is fixed in https://github.com/haydenull/logseq-plugin-git/pull/39

the new Sync action mapped to Ctrl+S handles this correctly