Re: Git Gui does not want to work on chunk level

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

 



On Tue, Nov 30, 2010 at 23:20, Bert Wesarg <bert.wesarg@xxxxxxxxxxxxxx> wrote:
> On Tue, Nov 30, 2010 at 22:19, Bert Wesarg <bert.wesarg@xxxxxxxxxxxxxx> wrote:
>> On Mon, Sep 15, 2008 at 09:08, Johannes Sixt <j.sixt@xxxxxxxxxxxxx> wrote:
>>> Ânew file mode 100644
>>> Â--- /dev/null
>>> Â+++ b/foo
>>> Â@@ -0,0 +1 @@
>>> Â+foo
>>
>> I just noticed the same, and ask me why this report wasn't honored.
>>
>> Also git may spill out 2 diffs for type changes (file to symlink, for
>> example). In this case the we should probably disable any hunk- or
>> line-level (un)staging.
>
> Here is a proposal which fixes this case. Not tested on the OPs report.
>
> --8<--
> diff --git a/lib/diff.tcl b/lib/diff.tcl
> index 8fea947..b3901c3 100644
> --- a/lib/diff.tcl
> +++ b/lib/diff.tcl
> @@ -398,7 +398,6 @@ proc read_diff {fd conflict_size cont_info} {
> Â Â Â Â Â Â Â Âif {$line eq {deleted file mode 120000}} {
> Â Â Â Â Â Â Â Â Â Â Â Âset line "deleted symlink"
> Â Â Â Â Â Â Â Â}
> - Â Â Â Â Â Â Â set ::current_diff_inheader 0
>
> Â Â Â Â Â Â Â Â# -- Automatically detect if this is a 3 way diff.
> Â Â Â Â Â Â Â Â#
> @@ -414,6 +413,7 @@ proc read_diff {fd conflict_size cont_info} {
> Â Â Â Â Â Â Â Â Â Â Â Â|| [regexp {^\* Unmerged path } $line]} {
> Â Â Â Â Â Â Â Â Â Â Â Âset tags {}
> Â Â Â Â Â Â Â Â} elseif {$is_3way_diff} {
> + Â Â Â Â Â Â Â Â Â Â Â set ::current_diff_inheader 0
> Â Â Â Â Â Â Â Â Â Â Â Âset op [string range $line 0 1]
> Â Â Â Â Â Â Â Â Â Â Â Âswitch -- $op {
> Â Â Â Â Â Â Â Â Â Â Â Â{ Â} {set tags {}}
> @@ -440,6 +440,7 @@ proc read_diff {fd conflict_size cont_info} {
> Â Â Â Â Â Â Â Â Â Â Â Â}
> Â Â Â Â Â Â Â Â Â Â Â Â}
> Â Â Â Â Â Â Â Â} elseif {$is_submodule_diff} {
> + Â Â Â Â Â Â Â Â Â Â Â set ::current_diff_inheader 0
> Â Â Â Â Â Â Â Â Â Â Â Âif {$line == ""} continue
> Â Â Â Â Â Â Â Â Â Â Â Âif {[regexp {^Submodule } $line]} {
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âset tags d_@
> @@ -459,6 +460,7 @@ proc read_diff {fd conflict_size cont_info} {
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â}
> Â Â Â Â Â Â Â Â Â Â Â Â}
> Â Â Â Â Â Â Â Â} else {
> + Â Â Â Â Â Â Â Â Â Â Â set ::current_diff_inheader 0
> Â Â Â Â Â Â Â Â Â Â Â Âset op [string index $line 0]
> Â Â Â Â Â Â Â Â Â Â Â Âswitch -- $op {
> Â Â Â Â Â Â Â Â Â Â Â Â{ } {set tags {}}
>

Please ignore this proposal. I have a better solution in the pipe
(which solves both problems reported here).

Bert
ÿô.nlj·Ÿ®‰­†+%ŠË±é¥Šwÿº{.nlj· ŠßžØn‡r¡öë¨è&£ûz¹Þúzf£¢·hšˆ§~†­†Ûÿÿïÿ‘ê_èæ+v‰¨þ)ßø

[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]