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

rework (work in progress)

Open k2s opened this issue 1 year ago • 0 comments

The current state of the released plugin is very, hmmm ... unfinished.

Goal of this pull request is to modify this plugin for my personal needs. After some review, discussion and improvement it could be merged. If it is too radical change, then other plugin could be published.

Current changes:

  • dev: filter console log with [plugin-git]
  • dev: logDebug, logInfo, logWarn
  • fix switching of graph in current LogSeq instance
  • fix use correct git folder when using multiple LogSeq instance
  • change the plugin has to be enabled on graph (it will initialize GIT for the graph if enabled, setting :plugin-git/enabled true) (BREAKING)
  • add multiple states to status icon, support for loading
  • fix HIDE_POPUP_STYLE
  • add 'plugin disabled' state (gray color) with action to enable plugin
  • add action to disable plugin (will only remove git operation from plugin, will not change anything git config)
  • add Synchronization action - it should safelly execute commit->pull rebase->push (merge conflicts need to be solved manually)
  • change shortcut mapping Mod+S to Synchronization action
  • change shortcut mapping Mod+Alt+S to Commit action
  • change use theme colors for status icon
  • MISSING following actions were not reworked for now: commit&push, push, checkout, pull, pull rebase (BREAKING)
  • MISSING state is checked by performing manual status check or navigating betwen pages or when the window get visibility (BREAKING)
  • MISSING checking of state for now means check of local commit situation and also difference against remote repository (BREAKING)
  • MISSING autoPush setting uses sync() operation, not commitAndPush() (BREAKING)

Todos:

  • maybe provide all GIT actions for user (not sure if this is really benefical)
  • provide user settings (global or per graph?) to configure when to query the states
  • protect remote repository from too many status queries
  • :plugin-git/enabled true is commited to Git, find really local way
    • my original idea was to check if the graph has git enabled, but the LogSeq git wrapper always performs git int :-(
  • improve log messages
    • my idea would be to git exclude special page and put results of last action into it
  • changing setting will not change the plugin without restart

Some ideas how to use it safely on multiple PCs:

  • commit journal files many days ahead - adding from multiple PCs will cause merge conflicts
  • add 1 level of journal template as user/PC name - that will merge without conflicts
  • sync often

k2s avatar Aug 06 '23 20:08 k2s