logseq-plugin-git
logseq-plugin-git copied to clipboard
git commit & push is confusing
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
It was confusing for me as well, that if there is nothing to commit but to push, that this action fails.
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:
This message is annoying, because it is not an error.
My expected behavior would be:
- If there is nothing to commit, say that as a success message and proceed to push
- If there is nothing to push, say that as a success message and exit
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.
this is fixed in https://github.com/haydenull/logseq-plugin-git/pull/39
the new Sync action mapped to Ctrl+S
handles this correctly