gitbook icon indicating copy to clipboard operation
gitbook copied to clipboard

File 'Save' is erratic

Open Abel-Torres opened this issue 10 years ago • 5 comments

There is no consistent behavior in the Save function.

Abel-Torres avatar May 11 '16 21:05 Abel-Torres

Can you detailed a little more the issue?

We are working on a serie of improvements for the editor that improve the reliability.

SamyPesse avatar May 11 '16 21:05 SamyPesse

I am using Gitbook Editor on my local machine. I have all files on my disk.

When I modified a file with the editor, then use the Save option, I do not see that the file has been saved. Namely, the timestamp is unchanged; the content of the local file does NOT contain the changes I made in the editor.

The Save function is opaque and unreliable. Apparently Gitbook is saving my local files somewhere without my knowing it. Those files may or may not overwrite the local file.

Abel-Torres avatar May 11 '16 22:05 Abel-Torres

It seems as if the Gitbook editor sometimes doesn't persist the changes to disk. Closing the editor seems to persist them to disk.

HomenSimpsor avatar Jun 02 '16 23:06 HomenSimpsor

I have this same issue. Additionally, the GitBook editor can't push to my corporate git repository because it uses SSH, so I can't really figure out a way to use the editor for local editing.

The odd thing is that if I close GitBook editor and then re-open it, the changes I made are still there. However, they are not in the file if I open it using vi on the command line. @Wideshanks seems to have a different experience with closing the editor. That solution doesn't work for me at all.

I've done some searching on my file system to see if I can find where GitBook is storing the files and I couldn't figure it out. There was nothing in the ~/GitBook/ directory. There also wasn't anything in the ~/Library/ directory either.

Seems like a lot of magic for something that should be very simple. If you edit a file and hit save, it should write the changes to disk. Not sure why you guys aren't doing this and instead storing changes in some magic location that doesn't align with where the files are on disk.

UPDATE: Some more information on this. I also tried hitting the Commit button at the top of the editor, but that didn't update the file system either. Nor did it update what was stored in my local Git branch. Then when I changed the file again, I now had a conflict with the file system. I also tried resetting the file in Git on the file system and also editing it on the file system using vi and those changes were not picked up by the editor.

I really have no idea what this editor is doing with local files. This is pretty painful considering I'm just editing local files. At this stage, the GitBook editor seems like it only works with your remote Git system and doesn't handle local files at all. It's probably simpler to use a simple editor like Atom or Notepad++ until you guys iron out all these issues.

The key to using the editor with local files will be that it should ALWAYS stay in sync with the file system. If I edit the file via the command-line, the editor should update. If I do a git pull and everything is updated, the editor should also update. If I edit a file in the editor and hit save, it should write it to disk. All the Git features of the editor aren't very useful when editing local files unless you have a Git repo that uses HTTPS, so you might want to just disable all that and make the editor just a standard file editor.

voidmain avatar Jul 09 '16 18:07 voidmain

@Wideshanks seems to have a different experience with closing the editor. That solution doesn't work for me at all.

No, I was wrong. It's not saving them when I close. Must have been a fluke.

HomenSimpsor avatar Jul 09 '16 19:07 HomenSimpsor