Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git auto commit cannot be enabled #3207

Closed
johnghill opened this issue Nov 18, 2021 · 19 comments · Fixed by #3243
Closed

Git auto commit cannot be enabled #3207

johnghill opened this issue Nov 18, 2021 · 19 comments · Fixed by #3243
Labels
:type/bug Something isn't working. Affects daily use.

Comments

@johnghill
Copy link

Describe the bug
Git auto commit cannot be enabled

To Reproduce
Steps to reproduce the behavior:

  1. Go to Settings > Version Control [Desktop Logseq]
  2. Click on Enable Git Auto Commit

Expected behavior

  1. GUI switch responds to command
  2. git auto commit is enabled/disabled

Screenshots
n/a

Desktop (please complete the following information):

  • OS: Linux 5.10.70-1-MANJARO x86_64
  • Browser: microsoft-edge-dev-bin 97.0.1072.8-1
  • Logseq Version : 0.4.8-1 via AUR

Additional context
I have tried dropping :git-auto-push true into [graph]/logseq/config.edn and ~/.config/Logseq/configs.edn but neither of these measures restores auto commit

@Bad3r
Copy link
Collaborator

Bad3r commented Nov 18, 2021

To test if git is working

  1. create a new directory, for example test
  2. Open the directory as a new graph in logseq
  3. Open logseq settings and ensure that git auto commit is enabled if not enable it
  4. Restart logseq
  5. Open the journal or any page and add some text to it
  6. close logseq
    1. Remember that the git auto commit by default commits every 60 seconds
  7. In your terminal, navigate to the graph directory
  8. execute the command 
    $ git log  
    1. You should see the output containing a commit message similar to this one
        commit 46c5d2ffde7aaafefaf4f48747f47dc03a7541bf (HEAD -> main)  
        Author: Bad3r <bad3r@protonmail.com>  
        Date:   Wed Nov 3 09:06:28 2021 -0400  
          
        Auto saved by Logseq  

Please follow these steps and let me know if you have any issues. If you do please post the output of $ git status and $ git log

Git auto will only commit. it will not push automatically for you.

@johnghill
Copy link
Author

Unfortunately I encountered bug #3208 when attempting to create a new graph.

@Bad3r
Copy link
Collaborator

Bad3r commented Nov 18, 2021

Unfortunately I encountered bug #3208 when attempting to create a new graph.

Can you test with the new 0.4.9 beta? It's available in the releases page. It's not available in the AUR yet

@johnghill
Copy link
Author

File chooser dialog not appearing on logseq-linux-x64-0.4.9.AppImage either.

@Bad3r
Copy link
Collaborator

Bad3r commented Nov 18, 2021

File chooser dialog not appearing on logseq-linux-x64-0.4.9.AppImage either.

Yes there appears to be an issue with the new electron version #3202. Hopefully it will be fixed soon.

For now can you run git status in your current graph and post the output? Are you sure you aren't mixing up git commit with git push?

@cnrpman
Copy link
Collaborator

cnrpman commented Nov 19, 2021

Unfortunately I encountered bug #3208 when attempting to create a new graph.

It's just fixed and will be delivered in the next beta release. Or you can rollback to the 0.4.6, as it's using a lower ver. of Electron.

@davclark
Copy link

I can confirm that git autocommits are also not happening on my install of Logseq 0.4.9 (released) on Windows 11. I have the directory installed in a WSL2 distro, git is installed for both the windows and WSL2 runtimes.

@Bad3r
Copy link
Collaborator

Bad3r commented Nov 22, 2021

Can you test if 0.5.0 solved this issue?

@Laptop765
Copy link

  • create a new directory, for example test
  • Open the directory as a new graph in logseq
  • Open logseq settings and ensure that git auto commit is enabled if not enable it
  • Restart logseq
  • Open the journal or any page and add some text to it
  • close logseq

I'm having trouble with git auto-commit not working at all on Windows 11. I tried following these steps for a fresh graph to see what happens. After creating a new directory and opening it as a new graph in Logseq and verifying git auto commit is enabled, the .git directory isn't even created so all git commands result in fatal: not a git repository (or any of the parent directories): .git. This is with the latest 0.5.0 release.

@tiensonqin tiensonqin added the :type/bug Something isn't working. Affects daily use. label Nov 23, 2021
@tiensonqin
Copy link
Contributor

@Laptop765 Thank you for the confirmation!
@xyhp915 @RCmerci Anyone can reproduce this bug on Windows?

@Laptop765
Copy link

Is there any debug info I could provide to help out? I'm not sure where to look for errors.

@tiensonqin
Copy link
Contributor

@Laptop765 It seems that git init doesn't work for you. Do you have git installed on Windows? If so, try git init . in your graph's local directory to see whether it works.

@Laptop765
Copy link

Laptop765 commented Nov 23, 2021

git init .
Reinitialized existing Git repository in C:/Users/Lapto/.logseq/git/Ccomma_Users_Lapto_test/.git/

It looks like it created a .git folder not inside the test graph folder. Is that expected?

Edit: Ahh there's a .git file in the test folder that points elsewhere.

Edit 2: Might be a path escaping issue on Windows not mapping C:\Path\To\graph correctly.

@Laptop765
Copy link

Laptop765 commented Nov 23, 2021

Okay on another test it looks like Logseq does try to create a .git directory but it's creating a placeholder .git file redirecting to another directory rather than having a .git directory in the graph directory.

Edit: After waiting a while it still doesn't auto-commit. git status shows all the files are untracked.

@Laptop765
Copy link

Not sure if it's relevant, but I have a pre-existing .git folder in my pkm directory but Logseq keeps trying to do something with C:\Users\Lapto\.logseq\git\Ccomma_Users_Lapto_pkm.

xyhp915 added a commit that referenced this issue Nov 23, 2021
tiensonqin pushed a commit that referenced this issue Nov 23, 2021
@tiensonqin tiensonqin reopened this Nov 23, 2021
@tiensonqin
Copy link
Contributor

@Laptop765 Sorry for the late response, can you give this newly built release a try?
https://github.com/logseq/logseq/releases/tag/0.5.0

@Laptop765
Copy link

Definitely!

Case 1: fresh graph

  1. mkdir temp
  2. Open temp in Logseq
  3. Make a change on the daily page
  4. Wait for auto commit

Success! The git repository was created and the change was committed.

Case 2: graph with existing .git directory

  1. Open pkm in Logseq
  2. Make a change on the daily page
  3. Wait for auto commit

Success! The change was committed.

@johnghill
Copy link
Author

@tiensonqin Both #3207 and #3208 (#3202) appear to be fixed in logseq-linux-x64-0.5.0.AppImage.

Namely, git auto commit is running (confirmed "Autosaved by Logseq" in git log), the GUI toggle for version control is working, and the file selection dialog now appears for new graphs.

Thank you.

@tiensonqin
Copy link
Contributor

@johnghill @Laptop765 Awesome, thank you both for the confirmation!
Closing this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:type/bug Something isn't working. Affects daily use.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants