more novice-friendly behaviour of `git add -p`
- From
- enrico <enrico.guiraud@gmail.com>
- Date
- May 20, 2016, 13:06 UTC
- Message-ID
- <loom.20160520T150517-391@post.gmane.org>
Hello all, I have encountered a couple of non-necessary difficulties when editing a patch during a `git add -p`.
Firstly, the help message says "To remove '-' lines, make them ' ' lines (context)." which is a bit confusing because that "them" refers to '-', not to 'lines'. I spent a good half hour changing '-' lines to lines containing a single white space but git was not very happy about it. I would suggest to change that line with "To remove '-' lines, change '-' into ' ' (for context)"
Secondly, as discussed here (http://git.661346.n2.nabble.com/git-add-patch-bug-with-split-edit-td2171634.html) and in numerous stackoverflow questions, the behaviour of the "edit" (e) option during an interactive add is a bit...bizarre: it requires the user to do a lot of gymnastic if (s)he is editing a hunk after having used the split (s) option, and nine times out of ten the patch will not apply cleanly. I would suggest to change the behaviour of the interactive add to only allow edits when the hunk has not been split (possibly with a one-line explanation for why editing is not possible appearing when inside a split hunk). Since editing is more powerful than splitting this would not result in a loss of generality, but, in my humble opinion, in a much nicer experience for novices and experts alike.
Best regards, enrico