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 page creation a Git-untracked file of the same name gets overwritten #1975

Open
guillaume-d opened this issue May 29, 2023 · 3 comments
Open

Comments

@guillaume-d
Copy link

When Gollum commits a new page in Git, as part of the normal procedure to keep the repository and the worktree in sync, an existing untracked file with the same name as the new page is overwritten without warning.
Only happens on a non-bare repo of course.

I opened the bug here and not in gollum/gollum-lib although it is a data loss problem and should fixed at the lowest level possible IMHO.
Anyway some GUI work is probably needed too, and if here more people may see it.

@bartkamphorst
Copy link
Member

I was able to reproduce this behavior. Thanks for the report @guillaume-d .

@bartkamphorst
Copy link
Member

Similarly, content that has been saved to disk in the working directory but not committed to git can be overwritten without warning by an edit in the web interface.

@dometto
Copy link
Member

dometto commented Aug 29, 2023

Please disregard my previous comment (deleted). We could accomplish error handling for this by checking whether there are differences between index and workdir before we attempt to update/commit a file. We currently do not have an API for this in gollum-lib, but the following works using rugged (given a Rugged::Repository r):

> r.status('Bar.md')
 => [:worktree_modified] 

Now the question is whether we want to implement a check for this in gollum-lib or just in gollum. We could try to throw a new kind of error (similar to DuplicatePageError) in gollum-libs Committer logic, that would have to be handled appropriately?

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

No branches or pull requests

3 participants