[darcs-users] on the subject of better names...

David Roundy droundy at abridgegame.org
Mon Apr 12 10:43:20 UTC 2004


On Sat, Apr 10, 2004 at 11:31:12PM -0700, Adam Megacz wrote:
> 
> Hey, thanks for the send/push thing.  Can I suggest one more thing?

Sure...

> Is there any chance we could merge unrecord and unpull into
> deletepatch or destroypatch or something like that?
>
> My primary gripe is that patches can come from things other than
> pulling and recording (rollback is the most confusing example).
> There's no "unrollback" command, but since you didn't "pull" or
> "record" the rollback patch, people wouldn't think that "unpull" is
> the right way to undo a rollback.

Well, unpull isn't the right way to undo a rollback, unless you have also
performed a revert after the rollback and want to undo both actions, or if
you got the rollback via a pull.

I like the names unrecord and unpull, because they suggest the times when
you could use them safely, which means that newbies are hopefully less
likely to accidentally shoot themselves in the foot with them.

> I guess you could have something like
> 
>    destroypatch [-k] [-m patchname]
> 
> where -k would keep the changes in the working copy (like unrecord)
> and without -k the working copy would be rolled back as well (unpull).

I don't like the idea making unrecord and unpull too similar.  Unrecord is
safe, and unrecord is dangerous, and making the only difference between
them be a command line flag seems unwise.  At the very minimum, the default
would be to unrecord and a flag would be needed to make it an unpull, since
at least that way the safe behavior is default.

But really, I don't think unrecord and unpull should have similar names at
all.  Unrecord is a safe tool that you can use regularly without worrying
about losing any of your data.  Unpull can only be used "safely" on patches
that you previously pulled, or on rollback patches that have their
corresponding changes reverted.  Other than those two situations, you lose
data when you unpull.  Of course, sometimes you want to lose data, but in
such a case you should be absolutely certain that you *want* to lose the
data.

> Further comment: 'darcs revert' becomes redundant; just
> 'darcs record -a; darcs destroypatch'

In that respect, revert is already redundant.  But it is usefully
redundant.  Adding extra complexity to the revert process seems more likely
to cause errors to be made.  There is also the fact that the revert patch
can be undone, while unpull can't.  Of course, undestroypatch functionality
could be added, but it would be more complex because unlike revert,
destroypatch touches both the working directory and the recorded version.
-- 
David Roundy
http://www.abridgegame.org




More information about the darcs-users mailing list