Ammbot

just relax

Git edit hunk in Patch mode

# Manual hunk edit mode -- see bottom for a quick guide
# -1,5 mean code start at line 1 and has 5 lines (count normal line with minus line)
# +1,4 mean after patch will start at line 1 and has 4 lines (count normal line with plus line)
@@ -1,5 +1,4 @@
LINE 1
LINE 2
-LINE 2.1
-LINE 2.2
+LINE 3
+LINE 4
-LINE 5
# ---
# To remove '-' lines, make them ' ' lines (context).
# To remove '+' lines, delete them.
# Lines starting with # will be removed.
#
# If the patch applies cleanly, the edited hunk will immediately be
# marked for staging. If it does not apply cleanly, you will be given
# an opportunity to edit again. If all lines of the hunk are removed,
# then the edit is aborted and the hunk is left unchanged.

# Case 1: I do not want to remove LINE 5 anymore
# so I have to edit @@ -1,5 to -1,4 (count normal line with minus line)
@@ -1,4 +1,4 @@
LINE 1
LINE 2
-LINE 2.1
-LINE 2.2
+LINE 3
+LINE 4

# Case 2: I do not want to add LINE 3 and LINE 4 also don't want to REMOVE LINE 2.1
# so I have to edit @@ -1,5 to -1,4 (count normal line with minus line)
# and +1,4 @@ to +1,2 (count normal line with plus line)
@@ -1,4 +1,2 @@
LINE 1
LINE 2
-LINE 2.2
-LINE 5

# Case 3: I want to manually ADD LINE 6 and edit TEXT LINE 3
# so I have to edit +1,5 to +1,5 (count normal line with plus line)
@@ -1,5 +1,5 @@
LINE 1
LINE 2
-LINE 2.1
-LINE 2.2
+LINE 3.1
+LINE 4
-LINE 5
+LINE 6