git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Bert Wesarg <bert.wesarg@googlemail.com>
Date
Nov 30, 2010, 22:20 UTC
Message-ID
<AANLkTikd84--37+vcoHifqFeUGznEQ9YXDaY3a3zOekn@mail.gmail.com>
In-Reply-To
<AANLkTimz17vodjS7K_ts2pcoZHTo2eb9=FaWwEyhihsa@mail.gmail.com>
On Tue, Nov 30, 2010 at 22:19, Bert Wesarg <bert.wesarg@googlemail.com> wrote:
Show 12 quoted lines
> On Mon, Sep 15, 2008 at 09:08, Johannes Sixt <j.sixt@viscovery.net> 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 {}}
Previous: Bert WesargNext: Bert Wesarg
Message 11 of 15 in “Re: Git Gui does not want to work on chunk level”
  1. Alexander GladyshSep 3, 2008
  2. Shawn O. PearceSep 3, 2008
  3. Alexander GladyshSep 4, 2008
  4. Shawn O. PearceSep 4, 2008
  5. Alexander GladyshSep 4, 2008
  6. Shawn O. PearceSep 5, 2008
  7. Junio C HamanoSep 5, 2008
  8. Shawn O. PearceSep 5, 2008
  9. Johannes SixtSep 15, 2008
  10. Bert WesargNov 30, 2010
  11. Bert WesargNov 30, 2010
  12. Bert WesargDec 6, 2010
  13. Alexander GladyshSep 15, 2008
  14. Alexander GladyshSep 5, 2008
  15. Shawn O. PearceSep 15, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.