zauberzeug/livesync

Write git status(es) into .livesync_mutex

Closed this issue · 4 comments

It would be helpful to see the current development status on the remote machine to explain its current behavior. The output of git status per synchronized folder should be a good start.

Task list

  • write git summary to mutex file
  • handle missing git
  • add commit hash
  • @rodja review

Implemented in b8f6299 and f3dddb0.

The git information needs to be passed into the mutex set and is_free methods, but it works. To avoid issues with quotes when echoing the multiline string into the mutex file, they are replaced with single quotes.

Random thoughts:

  • Now livesync depends on git being installed. We might want to make this optional.
  • git status does not show the commit hash. Maybe there's a better representation of the current status.
rodja commented

We could simply add the shortend hash above the git status call: https://stackoverflow.com/a/7617078/364388

I updated the git summary accordingly: 6f9757c.
Now the mutex file looks like this:

Falkos-MBP 2022-09-02T07:59:38.620688

/Users/falko/Projects/livesync --> ~/livesync
[f3dddb0]
## main...origin/main
 M livesync/livesync.py