Subject: Re: [RFC PATCH] git-add--interactive: manual hunk editing mode v2

From: Junio C Hamano <[email-masked]>
Date: Thu, 05 Jun 2008 01:16:19 -0700

Jeff King <[email-masked]> writes:

> So perhaps manual hunk editing is simply something for advanced users
> who are comfortable with the patch format.

Exactly.  To them, "git diff >patch && vi patch && git apply --cached <patch"
would likely to be much handier, quicker and a more familiar way. That is
one of the reasons I somewhat doubt that we would want to have this patch.

>> +# Empty lines and lines starting with # will be removed.
>
> What about lines starting with characters besides -, +, space, or @?
> They will normally be ignored by diff.

Beware that a totally empty line is the same as an empty context line "SP LF".

For the rest of your comments, I agree with the Perl style (use of map and
grep instead of repeated push in loops).  The end user input, what the
code needs to parse and accept, can screw you up royally and your parsing
needs to be careful, and the code looks fragile.