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

Re: [PATCH v4' 1/2] gitk: do not parse " >" context as submodule change

From
Jens Lehmann <jens.lehmann@web.de>
Date
Apr 19, 2010, 17:22 UTC
Message-ID
<4BCC9164.3080301@web.de>
In-Reply-To
<671110fcac73c5fc8a935b82d88f8553c510c50c.1271694102.git.trast@student.ethz.ch>
Am 19.04.2010 18:27, schrieb Thomas Rast:
Show 5 quoted lines
>> Thanks, but now that I have applied Jens Lehmann's patch that also
>> touches this area, your patch doesn't apply.  Could you rebase it and
>> send it again?
> 
> Sure.

There might be a problem with this rebase. Unfortunately I am very short on time, so I can't test this today.

I think setting the $currdiffsubmod variable to the empty string has to show up in the two sections formatting the lines with " >" & " <".

Show 29 quoted lines
>  gitk |   18 ++++++++++--------
>  1 files changed, 10 insertions(+), 8 deletions(-)
> 
> diff --git a/gitk b/gitk
> index 1b0e09a..6513ef8 100755
> --- a/gitk
> +++ b/gitk
> @@ -7706,14 +7706,8 @@ proc getblobdiffline {bdf ids} {
>  	    } else {
>  		$ctext insert end "$line\n" filesep
>  	    }
> -	} elseif {![string compare -length 3 "  >" $line]} {
> -	    set $currdiffsubmod ""
> -	    set line [encoding convertfrom $diffencoding $line]
> -	    $ctext insert end "$line\n" dresult
> -	} elseif {![string compare -length 3 "  <" $line]} {
> -	    set $currdiffsubmod ""
> -	    set line [encoding convertfrom $diffencoding $line]
> -	    $ctext insert end "$line\n" d0
> +	    # pretend we're in a file header to correctly parse "  [><]"
> +	    set diffinhdr 1
>  	} elseif {$diffinhdr} {
>  	    if {![string compare -length 12 "rename from " $line]} {
>  		set fname [string range $line [expr 6 + [string first " from " $line] ] end]
> @@ -7732,6 +7726,14 @@ proc getblobdiffline {bdf ids} {
>  		    set fname [lindex $fname 0]
>  		}
>  		makediffhdr $fname $ids
> +	    } elseif {![string compare -length 3 "  >" $line]} {
I suspect we need a 'set $currdiffsubmod ""' here
> +		set line [encoding convertfrom $diffencoding $line]
> +		$ctext insert end "$line\n" dresult
> +		continue
> +	    } elseif {![string compare -length 3 "  <" $line]} {
and here.
Show 6 quoted lines
> +		set line [encoding convertfrom $diffencoding $line]
> +		$ctext insert end "$line\n" d0
> +		continue
>  	    } elseif {[string compare -length 3 $line "---"] == 0} {
>  		# do nothing
>  		continue
If you can wait until tomorrow I can check that.
Previous: Thomas RastNext: Jens Lehmann
Message 3 of 4 in “gitk: do not parse " >" context as submodule change”
  1. 1/2 gitk: do not parse " >" context as submodule changeThomas Rast, Apr 19, 2010
  2. 2/2 gitk: add the equivalent of diff --color-wordsThomas Rast, Apr 19, 2010
  3. Jens LehmannApr 19, 2010
  4. Jens LehmannApr 20, 2010

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.