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

On Windows portable version, moving QOwnNotes to a different drive causes git versioning to silently fail #1192

Closed
Krabbyos opened this issue Apr 22, 2019 · 7 comments
Labels
Type: Feature adds functionality
Milestone

Comments

@Krabbyos
Copy link

So i'm on Windows and have git installed on my E: drive. I originally also had QOwnNotes portable version also on the E: drive. I moved the entire QOwnNotes folder to my Z: drive.

About 5 months later, QOwnNotes crashed while saving a note. Note empty; data lost. Checked the git repository; last commit was about 5 months ago despite versioning being on the entire time.

Current Behavior

On Windows Portable mode

git executable: E:\Program Files\Git\bin\git.exe
turns to this after oking the settings dialog: E:/Notes/QOwnNotes/Data/../../../Program Files/Git/bin/git.exe
git versioning through OQwnNotes works fine

After moving QOwnNotes folder to Z: drive

path shown in settings: Z:/Notes/QOwnNotes/Data/../../../Program Files/Git/bin/git.exe
git versioning fails silently (nothing exists at that path)

Reselecting path to git executable (which is now on a different drive)

before oking settings: E:\Program Files\Git\bin\git.exe
after oking settings: Z:/Notes/QOwnNotes/Data/E:/Program Files/Git/bin/git.exe
git versioning silently fails (also that's not a valid path)

Expected Behavior

Expected QOwnNotes to popup an error message or something instead of silently failing the commit. Also shouldn't QOwnNotes test if the rewritten path actually points to a git executable? Currently, the git path selection dialog allows you to select any file at all (even non .exe files). And the path rewriting can result in invalid paths.

@pbek pbek added the Type: Feature adds functionality label Apr 22, 2019
@pbek
Copy link
Owner

pbek commented Apr 22, 2019

Thank you for your suggestion.

@pbek
Copy link
Owner

pbek commented Apr 23, 2019

after oking settings: Z:/Notes/QOwnNotes/Data/E:/Program Files/Git/bin/git.exe
git versioning silently fails (also that's not a valid path)

Yes, Windows doesn't allow relative paths to an other drive.

actually points to a git executable

it could also be a script or something else... we could test with https://doc.qt.io/qt-5/qfileinfo.html#isExecutable

EDIT: no we can't test that, because the git client will be in the search path on all other supported operating systems (but Windows) by default

@pbek
Copy link
Owner

pbek commented Apr 23, 2019

git versioning silently fails

you should get a warning in the log widget

@pbek
Copy link
Owner

pbek commented Apr 23, 2019

19.4.5

  • you now will get a warning dialog if your git client couldn't be executed when a git command is issued
    • you will be able to turn off that dialog

@pbek pbek added this to the 19.4.5 milestone Apr 23, 2019
pbek added a commit that referenced this issue Apr 23, 2019
pbek added a commit that referenced this issue Apr 23, 2019
pbek added a commit that referenced this issue Apr 23, 2019
pbek added a commit that referenced this issue Apr 23, 2019
@pbek
Copy link
Owner

pbek commented Apr 23, 2019

There now is a new release, could you please test it and report if it works for you?

@Krabbyos
Copy link
Author

Confirming that the warning popup shows

@pbek
Copy link
Owner

pbek commented Apr 23, 2019

Great, thank you for testing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature adds functionality
Projects
None yet
Development

No branches or pull requests

2 participants