Closed bitjo closed 4 years ago
Which version of Git for Windows are you using? 32-bit or 64-bit? Include the output of git version as well.
$ uname MINGW64_NT-6.1
That is not the git version.
In any case, I think this may be fixed in the meantime, as I could not reproduce it with v2.11.1.
The issue isn't fiexed:
$ git clone https://github.com/bitjo/git-issue1
$ cd git-issue1/
$ gitk
gitk screenshot, note red text:
Version infos:
user@ADMIX MINGW64 /t/tmp/git-issue1 (master)
$ uname -a
MINGW64_NT-6.1 ADMIX 2.6.1(0.306/5/3) 2017-01-20 15:23 x86_64 Msys
user@ADMIX MINGW64 /t/tmp/git-issue1 (master)
$ git version
git version 2.11.1.windows.1
An expected screenshot:
This is how it looks here:
@dscho
You have to click on 'Tag1' to see the malformed output (don't click on branch or commit summary).
This bug is related to #761.
There is a basic problem with the endcoding in Git Gui / Gitk on Windows. It's probably easy to solve by a TcL / TK expert.
I'm not that expert, but I know that this bug, #761. and more unpublished bugs have the same cause.
BTW @dscho
I do not know github well.
What do I need to do to make my images look inline?
I had a look at the repo. Cloned as instructed.
Here are screen shots of gitk
with Tag1
(yellow) clicked - note that the 'Tagger' (lower left) is poorly formed.
Also note gitk
has no font encoding preference (git gui
does).
Now here is the same in the mintty window (I keep bash separate from cmd, and it's an XP netbook - still works!!)
git cat-file -p Tag1
(took me a bit to get the right tag foo invocation!)
See that the tagger name is correctly formed here. So problem [gitk fails to render tagger names correctly] repeated!
Just need some spare time to look at gitk's code.
For inserting the images see the line just below the writing pane "Attach files by dragging & dropping, selecting them, or pasting from the clipboard. " I did the Alt-PrtScn snapshot and dropped it into paint then saved as a png, before using the select.
(For inserting the images ... I had linked to the Github pages containing the image. This is bad. I need to link to the URL of the image.)
https://github.com/git/git/blob/master/gitk-git/gitk#L11262-L11277
proc add_tag_ctext {tag} {
global ctext cached_tagcontent tagids
if {![info exists cached_tagcontent($tag)]} {
catch {
set cached_tagcontent($tag) [exec git cat-file -p $tag]
}
}
$ctext insert end "[mc "Tag"]: $tag\n" bold
if {[info exists cached_tagcontent($tag)]} {
set text $cached_tagcontent($tag)
} else {
set text "[mc "Id"]: $tagids($tag)"
}
appendwithlinks $text {}
}
The two lines set cached_tagcontent($tag) [exec git cat-file -p $tag]
and set text $cached_tagcontent($tag)
look to be the part that accesses the tag and gets its text.
Not sure yet about how the equivalent commit text info is aquired for dispay in the same window, which may show how to do the displaying right (or at least how to tweak stuff).
The regular commit display starts at https://github.com/git/git/blob/master/gitk-git/gitk#L7261
proc selectline {l isnew {desired_loc {}} {switch_to_patch 0}} {
(found by searching for the "Follow" line (L7392) that is added in the display.
We then see the author at https://github.com/git/git/blob/master/gitk-git/gitk#L7348 $ctext insert end "[mc "Author"]: [lindex $info 1] $date\n"
So now search for how $info
was generated.
try https://github.com/git/git/blob/master/gitk-git/gitk#L7343-L7346 to see its loaded via getcommit($id)
https://github.com/git/git/blob/master/gitk-git/gitk#L1736 proc getcommit {id} {
bed time. time for someone else to pick up the thread...
A bit more Yak-shaving on this.
Intersting point of note: the info exists commitdata($id)
and the [lindex $info 1]
are completely different uses of info
.
There is a Tcl command called info
, with subcommand exists
that will tell you if a variable exists, so you can see if you need to create or set it. http://wiki.tcl.tk/1185
Meanwhile parts of the gitk code also create a variable called info
which has higher priority in the local scope and would then hide the info
command (because tcl is interpreted...). Thankfully the info
variable is tightly scoped but it's something to look out for.
Back to the https://github.com/git/git/blob/master/gitk-git/gitk#L1736 proc getcommit {id}
This either parsecommit
a commit it knows, or readcommit
(with post parsing) for ones it doesn't know
https://github.com/git/git/blob/master/gitk-git/gitk#L1671-L1698 proc parsecommit
(there is more after that range)
At lines https://github.com/git/git/blob/master/gitk-git/gitk#L1686-L1687 of parsecommit
we see that the header
and comment
parts of the commit object are set.
They both use the string
command keyword. Maybe this is it. Didn't notice a string
keyword for the tag message (https://github.com/git/git/blob/master/gitk-git/gitk#L11272).
Need to double check the string
command, and the appendwithlinks $text {}
https://github.com/git/git/blob/master/gitk-git/gitk#L11272 in the tag processing.
In http://wiki.tcl.tk/1500 section Using string functions for binary data it says:
The following subcommands force promotion to unicode strings:
string first
string last
string map
string replace
string reverse
-- Try http://wiki.tcl.tk/_//search?submit=Search&S=ByteArray+UTF&_charset_=UTF-8 to review what they do internally to hide the encoding issues of Everything is a string
Did a quick try at wrapping the line that gets the tag data set cached_tagcontent($tag) [exec git cat-file -p $tag]
with a [string range <str> 0 end]
but no luck.
So, Back to the other side of the commit data. the `do_readcommit procedure. And, lo and behold, it has loads of stuff on encoding.
Looked at the code that reads the commit data git log --no-color --pretty=raw -1
and tried to find a revision notation git help revisions
here for the tag itself, but no luck there.
So it has to be the special git cat-file -p Tag1
format` hence we'll need to repeat the do_readcommit logic, or at least pass in the base command string !
two commits at https://github.com/PhilipOakley/gitk/tree/tagger on top of the master I had.
Took a bit to get the second inovcation right. needed to drop the { }
brackets in the set contents [do_readgitcmd $tag $basecmd]
.
@bitjo you seemed interested in this issue. I will reopen, expecting you to brush up @PhilipOakley's patches and open a clean and polished Pull Request.
I will reopen, expecting you to brush up @PhilipOakley's patches and open a clean and polished Pull Request.
@bitjo ping.
@bitjo happy new year. And ping. You wanted this, right?
I guess not.
@dscho (Sorry to English readers: I just write German, because @scho understands it and I wanted to save time. DL; DR: I do not have time to submit the patch.)
Ich schaffe es zeitlich nicht, weil dieses Ticket für mich keine hohe Priorität hat.
Der Patch von @PhilipOakley funktionierte bei mir mir lokal.
Um den Patch als Pull Request einzureichen, fehlt mir aber die Zeit. Ich müsste mich mit der der Art und Weise der Einreichung und den geforderten Richtlinien zur Qualität im Projekt auseinandersetzen. Dazu fehlt mir aber derzeit die Zeit.
Ich bitte um Verzeihung, dass ich hier nicht aktiv werde. Aber ich sehe es schon als guten Beitrag an, dass ich das Ticket überhaupt geöffnet habe.
Aus meiner Sicht ist #761 viel bedeutender, da dort nicht nur in git gui/gitk etwas falsch dargestellt wird, sondern das Repo falsch geändert wird.
@PhilipOakley do you have the time to brush up those commits? If not, I suggest to just close this ticket (if it was important enough, somebody would have found the time to address this).
Hi @dscho At the moment I'm a bit thin on time. I may get more time from 2019, assuming retirement goes well...
The priority on this one is probably elsewhere as there is still no maintainer/curator for the git-gui/gitk repos anyway.
Were there any changes that needed brushing up on anyway? Or was it just a case of re-validation?
Setup
git version
as well.defaults
no
Details
tty/bash
After click on Tag1 in gitk I should see:
gitk shows:
The taggers name in line 5 (Groß) is not correctly (Groß).
see above: https://github.com/bitjo/git-issue1