Merge branch 'jl/add-p-reverse-message'
* jl/add-p-reverse-message: Correct help blurb in checkout -p and friends
This commit is contained in:
		| @ -89,6 +89,7 @@ my %patch_modes = ( | |||||||
| 		TARGET => '', | 		TARGET => '', | ||||||
| 		PARTICIPLE => 'staging', | 		PARTICIPLE => 'staging', | ||||||
| 		FILTER => 'file-only', | 		FILTER => 'file-only', | ||||||
|  | 		IS_REVERSE => 0, | ||||||
| 	}, | 	}, | ||||||
| 	'stash' => { | 	'stash' => { | ||||||
| 		DIFF => 'diff-index -p HEAD', | 		DIFF => 'diff-index -p HEAD', | ||||||
| @ -98,6 +99,7 @@ my %patch_modes = ( | |||||||
| 		TARGET => '', | 		TARGET => '', | ||||||
| 		PARTICIPLE => 'stashing', | 		PARTICIPLE => 'stashing', | ||||||
| 		FILTER => undef, | 		FILTER => undef, | ||||||
|  | 		IS_REVERSE => 0, | ||||||
| 	}, | 	}, | ||||||
| 	'reset_head' => { | 	'reset_head' => { | ||||||
| 		DIFF => 'diff-index -p --cached', | 		DIFF => 'diff-index -p --cached', | ||||||
| @ -107,6 +109,7 @@ my %patch_modes = ( | |||||||
| 		TARGET => '', | 		TARGET => '', | ||||||
| 		PARTICIPLE => 'unstaging', | 		PARTICIPLE => 'unstaging', | ||||||
| 		FILTER => 'index-only', | 		FILTER => 'index-only', | ||||||
|  | 		IS_REVERSE => 1, | ||||||
| 	}, | 	}, | ||||||
| 	'reset_nothead' => { | 	'reset_nothead' => { | ||||||
| 		DIFF => 'diff-index -R -p --cached', | 		DIFF => 'diff-index -R -p --cached', | ||||||
| @ -116,6 +119,7 @@ my %patch_modes = ( | |||||||
| 		TARGET => ' to index', | 		TARGET => ' to index', | ||||||
| 		PARTICIPLE => 'applying', | 		PARTICIPLE => 'applying', | ||||||
| 		FILTER => 'index-only', | 		FILTER => 'index-only', | ||||||
|  | 		IS_REVERSE => 0, | ||||||
| 	}, | 	}, | ||||||
| 	'checkout_index' => { | 	'checkout_index' => { | ||||||
| 		DIFF => 'diff-files -p', | 		DIFF => 'diff-files -p', | ||||||
| @ -125,6 +129,7 @@ my %patch_modes = ( | |||||||
| 		TARGET => ' from worktree', | 		TARGET => ' from worktree', | ||||||
| 		PARTICIPLE => 'discarding', | 		PARTICIPLE => 'discarding', | ||||||
| 		FILTER => 'file-only', | 		FILTER => 'file-only', | ||||||
|  | 		IS_REVERSE => 1, | ||||||
| 	}, | 	}, | ||||||
| 	'checkout_head' => { | 	'checkout_head' => { | ||||||
| 		DIFF => 'diff-index -p', | 		DIFF => 'diff-index -p', | ||||||
| @ -134,6 +139,7 @@ my %patch_modes = ( | |||||||
| 		TARGET => ' from index and worktree', | 		TARGET => ' from index and worktree', | ||||||
| 		PARTICIPLE => 'discarding', | 		PARTICIPLE => 'discarding', | ||||||
| 		FILTER => undef, | 		FILTER => undef, | ||||||
|  | 		IS_REVERSE => 1, | ||||||
| 	}, | 	}, | ||||||
| 	'checkout_nothead' => { | 	'checkout_nothead' => { | ||||||
| 		DIFF => 'diff-index -R -p', | 		DIFF => 'diff-index -R -p', | ||||||
| @ -143,6 +149,7 @@ my %patch_modes = ( | |||||||
| 		TARGET => ' to index and worktree', | 		TARGET => ' to index and worktree', | ||||||
| 		PARTICIPLE => 'applying', | 		PARTICIPLE => 'applying', | ||||||
| 		FILTER => undef, | 		FILTER => undef, | ||||||
|  | 		IS_REVERSE => 0, | ||||||
| 	}, | 	}, | ||||||
| ); | ); | ||||||
|  |  | ||||||
| @ -1001,10 +1008,12 @@ sub edit_hunk_manually { | |||||||
| 	print $fh "# Manual hunk edit mode -- see bottom for a quick guide\n"; | 	print $fh "# Manual hunk edit mode -- see bottom for a quick guide\n"; | ||||||
| 	print $fh @$oldtext; | 	print $fh @$oldtext; | ||||||
| 	my $participle = $patch_mode_flavour{PARTICIPLE}; | 	my $participle = $patch_mode_flavour{PARTICIPLE}; | ||||||
|  | 	my $is_reverse = $patch_mode_flavour{IS_REVERSE}; | ||||||
|  | 	my ($remove_plus, $remove_minus) = $is_reverse ? ('-', '+') : ('+', '-'); | ||||||
| 	print $fh <<EOF; | 	print $fh <<EOF; | ||||||
| # --- | # --- | ||||||
| # To remove '-' lines, make them ' ' lines (context). | # To remove '$remove_minus' lines, make them ' ' lines (context). | ||||||
| # To remove '+' lines, delete them. | # To remove '$remove_plus' lines, delete them. | ||||||
| # Lines starting with # will be removed. | # Lines starting with # will be removed. | ||||||
| # | # | ||||||
| # If the patch applies cleanly, the edited hunk will immediately be | # If the patch applies cleanly, the edited hunk will immediately be | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Junio C Hamano
					Junio C Hamano