@@ -89,6 +89,7 @@ sub colored {
89
89
TARGET => ' ' ,
90
90
PARTICIPLE => ' staging' ,
91
91
FILTER => ' file-only' ,
92
+ IS_REVERSE => 0,
92
93
},
93
94
' stash' => {
94
95
DIFF => ' diff-index -p HEAD' ,
@@ -98,6 +99,7 @@ sub colored {
98
99
TARGET => ' ' ,
99
100
PARTICIPLE => ' stashing' ,
100
101
FILTER => undef ,
102
+ IS_REVERSE => 0,
101
103
},
102
104
' reset_head' => {
103
105
DIFF => ' diff-index -p --cached' ,
@@ -107,6 +109,7 @@ sub colored {
107
109
TARGET => ' ' ,
108
110
PARTICIPLE => ' unstaging' ,
109
111
FILTER => ' index-only' ,
112
+ IS_REVERSE => 1,
110
113
},
111
114
' reset_nothead' => {
112
115
DIFF => ' diff-index -R -p --cached' ,
@@ -116,6 +119,7 @@ sub colored {
116
119
TARGET => ' to index' ,
117
120
PARTICIPLE => ' applying' ,
118
121
FILTER => ' index-only' ,
122
+ IS_REVERSE => 0,
119
123
},
120
124
' checkout_index' => {
121
125
DIFF => ' diff-files -p' ,
@@ -125,6 +129,7 @@ sub colored {
125
129
TARGET => ' from worktree' ,
126
130
PARTICIPLE => ' discarding' ,
127
131
FILTER => ' file-only' ,
132
+ IS_REVERSE => 1,
128
133
},
129
134
' checkout_head' => {
130
135
DIFF => ' diff-index -p' ,
@@ -134,6 +139,7 @@ sub colored {
134
139
TARGET => ' from index and worktree' ,
135
140
PARTICIPLE => ' discarding' ,
136
141
FILTER => undef ,
142
+ IS_REVERSE => 1,
137
143
},
138
144
' checkout_nothead' => {
139
145
DIFF => ' diff-index -R -p' ,
@@ -143,6 +149,7 @@ sub colored {
143
149
TARGET => ' to index and worktree' ,
144
150
PARTICIPLE => ' applying' ,
145
151
FILTER => undef ,
152
+ IS_REVERSE => 0,
146
153
},
147
154
);
148
155
@@ -1001,10 +1008,12 @@ sub edit_hunk_manually {
1001
1008
print $fh " # Manual hunk edit mode -- see bottom for a quick guide\n " ;
1002
1009
print $fh @$oldtext ;
1003
1010
my $participle = $patch_mode_flavour {PARTICIPLE };
1011
+ my $is_reverse = $patch_mode_flavour {IS_REVERSE };
1012
+ my ($remove_plus , $remove_minus ) = $is_reverse ? (' -' , ' +' ) : (' +' , ' -' );
1004
1013
print $fh <<EOF ;
1005
1014
# ---
1006
- # To remove '- ' lines, make them ' ' lines (context).
1007
- # To remove '+ ' lines, delete them.
1015
+ # To remove '$remove_minus ' lines, make them ' ' lines (context).
1016
+ # To remove '$remove_plus ' lines, delete them.
1008
1017
# Lines starting with # will be removed.
1009
1018
#
1010
1019
# If the patch applies cleanly, the edited hunk will immediately be
0 commit comments