Re: [PATCH 2/2] git-gui: fix applying line/ranges when the selection ends at the begin of a line

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 9, 2012 at 14:43, Bert Wesarg <bert.wesarg@xxxxxxxxxxxxxx> wrote:
> Selecting also the trailing newline of a line for staging/unstaging would
> have resulted in also staging/unstaging of the next line.

The fix is not complete, this logic should only be applied if we have
actually a range. I will send a replacement patch in the coming days.

Bert

>
> Signed-off-by: Bert Wesarg <bert.wesarg@xxxxxxxxxxxxxx>
> ---
>  lib/diff.tcl |    8 +++++++-
>  1 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/lib/diff.tcl b/lib/diff.tcl
> index 63f8742..a750ea7 100644
> --- a/lib/diff.tcl
> +++ b/lib/diff.tcl
> @@ -632,7 +632,13 @@ proc apply_range_or_line {x y} {
>        }
>
>        set first_l [$ui_diff index "$first linestart"]
> -       set last_l [$ui_diff index "$last lineend"]
> +       # don't include the next line if $last points to the start of a line
> +       # ie. <lno>.0
> +       if {[lindex [split $last .] 1] == 0} {
> +               set last_l [$ui_diff index "$last -1 line lineend"]
> +       } else {
> +               set last_l [$ui_diff index "$last lineend"]
> +       }
>
>        if {$current_diff_path eq {} || $current_diff_header eq {}} return
>        if {![lock_index apply_hunk]} return
> --
> 1.7.8.1.873.gfea665
>
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]