Collaboration for a KB over github with pull requests

Hello,

I created a git repo in which I created a logseq folder and chose that as my database folder in the logseq app. I have also installed the excellent plugin from Haydennull which shows that there are changes which need to be pushed to remote.

Now I basically want to make a smooth pull request based workflow to collaborate with my team on the knowledge graph.
The only issue I see here is that the PR’s are not really so readable. And I dont think much can be done about that.
Perhaps the best way to achieve this workflow is to pull the PR to your local and see how it looks in Logseq?

Is this the usual approach for collaboration in Logseq? If there are better ideas I would love to hear about them.

Thanks a lot for your help! I love logseq, thanks for building it.

Btw, I had to setup the following as my pre-commit git hook to avoid the trailing whitespace errors during committing.

#!/bin/bash
#

# A git hook script to find and fix trailing whitespace
# in your commits. Bypass it with the --no-verify option
# to git-commit
#
# usage: make a soft link to this file, e.g., ln -s ~/config/pre-commit.git.sh ~/some_project/.git/hooks/pre-commit

# detect platform
platform="win"
uname_result=`uname`
if [ "$uname_result" = "Linux" ]; then
  platform="linux"
elif [ "$uname_result" = "Darwin" ]; then
  platform="mac"
fi

# change IFS to ignore filename's space in |for|
IFS="
"
# autoremove trailing whitespace
for line in `git diff --check --cached | sed '/^[+-]/d'` ; do
  # get file name
  if [ "$platform" = "mac" ]; then
    file="`echo $line | sed -E 's/:[0-9]+: .*//'`"
  else
    file="`echo $line | sed -r 's/:[0-9]+: .*//'`"
  fi  
  # display tips
  echo -e "auto remove trailing whitespace in \033[31m$file\033[0m!"
  # since $file in working directory isn't always equal to $file in index, so we backup it
  mv -f "$file" "${file}.save"
  # discard changes in working directory
  git checkout -- "$file"
  # remove trailing whitespace
  if [ "$platform" = "win" ]; then
    # in windows, `sed -i` adds ready-only attribute to $file(I don't kown why), so we use temp file instead
    sed 's/[[:space:]]*$//' "$file" > "${file}.bak"
    mv -f "${file}.bak" "$file"
  elif [ "$platform" == "mac" ]; then
    sed -i "" 's/[[:space:]]*$//' "$file"
  else
    sed -i 's/[[:space:]]*$//' "$file"
  fi  
  git add "$file"
  # restore the $file
  sed 's/[[:space:]]*$//' "${file}.save" > "$file"
  rm "${file}.save"
done

if [ "x`git status -s | grep '^[A|D|M]'`" = "x" ]; then
  # empty commit
  echo
  echo -e "\033[31mNO CHANGES ADDED, ABORT COMMIT!\033[0m"
  exit 1
fi

# Now we can commit
exit

Maybe for the best user experience, we should have the ability to view the graph on github just like we are viewing it locally in logseq app. The logseq documentation on web is doing that. We need a github plugin to view the PR in server side logseq.

Oh wow, just saw this cool plugin Logseq Publish · Actions · GitHub Marketplace · GitHub
This will enable CD and we can view the graph build on a website! Awesome :slight_smile:

Even Better, Logseq folks have built their own github action for building a SPA GitHub - logseq/publish-spa: A github action and CLI to publish logseq graphs as a SPA app

Thanks folks! you are the best!