[PATCH 0 of 3] RFC: Splitting patch hunks with the record extension

Dirkjan Ochtman dirkjan at ochtman.nl
Tue Jan 5 06:24:56 CST 2010


On Tue, Jan 5, 2010 at 13:17, Dan Villiom Podlaski Christiansen
<danchr at gmail.com> wrote:
>> - don't use line numbers but prompt for every line (also very unwieldy
>> for large patches, I guess)
>
> Might I suggest another alternative? Here's how I see it:
>
> 1) Most changes are small changes, a few lines or so.
> 2) For larger changes, we want to allow operating on line numbers.
> 3) Operating on line numbers is more complicated than operating on individual lines, which can be seen as a form of direct manipulation.
> 4) We want to make the simplest and most common scenario the default & easiest to discover.
>
> On that basis, I'd propose the following UI:
>
> When splitting, we prompt for the for the first line of the hunk. When prompting for lines, we add an extra option, ‘enter’.[2] When this option is chosen, we redisplay the hunk adding line numbers, and prompt for lines to select. A possible advantage of this approach that it could also apply to files: For them, we would display all hunks and ask for numbers of which to select. Alternatively, we could ask for line numbers and ranges in *all* hunks in the file.

Not entirely obvious how you envision this, but here's a semi-related
proposal. Keep two modes: one for showing the patch line-by-line and
one for selecting lines (ranges) by number (so maybe l and n or
something)?

Cheers,

Dirkjan


More information about the Mercurial-devel mailing list