logseq-plugin-git icon indicating copy to clipboard operation
logseq-plugin-git copied to clipboard

git commit & push is confusing

Open dezren39 opened this issue 2 years ago • 2 comments

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

dezren39 avatar Oct 16 '22 09:10 dezren39

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:

  • 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.

reox avatar May 08 '23 08:05 reox

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

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

k2s avatar Aug 09 '23 13:08 k2s