I have just applied a patch
to 3 files, their diff
can be seen here:
The task is to separate the patch
into various commit
s, like comments, license, refactoring etc.
For that I will use git add -p
:
First hunk is license of
main.c
, trivial, i pressy
.Second hunk is in
stack.c
and contains one hunk of license followed by two hunks of comments. Is
plit and theny
n
n
I will keep doing this for the rest of
git add -p
.
HOWEVER, it looks like none of the n
applied!
To confirm my suspicions I will do a fresh git add -p
again, this time I will use e
and this will become this.
git
then outputs fatal: corrupt patch at line 50
. So basically my s
and n
tried to not stage certain hunks but ended up discarding those removals.
+
lines should be removed without problems unlike -
(where you have to replace that line with space), right? What am I doing wrong?