[darcs-users] How do you rename a patch with amend-record?

Ben Franksen benjamin.franksen at bessy.de
Mon Apr 6 19:07:14 UTC 2009


Trent W. Buck wrote:
> Ben Franksen <benjamin.franksen at bessy.de> writes:
>> Ashley Moran wrote:
>>> On 4 Apr 2009, at 16:23, Guillaume Hoffmann wrote:
>>>> When you edit the long comment with darcs amend-record
>>>> --edit-long-comment , the first line is in fact the name (or short
>>>> description) of the patch.
>>> 
>>> Thanks!  I tested this and it works.
>>> 
>>> I find this really non-intuitive though.  I'd really like a way to do
>>> inline patch renaming via --edit-description, like the way you first
>>> enter a patch name.
>>
>> I agree. I found this quite unintuitive, even a hassle, when I learned
>> darcs. Sometimes you don't have a $DISPLAY in Unix. Then some
>> obscure 'default' editor comes up (this depends on system configuration
>> and is not always appropriate to change, for instance when using shared
>> accounts) which I don't even know how to exit from.
> 
> Arguably learning how to exit without saving from vi and nano should be
> one of your first UNIX lessons :-)

I know vi enough to do very simple tasks and doesn't nano list the most
important keys at the bottom? However, I once got an emacs as $EDITOR.
Tried every combination of keys I could think of but to no avail. IIRC, in
the end I did a Ctrl-Z and killed it ;-)

> To customize the editor temporarily on a shared account (such as root),
> you can set VISUAL and/or EDITOR to the name of your preferred editor,
> e.g.
> 
>     export EDITOR=ed
>     darcs record
>
> Or one-shot
> 
>     EDITOR=ed darcs record
> 
> Because it's not appropriate to make this permanent in .profile on a
> shared account, what we typically do at my workplace is each have our
> own $ENV script in /root, e.g.
> 
>     /root/.shrc.twb
>     /root/.bashrc.alla
>     /root/.bashrc.russm
> 
> Then when you first log in, you just do
> 
>     . ~/.shrc.twb
> 
> to get your preferred environment.

Thanks, I know all these tricks. I would have done so had I expected
trouble. But I did not.

Besides, I am also speaking on behalf of much less knowledgeable *nix users,
most of whom really don't want to be bothered with these things.

>> Would a patch be accepted that adds another switch to amend-record
>> (e.g. --edit-name)? The idea is that this starts only the line editor,
>> and presents the old patch name to be edited.
> 
> There is already -m for that purpose, though it requires
> copy-and-pasting,  I think the current choices of -m and --edit are
> adequate for amend-record, but I'm prepared to listen to arguments for a
> third intermediary option.

Funny, I never realized that -m works with amend-record. Thanks for the tip.

> I definitely DO think it's confusing the way all editor sessions
> currently have the patch name and the patch description, with no blank
> line separating them or other visual clues.  I think this is EXTREMELY
> confusing for anyone who isn't already coming from a VCS that does that
> (e.g. CVS?)
> 
> Even for me, it causes problems because I don't think I should add a
> blank line between patch name and description, but if I don't, it causes
> wrapping problems for my editor (which thinks it's all a single
> paragraph).
> 
> Perhaps a better style would be that of an email message, e.g.
> 
>     Author: <patch author>
>     Date: <date>
>     Summary: <patch name>
> 
>     <patch description>
> 
> This would also provide an alternative way to spoof author and date.
> Currently the latter can only be spoofed with --pipe, which is a massive
> pain in the arse for interactive use, as input validation isn't done
> until the end.

Good idea.

Cheers
Ben



More information about the darcs-users mailing list