[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    Re: Review Request: Kate/KWrite, Disable backup files by default.
From:       Kåre Särs <kare.sars () iki ! fi>
Date:       2012-06-01 6:58:17
Message-ID: 20120601065817.7111.47228 () vidsolbach ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


> On May 30, 2012, 6:46 p.m., Dominik Haumann wrote:
> > Mark, improving the backup system is certainly a very good idea. However, \
> > disabling the feature by default is pretty much the same as not implementing it \
> > at all, as usually no one enables it manually. 
> > I'd like to suggest to discuss this on kwrite-devel@kde.org, our developer \
> > mailing list for Kate/KWrite, and would be very happy if you elaborate more on \
> > your ideas and possibly more smart solutions. 
> > Finally, I'd also like to point you all to the last point on \
> > http://kate-editor.org/about-kate/, called "Backup and Restore". If you click on \
> > the image, you can see a "Recover bar" on the top that pops up in case of a \
> > crash. In short: This works exactly like the swap file support in vim. In other \
> > words, we have the recovery on crash in addition to the backups. The recovery \
> > works only for once saved files that are local on your disk. The same holds \
> > similarly on the ~ backup files, depending on the configuration :-) 
> > Besides that, thanks for taking the time and providing a patch. If we work \
> > together and discuss a good solution, I'm sure we'll end up with something that \
> > is really good.
> 
> Mark Gaiser wrote:
> Hi Dominik,
> 
> The short answer is no. I simply don't have the time yet.
> 
> Though i've been thinking a lot more about proper ways of "backing up" or actually \
> "restoring from a crash" since that's the thing that should happen. If that works \
> fine then the current solutions can be send to /dev/null ;) 
> Anyway, here is my - very short version - of a way longer idea that i've been \
> having but am not going to post or propose due to.. you guessed it, time! I won't \
> go into implementation details just to keep it short. Only describing what "should" \
> be there at some point in time. 
> 1. We should have something like apple has in OSX 10.7. Save revisions! When you \
> save a file, a revision should be saved allowing you to go back in history. 2. \
> Kate/KWrite should make a local HIDDEN file of the file they are editing (like the \
> <filename>~ now) that gets updated with changes you make. To elaborate a little on \
> that, compare it with gmail, there google saves your changes made about once every \
> 5 or 10 seconds or so. 3. Upon file saving (ctrl + s) the hidden file (or the \
> contents of it) should become the new file and the hidden file should be gone. NO \
> backup in this case because there is nothing to backup. Everything went right. 4. \
> In the event of a crash the hidden file is still there since Kate/KWrite didn't had \
> the opportunity to write it's content to the actual file. In that case Kate/KWrite \
> should notify the user of that and allow them to save it's content to the expected \
> file or ignore it. In both cases the "backup" file is handled and removed - \
> assuming it doesn't crash again. 
> That's my idea of how it should work and that seems sane. The current "backup" way \
> is just an extremely stupid way (no offence intended). It's not even a backup! A \
> copy of one file with another name in the same folder or even the same physical \
> hardware is not a backup.. It's just a copy. It would be a (kind of) backup if you \
> send it to some other place/other computer. 
> Anyway, the description above would probably be a perfect project for a GSoC (or \
> KSoC) person. The above - except for the revision part - seems to be what Office \
> (and perhaps QtCreator as well?) is doing and seems to be working well. I will try \
>                 - no promises - to draft up a big version of this idea and post it \
>                 to:
> - the wiki
> - kwrite devel list
> - kde frameworks devel list
> 
> Dominik Haumann wrote:
> > 1. [...] Save revisions! When you save a file, a revision should be saved \
> > allowing you to go back in history.
> We are doing that. If you have KDE >= 4.7, or built kate from sources, you will see \
> that a hidden .filename.swp file is created. 
> > 2. Kate/KWrite should make a local HIDDEN file of the file they are editing (like \
> > the <filename>~ now) that gets updated with changes you make. [...] save every 5 \
> > or 10 seconds or so.
> Kate saves the unsaved edit actions (or revisions as you call it) all 15 seconds.
> 
> > 3. Upon file saving (ctrl + s) the hidden file (or the contents of it) should \
> > become the new file and the hidden file should be gone. [...]
> Right, it works exactly like this. On save or on a clean application exit, the \
> .filename.swp files are deleted. 
> > 4. In the event of a crash the hidden file is still there since Kate/KWrite \
> > didn't had the opportunity to write it's content to the actual file. [...]
> Right, and that's why Kate will show the Recovery bar on the top (read what I wrote \
> above). 
> I've implemented all this myself, and, as far as I know, it works really well.
> 
> Could you try this and report back: Edit a file, and kill kate. Then reopen this \
> file with Kate: you should see the recovery stuff. 
> Mark Gaiser wrote:
> Right, please remind me why we're even having this discussion if all features are \
> there.. If all those features are already in place then why do we still have the \
> "backup" of <filename>~ ... Turn those features on by default and disable the \
> <filename>~ feature.

The backup is probably not meant for crashes, but for being able to go back to the \
original if you made a mistake while editing. This will not work if you save many \
times before you are done tho.


- Kåre


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


On May 28, 2012, 1:51 a.m., Mark Gaiser wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/105064/
> -----------------------------------------------------------
> 
> (Updated May 28, 2012, 1:51 a.m.)
> 
> 
> Review request for Kate, Jekyll Wu, Dominik Haumann, and Greg T.
> 
> 
> Description
> -------
> 
> By default Kate and KWrite always makes backup files when you save your file. So \
> <yourfile.comething>+<backup suffix> in reality that becomes "yourfile.ext~". While \
> the idea of having a backup file is neat, it hurts me more then it benefits. 
> It's in my way in the following situations (which i encounter quite often):
> - git! When i edit some files in some git repo with kate or kwrite they always make \
> backup files. Files i manually have to remove again when i want to make a git \
>                 commit.
> - backup files are always visible in dolphin which is sometimes hard to distinguish \
> when the filename is just a bit to long to fit in the window thus the backup suffix \
> isn't visible. 
> I've been using KDE for years now and never found myself in the position where i \
> actually needed to use the backup files. 
> So that's my reasoning for disabling this by default. It would be more valuable if \
> editing a file was saved while editing like \
> https://bugs.kde.org/show_bug.cgi?id=274102 but that's a whole different beast. 
> 
> Diffs
> -----
> 
> part/dialogs/katedialogs.cpp 99c51ea 
> part/utils/kateconfig.cpp be4dd02 
> 
> Diff: http://git.reviewboard.kde.org/r/105064/diff/
> 
> 
> Testing
> -------
> 
> Tested on master and works fine.
> 
> 
> Thanks,
> 
> Mark Gaiser
> 
> 


[Attachment #5 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;">  <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/105064/">http://git.reviewboard.kde.org/r/105064/</a>
  </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On May 30th, 2012, 6:46 p.m., <b>Dominik \
Haumann</b> wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">  <pre style="white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Mark, improving the backup system is certainly a very good idea. \
However, disabling the feature by default is pretty much the same as not implementing \
it at all, as usually no one enables it manually.

I&#39;d like to suggest to discuss this on kwrite-devel@kde.org, our developer \
mailing list for Kate/KWrite, and would be very happy if you elaborate more on your \
ideas and possibly more smart solutions.

Finally, I&#39;d also like to point you all to the last point on \
http://kate-editor.org/about-kate/, called &quot;Backup and Restore&quot;. If you \
click on the image, you can see a &quot;Recover bar&quot; on the top that pops up in \
case of a crash. In short: This works exactly like the swap file support in vim. In \
other words, we have the recovery on crash in addition to the backups. The recovery \
works only for once saved files that are local on your disk. The same holds similarly \
on the ~ backup files, depending on the configuration :-)

Besides that, thanks for taking the time and providing a patch. If we work together \
and discuss a good solution, I&#39;m sure we&#39;ll end up with something that is \
really good.</pre>  </blockquote>




 <p>On May 30th, 2012, 8:43 p.m., <b>Mark Gaiser</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Hi Dominik,

The short answer is no. I simply don&#39;t have the time yet.

Though i&#39;ve been thinking a lot more about proper ways of &quot;backing up&quot; \
or actually &quot;restoring from a crash&quot; since that&#39;s the thing that should \
happen. If that works fine then the current solutions can be send to /dev/null ;)

Anyway, here is my - very short version - of a way longer idea that i&#39;ve been \
having but am not going to post or propose due to.. you guessed it, time! I won&#39;t \
go into implementation details just to keep it short. Only describing what \
&quot;should&quot; be there at some point in time.

1. We should have something like apple has in OSX 10.7. Save revisions! When you save \
a file, a revision should be saved allowing you to go back in history. 2. Kate/KWrite \
should make a local HIDDEN file of the file they are editing (like the \
&lt;filename&gt;~ now) that gets updated with changes you make. To elaborate a little \
on that, compare it with gmail, there google saves your changes made about once every \
5 or 10 seconds or so. 3. Upon file saving (ctrl + s) the hidden file (or the \
contents of it) should become the new file and the hidden file should be gone. NO \
backup in this case because there is nothing to backup. Everything went right. 4. In \
the event of a crash the hidden file is still there since Kate/KWrite didn&#39;t had \
the opportunity to write it&#39;s content to the actual file. In that case \
Kate/KWrite should notify the user of that and allow them to save it&#39;s content to \
the expected file or ignore it. In both cases the &quot;backup&quot; file is handled \
and removed - assuming it doesn&#39;t crash again.

That&#39;s my idea of how it should work and that seems sane. The current \
&quot;backup&quot; way is just an extremely stupid way (no offence intended). \
It&#39;s not even a backup! A copy of one file with another name in the same folder \
or even the same physical hardware is not a backup.. It&#39;s just a copy. It would \
be a (kind of) backup if you send it to some other place/other computer.

Anyway, the description above would probably be a perfect project for a GSoC (or \
KSoC) person. The above - except for the revision part - seems to be what Office (and \
perhaps QtCreator as well?) is doing and seems to be working well. I will try - no \
                promises - to draft up a big version of this idea and post it to:
- the wiki
- kwrite devel list
- kde frameworks devel list</pre>
 </blockquote>





 <p>On May 30th, 2012, 9:12 p.m., <b>Dominik Haumann</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">&gt; 1. [...] Save \
revisions! When you save a file, a revision should be saved allowing you to go back \
in history. We are doing that. If you have KDE &gt;= 4.7, or built kate from sources, \
you will see that a hidden .filename.swp file is created.

&gt; 2. Kate/KWrite should make a local HIDDEN file of the file they are editing \
(like the &lt;filename&gt;~ now) that gets updated with changes you make. [...] save \
every 5 or 10 seconds or so. Kate saves the unsaved edit actions (or revisions as you \
call it) all 15 seconds.

&gt; 3. Upon file saving (ctrl + s) the hidden file (or the contents of it) should \
become the new file and the hidden file should be gone. [...] Right, it works exactly \
like this. On save or on a clean application exit, the .filename.swp files are \
deleted.

&gt; 4. In the event of a crash the hidden file is still there since Kate/KWrite \
didn&#39;t had the opportunity to write it&#39;s content to the actual file. [...] \
Right, and that&#39;s why Kate will show the Recovery bar on the top (read what I \
wrote above).

I&#39;ve implemented all this myself, and, as far as I know, it works really well.

Could you try this and report back: Edit a file, and kill kate. Then reopen this file \
with Kate: you should see the recovery stuff.</pre>  </blockquote>





 <p>On May 31st, 2012, 7:57 a.m., <b>Mark Gaiser</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Right, please remind me \
why we&#39;re even having this discussion if all features are there.. If all those \
features are already in place then why do we still have the &quot;backup&quot; of \
&lt;filename&gt;~ ... Turn those features on by default and disable the \
&lt;filename&gt;~ feature.</pre>  </blockquote>








</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The backup is probably \
not meant for crashes, but for being able to go back to the original if you made a \
mistake while editing. This will not work if you save many times before you are done \
tho.</pre> <br />








<p>- Kåre</p>


<br />
<p>On May 28th, 2012, 1:51 a.m., Mark Gaiser wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for Kate, Jekyll Wu, Dominik Haumann, and Greg T.</div>
<div>By Mark Gaiser.</div>


<p style="color: grey;"><i>Updated May 28, 2012, 1:51 a.m.</i></p>






<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">By default Kate and KWrite always makes backup files when you save your \
file. So &lt;yourfile.comething&gt;+&lt;backup suffix&gt; in reality that becomes \
&quot;yourfile.ext~&quot;. While the idea of having a backup file is neat, it hurts \
me more then it benefits.

It&#39;s in my way in the following situations (which i encounter quite often):
- git! When i edit some files in some git repo with kate or kwrite they always make \
                backup files. Files i manually have to remove again when i want to \
                make a git commit.
- backup files are always visible in dolphin which is sometimes hard to distinguish \
when the filename is just a bit to long to fit in the window thus the backup suffix \
isn&#39;t visible.

I&#39;ve been using KDE for years now and never found myself in the position where i \
actually needed to use the backup files.

So that&#39;s my reasoning for disabling this by default. It would be more valuable \
if editing a file was saved while editing like \
https://bugs.kde.org/show_bug.cgi?id=274102 but that&#39;s a whole different \
beast.</pre>  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Tested on master and works fine.</pre>  </td>
 </tr>
</table>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>part/dialogs/katedialogs.cpp <span style="color: grey">(99c51ea)</span></li>

 <li>part/utils/kateconfig.cpp <span style="color: grey">(be4dd02)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/105064/diff/" style="margin-left: \
3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>



_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic