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 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 {}}
--
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]