From: Junio C Hamano Date: Thu, 9 Dec 2010 18:36:47 +0000 (-0800) Subject: Merge branch 'jl/add-p-reverse-message' into maint X-Git-Tag: v1.7.3.4~23 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/11cf80dc700ce79c87ff70e615aefbbe7f28af5b?ds=inline;hp=-c Merge branch 'jl/add-p-reverse-message' into maint * jl/add-p-reverse-message: Correct help blurb in checkout -p and friends --- 11cf80dc700ce79c87ff70e615aefbbe7f28af5b diff --combined git-add--interactive.perl index 77f60fa396,406beb5c50..a329c5a1f8 --- a/git-add--interactive.perl +++ b/git-add--interactive.perl @@@ -1,8 -1,6 +1,8 @@@ -#!/usr/bin/perl -w +#!/usr/bin/perl +use 5.008; use strict; +use warnings; use Git; binmode(STDOUT, ":raw"); @@@ -89,6 -87,7 +89,7 @@@ my %patch_modes = TARGET => '', PARTICIPLE => 'staging', FILTER => 'file-only', + IS_REVERSE => 0, }, 'stash' => { DIFF => 'diff-index -p HEAD', @@@ -98,6 -97,7 +99,7 @@@ TARGET => '', PARTICIPLE => 'stashing', FILTER => undef, + IS_REVERSE => 0, }, 'reset_head' => { DIFF => 'diff-index -p --cached', @@@ -107,6 -107,7 +109,7 @@@ TARGET => '', PARTICIPLE => 'unstaging', FILTER => 'index-only', + IS_REVERSE => 1, }, 'reset_nothead' => { DIFF => 'diff-index -R -p --cached', @@@ -116,6 -117,7 +119,7 @@@ TARGET => ' to index', PARTICIPLE => 'applying', FILTER => 'index-only', + IS_REVERSE => 0, }, 'checkout_index' => { DIFF => 'diff-files -p', @@@ -125,6 -127,7 +129,7 @@@ TARGET => ' from worktree', PARTICIPLE => 'discarding', FILTER => 'file-only', + IS_REVERSE => 1, }, 'checkout_head' => { DIFF => 'diff-index -p', @@@ -134,6 -137,7 +139,7 @@@ TARGET => ' from index and worktree', PARTICIPLE => 'discarding', FILTER => undef, + IS_REVERSE => 1, }, 'checkout_nothead' => { DIFF => 'diff-index -R -p', @@@ -143,6 -147,7 +149,7 @@@ TARGET => ' to index and worktree', PARTICIPLE => 'applying', FILTER => undef, + IS_REVERSE => 0, }, ); @@@ -1001,10 -1006,12 +1008,12 @@@ sub edit_hunk_manually print $fh "# Manual hunk edit mode -- see bottom for a quick guide\n"; print $fh @$oldtext; my $participle = $patch_mode_flavour{PARTICIPLE}; + my $is_reverse = $patch_mode_flavour{IS_REVERSE}; + my ($remove_plus, $remove_minus) = $is_reverse ? ('-', '+') : ('+', '-'); print $fh <