[darcs-users] Re: ANN: darcs.vim: a vim plugin to work with darcs

Mark Stosberg mark at summersault.com
Tue Dec 28 18:20:46 UTC 2004


On 2004-12-27, Srinath Avadhanula <srinathava at gmail.com> wrote:
> ------=_Part_1280_13683416.1104191344426
> Content-Type: text/plain; charset=US-ASCII
> Content-Transfer-Encoding: 7bit
> Content-Disposition: inline
>
> Hello,
>
> I only recently began using darcs but instantly liked it. Since I also love
> Vim, I made a rudimentary plugin for working with darcs from within GVim.
> The feature-set is somewhat limited, but covers about 90% of the things I
> do with darcs.

This is great. Thanks! I have some feedback for you.

In general:
 - I sometimes see error messages like "Can't find function Debug()".
   They don't seem to cause a problem.  

> Features:
>=========
> 1. Committing from within GVim. When the user presses \dkc, the plugin
>    opens a "commit console" which contains a list of the hunks which darcs
>    sees as the current changes. The user can press Y/N/J/K/F/S just like in
>    darcs to accept/reject individual hunks. The user also enters the commit
>    log message in that same window (by pressing L). After the user is done
>    processing the hunks, he can press R which makes the plugin record the
>    selected changes with the given log message.

I like this. The interface is nice. I think I managed to 'break' it on
my first tree, because darcs prompted me for my e-mail address, and the
software wasn't ready for that:

 is your email address? hunk ./Changes 11
+        foo
+
Shall I record this patch? (1/1) [ynWsfqadjk], or ? for help: 
Fail: <stdin>: hGetChar: end of file

########################

Running this 'command' outside of a darcs repo has a strange result:

 ==============================================================
     
     darcs failed:  Unable to "darcs whatsnew" here.
     
     You need to be in a repository directory to run this command.
     
 ====[ Darcs commit console: Commit log description ]==========
 
 ***DARCS***
 Write the long patch description in this area.
 The first line in this area will be the patch name.
 Everything in this area from the above ***DARCS*** line on 
 will be ignored.
 ==============================================================
#################

On the error message needs to be returned-- the 'commit console area' doesn't need
to be there. 

Furthermore, the plugin should 'do what i mean'. If I'm not currently in a
darcs repo according to my 'working directory', then the plugin should examine
if the directories for the current file, which is what I expected to happen. 

Also, the plugin allowed me to record a patch with a empty patch name, which it shouldn't
do. In fact, I suspect that darcs shouldn't allow this at all. 

> 2. Diffing to the last recorded version. Pressing \dkv makes the plugin
>    vertically diffsplit the GVim window and show the changes between the
>    current state and the last recorded state. This operation is "cheap"
>    because it uses the file from _darcs/current/ corresponding to the
>    current file.

In fact, it may be 4000 times faster. :) [that's a reference to recent discussion
about this issue on the development list. 

 Please be careful to make sure it's very difficult to modify files in 'current', though.
 From this mode, I was able to easily make and save a change to the file
in 'current' without even a warning. You could temporarily make that
file 'read only', but it's probably safest to copy the file to a
temporary directory first, just to insure that 'current' doesn't get
modified by accident.

I would like for one case to be handled specially when 'diffing'. If
there are no changes, don't bother with showing me both files in a diff
mode, since nothing useful can be done there in that case. Instead, just show
'no changes' in the status bar at the bottom. 

> 3. Diffing between two recorded versions: Pressing \dki makes the plugin
>    open an "interactive diff console". In this window, the user can
>    navigate to the next or previous patch using j/k. The user selects two
>    patches, the "from" patch and the "to" patch by pressing 'f' and 't'
>    while on two patches. After the user is done, he presses 'g' (go). The
>    plugin then opens two vertically split windows along the top which shows
>    the difference between the two windows. If the user chooses just one
>    file (using either 'f' or 't'), then the plugin shows the changes from
>    that patch to the current state.

It would be great if there was interactive documentation for this,
perhaps just sitting at the top of the 'console' window that's produced.

Also, the console placed me right in the middle of the file. I expected
it to drop me at the top of the file.

Finally, when I actually tried this command, two more windows produced,
but they were both completely empty and no explanation was given. (I
/did/ expect to find some changes). Maybe my 'to' and 'from' where out
of order? I doubt that would matter. 

    Mark






More information about the darcs-users mailing list