Is there some way to stage individual lines of a file which has just been changed to include newline at EOF? I tried add -p, but it wouldn't split the relevant hunk into small enough parts, and it's well known that git-gui throws a corrupt patch error when dealing with files without a newline at the end. The relevant hunk: $courier:   courier new, courier, freemono, nimbus mono l,              liberation mono, monospace;-            -$monaco:    monaco, lucida console, dejavu sans mono, -            bitstream vera sans mono, liberation mono, -            monospace;\ No newline at end of file++$monaco:    monaco, lucida console, dejavu sans mono,+            bitstream vera sans mono, liberation mono,+            monospace;++h1 {+  font-size: 2em;+}[snip]I'd like to commit everything up to h1 as a whitespace fix, and everything after in a separate commit.
How to stage part of hunk with added newline at EOF?
git
Maybe this solution can work for you too:https://stackoverflow.com/questions/6276752/can-i-split-already-splitted-hunk-with-gitEdit the hunk and add \ No newline at end of file at the end of the + lines.Edit:Now that I understood your requirement: Use git add -p to get into interactive mode, delete the +/- lines you don't want to be included in the add and save it then.