[darcs-users] hunk editing
kowey at darcs.net
Sat Sep 26 06:02:41 UTC 2009
Hi darcs users,
On Sat, Sep 19, 2009 at 22:01:51 +0100, Ganesh Sittampalam wrote:
> I'd like to encourage everyone interested to try out the hunk editing
> patches I posted and comment on the usability of the feature.
Just thought I should make some more noise about this. Hunk editing
is now in the Darcs darcs repository and it's already making my life
as a Darcs user better!
darcs get --lazy http://darcs.net
> I have also started a wiki page for explaining/discussing the design
> here: http://wiki.darcs.net/Review/HunkEditing - please feel free to add
> your comments or questions there, or in this email thread.
Time for a UI discussion. See the page above for details.
The number one thing to keep in mind is that under the hood, we replace
a patch by a sequence of patches that does the *exact same thing* as the
original. This may be unintuitive for editing patches (because we will
offer you a patch that seems to undo your changes), but it's hard for me
to see how to implement this otherwise. I think we can do some
commutation to make life easier, though.
This is a slightly "idealised" representation of the current UI
Interactive hunk edit:
- Edit the first set of lines to insert a new change before the
- Edit the second set of lines to insert a new change after the
A plus and minus centric proposal
For what it's worth, what I was thinking about was something like this:
1. Help text is good.
2. Display the original patch in some ignored area
hunk editing place
-- everything below ignored ---
3. As suggested in the review page, do NOT offer (after2, after)
4. Attempt to commute (after2, after) to the end by making it last. If
you cannot do this then refuse the modifications with a friendly
5. Apply the inverse of (after2, after) to the working directory.
6. Let users edit minuses and plusses. I think I want to be able to
and turn it into
+ a1-oh I forgot this
whereby the hunk editor/splitter recognises I want to turn this into
three hunk patches and implicitly tack on a fourth
- a1-oh I forgo this
to bring us back to square one, but then commute that to the end...
7. Reject nonsense edits such as removing lines that don't exist.
Note that I'm not sure if what I'm asking is necessarily possible.
We'll have to keep these three things in mind as we discuss the UI for
hunk editing: (a) it's got to be something that Darcs can do safely and
(b) there are many use cases we may not have considered and (c) ideally,
at the end of the day, this should retain that simple mental model magic
behind the Darcs UI.
Anyway, this sounds like a great chance for Darcs users to shape their
near future UI. Have fun!
PS. I think it would help if should somebody could cook up a nice
example repo(s) that we can use to discuss hunk splitting and put on
the web. My idea is that we darcs get your repo, unrecord the last
patch, then re-record and use the hunk editor.
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 194 bytes
Desc: not available
More information about the darcs-users