Review Request 113584: Ask git if it is safe to reload a document

Aleix Pol Gonzalez aleixpol at kde.org
Tue Nov 5 00:58:28 UTC 2013



> On Nov. 4, 2013, 12:42 a.m., Aleix Pol Gonzalez wrote:
> > shell/textdocument.cpp, line 176
> > <http://git.reviewboard.kde.org/r/113584/diff/3/?file=208933#file208933line176>
> >
> >     I would say that if the file is deleted and the user didn't edit it, then the file can just go, or at least it should stay in some kind of read only mode that is apparent to the user that the file is gone, and not by using a message box.
> >     
> >     I think that trying to go through the VCS is trying to play too smart.
> 
> Sven Brauch wrote:
>     Hmm, I'm not sure I understand that. Accidentially deleting a file is actually one of the common cases for data loss.
>     
>     Replacing the message box by a passive popup is probably a good idea, but pretty much unrelated to this, no? If the file was removed but the old version is in the VCS, we close the file, if it's not there then we somehow keep it to offer the user the possibility to recover it.
> 
> Aleix Pol Gonzalez wrote:
>     We've discussed that on hte mailing list before. I don't think we have to consider the KatePart as a way to keep what we had on the system. If changes were not saved, then it totally makes sense to keep it, but if that's not the case, I would just close the tabs.
>     
>     My concern is that I don't think we want to have something too complex that our users won't be able to understand and predict.
> 
> Sven Brauch wrote:
>     Just putting here what I said yesterday in IRC: Users rely on the pattern "If I have a document open in the editor, I can't lose its contents". I've seen and read that many times, and it makes sense. I do not want to break this pattern, so I consider closing files deleted from disk a bad idea. This solution, although a bit more complex, doesn't break this pattern and still brings most of the benefits of breaking it.

I'll withdraw my complaint. It's probably not what I would do, but it makes sense and has this magic touch that defines us ;).


- Aleix


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/113584/#review42918
-----------------------------------------------------------


On Nov. 3, 2013, 9:52 p.m., Sven Brauch wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/113584/
> -----------------------------------------------------------
> 
> (Updated Nov. 3, 2013, 9:52 p.m.)
> 
> 
> Review request for KDevelop, Aleix Pol Gonzalez and Milian Wolff.
> 
> 
> Repository: kdevplatform
> 
> 
> Description
> -------
> 
> When a file is changed on disk, we can look in the git object repository
> and see whether the contents currently in the editor are stored somewhere
> there. In that case, there is no risk of data loss when we just silently
> reload the document; the user can always retrieve the old version from
> git.
> 
> For this purpose I added a new VCS interface which version control plugins
> can choose to implement if they are able and willing to provide this
> functionality. If a plugin does not implement the interface, the old
> behaviour is unaffected.
> 
> I implemented the interface for the git plugin and it seems to be working fine.
> There's two issues we might want to talk about:
>  - We can not retrieve the line ending mode from kate. Thus, currently it will
>    only work for files with \n line endings (old behaviour is used instead for
>    different line endings).
>  - It's not blazingly fast. It's not exactly slow, but if you have like 35
>    documents open, the freeze on switching to a completely different branch
>    is noticeable. Test it yourself and give your opinion on whether this
>    is acceptable or not.
> 
> 
> Diffs
> -----
> 
>   plugins/git/gitplugin.h 2f60c24b9d223a815eda6627d1328ce2404e11af 
>   plugins/git/gitplugin.cpp 27f4eaeea46afdfccb88d64caf161cc84a1e5bad 
>   shell/textdocument.h 8bb29fea8395d4cac956778fae85a4a9f57c2cce 
>   shell/textdocument.cpp 187a071d78c3e2d00092bb2adde533486be11eee 
>   vcs/interfaces/icontentawareversioncontrol.h PRE-CREATION 
> 
> Diff: http://git.reviewboard.kde.org/r/113584/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Sven Brauch
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20131105/6d007dde/attachment.html>


More information about the KDevelop-devel mailing list