threads / patch / 31067

patchgitk: Use an external icon file on Windows

Subject: [PATCH] gitk: Use an external icon file on Windows

## tl;dr

7 messages between Jul 22, 2012 and Aug 9, 2012. Diffs are folded; open one to read it.

replies: 6people: 2as markdown or json

Sebastian Schuberth· Jul 22, 2012, 21:29 UTC · lore

Git for Windows now ships with the new Git icon from git-scm.com. Use that icon file instead of the old procedurally drawn one.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
---
 gitk-git/gitk | 49 ++++++++++++++++++++++++++-----------------------
 1 file changed, 26 insertions(+), 23 deletions(-)
Show changes to gitk-git/gitk +26 −23
diff --git a/gitk-git/gitk b/gitk-git/gitk
index 59693c0..bf2492e 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -11664,7 +11664,6 @@ if { [info exists ::env(GITK_MSGSDIR)] } {
     set gitk_prefix [file dirname [file dirname [file normalize $argv0]]]
     set gitk_libdir [file join $gitk_prefix share gitk lib]
     set gitk_msgsdir [file join $gitk_libdir msgs]
-    unset gitk_prefix
 }
 
 ## Internationalization (i18n) through msgcat and gettext. See
@@ -11821,28 +11820,32 @@ if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} {
 set worktree [exec git rev-parse --show-toplevel]
 setcoords
 makewindow
-catch {
-    image create photo gitlogo      -width 16 -height 16
-
-    image create photo gitlogominus -width  4 -height  2
-    gitlogominus put #C00000 -to 0 0 4 2
-    gitlogo copy gitlogominus -to  1 5
-    gitlogo copy gitlogominus -to  6 5
-    gitlogo copy gitlogominus -to 11 5
-    image delete gitlogominus
-
-    image create photo gitlogoplus  -width  4 -height  4
-    gitlogoplus  put #008000 -to 1 0 3 4
-    gitlogoplus  put #008000 -to 0 1 4 3
-    gitlogo copy gitlogoplus  -to  1 9
-    gitlogo copy gitlogoplus  -to  6 9
-    gitlogo copy gitlogoplus  -to 11 9
-    image delete gitlogoplus
-
-    image create photo gitlogo32    -width 32 -height 32
-    gitlogo32 copy gitlogo -zoom 2 2
-
-    wm iconphoto . -default gitlogo gitlogo32
+if {$::tcl_platform(platform) eq {windows}} {
+    wm iconbitmap . -default $gitk_prefix/etc/git.ico
+} else {
+    catch {
+        image create photo gitlogo      -width 16 -height 16
+
+        image create photo gitlogominus -width  4 -height  2
+        gitlogominus put #C00000 -to 0 0 4 2
+        gitlogo copy gitlogominus -to  1 5
+        gitlogo copy gitlogominus -to  6 5
+        gitlogo copy gitlogominus -to 11 5
+        image delete gitlogominus
+
+        image create photo gitlogoplus  -width  4 -height  4
+        gitlogoplus  put #008000 -to 1 0 3 4
+        gitlogoplus  put #008000 -to 0 1 4 3
+        gitlogo copy gitlogoplus  -to  1 9
+        gitlogo copy gitlogoplus  -to  6 9
+        gitlogo copy gitlogoplus  -to 11 9
+        image delete gitlogoplus
+
+        image create photo gitlogo32    -width 32 -height 32
+        gitlogo32 copy gitlogo -zoom 2 2
+
+        wm iconphoto . -default gitlogo gitlogo32
+    }
 }
 # wait for the window to become visible
 tkwait visibility .
-- 
1.7.11.msysgit.2
Sebastian Schuberth· Jul 23, 2012, 06:28 UTC · re: Sebastian Schuberth · lore

[PATCH v2] gitk: Use an external icon file on Windows

Git for Windows now ships with the new Git icon from git-scm.com. Use that icon file instead of the old procedurally drawn one if it exists.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
---
 gitk-git/gitk | 49 ++++++++++++++++++++++++++-----------------------
 1 file changed, 26 insertions(+), 23 deletions(-)
Show changes to gitk-git/gitk +26 −23
diff --git a/gitk-git/gitk b/gitk-git/gitk
index 59693c0..5127e55 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -11664,7 +11664,6 @@ if { [info exists ::env(GITK_MSGSDIR)] } {
     set gitk_prefix [file dirname [file dirname [file normalize $argv0]]]
     set gitk_libdir [file join $gitk_prefix share gitk lib]
     set gitk_msgsdir [file join $gitk_libdir msgs]
-    unset gitk_prefix
 }
 
 ## Internationalization (i18n) through msgcat and gettext. See
@@ -11821,28 +11820,32 @@ if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} {
 set worktree [exec git rev-parse --show-toplevel]
 setcoords
 makewindow
-catch {
-    image create photo gitlogo      -width 16 -height 16
-
-    image create photo gitlogominus -width  4 -height  2
-    gitlogominus put #C00000 -to 0 0 4 2
-    gitlogo copy gitlogominus -to  1 5
-    gitlogo copy gitlogominus -to  6 5
-    gitlogo copy gitlogominus -to 11 5
-    image delete gitlogominus
-
-    image create photo gitlogoplus  -width  4 -height  4
-    gitlogoplus  put #008000 -to 1 0 3 4
-    gitlogoplus  put #008000 -to 0 1 4 3
-    gitlogo copy gitlogoplus  -to  1 9
-    gitlogo copy gitlogoplus  -to  6 9
-    gitlogo copy gitlogoplus  -to 11 9
-    image delete gitlogoplus
-
-    image create photo gitlogo32    -width 32 -height 32
-    gitlogo32 copy gitlogo -zoom 2 2
-
-    wm iconphoto . -default gitlogo gitlogo32
+if {$::tcl_platform(platform) eq {windows} && [file exists $gitk_prefix/etc/git.ico]} {
+    wm iconbitmap . -default $gitk_prefix/etc/git.ico
+} else {
+    catch {
+        image create photo gitlogo      -width 16 -height 16
+
+        image create photo gitlogominus -width  4 -height  2
+        gitlogominus put #C00000 -to 0 0 4 2
+        gitlogo copy gitlogominus -to  1 5
+        gitlogo copy gitlogominus -to  6 5
+        gitlogo copy gitlogominus -to 11 5
+        image delete gitlogominus
+
+        image create photo gitlogoplus  -width  4 -height  4
+        gitlogoplus  put #008000 -to 1 0 3 4
+        gitlogoplus  put #008000 -to 0 1 4 3
+        gitlogo copy gitlogoplus  -to  1 9
+        gitlogo copy gitlogoplus  -to  6 9
+        gitlogo copy gitlogoplus  -to 11 9
+        image delete gitlogoplus
+
+        image create photo gitlogo32    -width 32 -height 32
+        gitlogo32 copy gitlogo -zoom 2 2
+
+        wm iconphoto . -default gitlogo gitlogo32
+    }
 }
 # wait for the window to become visible
 tkwait visibility .
-- 
1.7.11.msysgit.2
Sebastian Schuberth· Aug 8, 2012, 20:37 UTC · re: Sebastian Schuberth · lore

[PATCH v2 resend] gitk: Use an external icon file on Windows

Git for Windows now ships with the new Git icon from git-scm.com. Use that icon file instead of the old procedurally drawn one if it exists.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
---
 gitk-git/gitk | 49 ++++++++++++++++++++++++++-----------------------
 1 file changed, 26 insertions(+), 23 deletions(-)
Show changes to gitk-git/gitk +26 −23
diff --git a/gitk-git/gitk b/gitk-git/gitk
index 59693c0..5127e55 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -11664,7 +11664,6 @@ if { [info exists ::env(GITK_MSGSDIR)] } {
     set gitk_prefix [file dirname [file dirname [file normalize $argv0]]]
     set gitk_libdir [file join $gitk_prefix share gitk lib]
     set gitk_msgsdir [file join $gitk_libdir msgs]
-    unset gitk_prefix
 }
 
 ## Internationalization (i18n) through msgcat and gettext. See
@@ -11821,28 +11820,32 @@ if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} {
 set worktree [exec git rev-parse --show-toplevel]
 setcoords
 makewindow
-catch {
-    image create photo gitlogo      -width 16 -height 16
-
-    image create photo gitlogominus -width  4 -height  2
-    gitlogominus put #C00000 -to 0 0 4 2
-    gitlogo copy gitlogominus -to  1 5
-    gitlogo copy gitlogominus -to  6 5
-    gitlogo copy gitlogominus -to 11 5
-    image delete gitlogominus
-
-    image create photo gitlogoplus  -width  4 -height  4
-    gitlogoplus  put #008000 -to 1 0 3 4
-    gitlogoplus  put #008000 -to 0 1 4 3
-    gitlogo copy gitlogoplus  -to  1 9
-    gitlogo copy gitlogoplus  -to  6 9
-    gitlogo copy gitlogoplus  -to 11 9
-    image delete gitlogoplus
-
-    image create photo gitlogo32    -width 32 -height 32
-    gitlogo32 copy gitlogo -zoom 2 2
-
-    wm iconphoto . -default gitlogo gitlogo32
+if {$::tcl_platform(platform) eq {windows} && [file exists $gitk_prefix/etc/git.ico]} {
+    wm iconbitmap . -default $gitk_prefix/etc/git.ico
+} else {
+    catch {
+        image create photo gitlogo      -width 16 -height 16
+
+        image create photo gitlogominus -width  4 -height  2
+        gitlogominus put #C00000 -to 0 0 4 2
+        gitlogo copy gitlogominus -to  1 5
+        gitlogo copy gitlogominus -to  6 5
+        gitlogo copy gitlogominus -to 11 5
+        image delete gitlogominus
+
+        image create photo gitlogoplus  -width  4 -height  4
+        gitlogoplus  put #008000 -to 1 0 3 4
+        gitlogoplus  put #008000 -to 0 1 4 3
+        gitlogo copy gitlogoplus  -to  1 9
+        gitlogo copy gitlogoplus  -to  6 9
+        gitlogo copy gitlogoplus  -to 11 9
+        image delete gitlogoplus
+
+        image create photo gitlogo32    -width 32 -height 32
+        gitlogo32 copy gitlogo -zoom 2 2
+
+        wm iconphoto . -default gitlogo gitlogo32
+    }
 }
 # wait for the window to become visible
 tkwait visibility .
-- 
1.7.11.msysgit.2
Junio C Hamano· Aug 8, 2012, 21:13 UTC · re: Sebastian Schuberth · lore

Re: [PATCH v2 resend] gitk: Use an external icon file on Windows

Sebastian Schuberth <sschuberth@gmail.com> writes:
Show 5 quoted lines
> Git for Windows now ships with the new Git icon from git-scm.com. Use that
> icon file instead of the old procedurally drawn one if it exists.
>
> Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
> ---

Forwarding a misdirected patch to the maintainer who is free to pick or ignore.

Personally I am negative on it (nobody on the list asked for the "new" Git icon as far as I recall), but my voice on this counts just as little as others.

Thanks.
Show 70 quoted lines
>  gitk-git/gitk | 49 ++++++++++++++++++++++++++-----------------------
>  1 file changed, 26 insertions(+), 23 deletions(-)
>
> diff --git a/gitk-git/gitk b/gitk-git/gitk
> index 59693c0..5127e55 100755
> --- a/gitk-git/gitk
> +++ b/gitk-git/gitk
> @@ -11664,7 +11664,6 @@ if { [info exists ::env(GITK_MSGSDIR)] } {
>      set gitk_prefix [file dirname [file dirname [file normalize $argv0]]]
>      set gitk_libdir [file join $gitk_prefix share gitk lib]
>      set gitk_msgsdir [file join $gitk_libdir msgs]
> -    unset gitk_prefix
>  }
>  
>  ## Internationalization (i18n) through msgcat and gettext. See
> @@ -11821,28 +11820,32 @@ if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} {
>  set worktree [exec git rev-parse --show-toplevel]
>  setcoords
>  makewindow
> -catch {
> -    image create photo gitlogo      -width 16 -height 16
> -
> -    image create photo gitlogominus -width  4 -height  2
> -    gitlogominus put #C00000 -to 0 0 4 2
> -    gitlogo copy gitlogominus -to  1 5
> -    gitlogo copy gitlogominus -to  6 5
> -    gitlogo copy gitlogominus -to 11 5
> -    image delete gitlogominus
> -
> -    image create photo gitlogoplus  -width  4 -height  4
> -    gitlogoplus  put #008000 -to 1 0 3 4
> -    gitlogoplus  put #008000 -to 0 1 4 3
> -    gitlogo copy gitlogoplus  -to  1 9
> -    gitlogo copy gitlogoplus  -to  6 9
> -    gitlogo copy gitlogoplus  -to 11 9
> -    image delete gitlogoplus
> -
> -    image create photo gitlogo32    -width 32 -height 32
> -    gitlogo32 copy gitlogo -zoom 2 2
> -
> -    wm iconphoto . -default gitlogo gitlogo32
> +if {$::tcl_platform(platform) eq {windows} && [file exists $gitk_prefix/etc/git.ico]} {
> +    wm iconbitmap . -default $gitk_prefix/etc/git.ico
> +} else {
> +    catch {
> +        image create photo gitlogo      -width 16 -height 16
> +
> +        image create photo gitlogominus -width  4 -height  2
> +        gitlogominus put #C00000 -to 0 0 4 2
> +        gitlogo copy gitlogominus -to  1 5
> +        gitlogo copy gitlogominus -to  6 5
> +        gitlogo copy gitlogominus -to 11 5
> +        image delete gitlogominus
> +
> +        image create photo gitlogoplus  -width  4 -height  4
> +        gitlogoplus  put #008000 -to 1 0 3 4
> +        gitlogoplus  put #008000 -to 0 1 4 3
> +        gitlogo copy gitlogoplus  -to  1 9
> +        gitlogo copy gitlogoplus  -to  6 9
> +        gitlogo copy gitlogoplus  -to 11 9
> +        image delete gitlogoplus
> +
> +        image create photo gitlogo32    -width 32 -height 32
> +        gitlogo32 copy gitlogo -zoom 2 2
> +
> +        wm iconphoto . -default gitlogo gitlogo32
> +    }
>  }
>  # wait for the window to become visible
>  tkwait visibility .
Sebastian Schuberth· Aug 9, 2012, 06:54 UTC · re: Junio C Hamano · lore

Re: [PATCH v2 resend] gitk: Use an external icon file on Windows

On Wed, Aug 8, 2012 at 11:13 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Forwarding a misdirected patch to the maintainer who is free to pick
> or ignore.

How am I supposed to know if a patch has been ignored as an oversight (in which case I would resend), or because the maintainer decided not to include it (in which case I would not resend in order to not annoy the maintainer)?

> Personally I am negative on it (nobody on the list asked for the
> "new" Git icon as far as I recall), but my voice on this counts just
> as little as others.

I guess most patches on the list come in unasked, so I cannot follow your negative attitude because of this. Also, the patch does not enforce the new icon on any platform. From a user's perspective, [1] as mentioned on [2] is the official Git homepage, thus the icon used on the homepage can be regarded as the official Git icon. In Git for Windows, we try to have a consistent user experience, and we had a report about gitk still using the "old" icon [3]. This patch fixes that, and I'm sending it upstream in an effort to not let msysgit's fork of git diverge too much from upstream.

[1] http://git-scm.com/ [2] http://en.wikipedia.org/wiki/Git_%28software%29#External_links [3] https://github.com/msysgit/msysgit/issues/44

-- 
Sebastian Schuberth
Junio C Hamano· Aug 9, 2012, 15:54 UTC · re: Sebastian Schuberth · lore

Re: [PATCH v2 resend] gitk: Use an external icon file on Windows

Sebastian Schuberth <sschuberth@gmail.com> writes:
Show 9 quoted lines
> On Wed, Aug 8, 2012 at 11:13 PM, Junio C Hamano <gitster@pobox.com> wrote:
>
>> Forwarding a misdirected patch to the maintainer who is free to pick
>> or ignore.
>
> How am I supposed to know if a patch has been ignored as an oversight
> (in which case I would resend), or because the maintainer decided not
> to include it (in which case I would not resend in order to not annoy
> the maintainer)?
By hearing from Paul (or asking directly), perhaps?
Show 6 quoted lines
>> Personally I am negative on it (nobody on the list asked for the
>> "new" Git icon as far as I recall), but my voice on this counts just
>> as little as others.
>
> I guess most patches on the list come in unasked, so I cannot follow
> your negative attitude because of this.

Many patches do come after a thread of discussion, and at the end of such a discussion I do not often explicitly ask "yeah, that sounds like a good way to go, please make it so", so technically it is correct that many patches come unasked, but my "nobody asked for" was not about your patch. It was about the "new logo".

  Cf. http://thread.gmane.org/gmane.comp.version-control.git/197082

The site may be called "official", but Scott exercises fairly large amount of editorial discretion without community input on occasions, and because he is such a nice guy, we let some questionable things go from time to time. Some things on that site are not always the community concensus, not necessarily in the sense that Scott decided against community concensus but in the sense that the community did not feel a need to even have a concensus and Scott chose to go one way. The new logo is one of these things. Some in the community may not be enthusiastic about it and prefer the original, but they do not feel strongly enough to send in patches and gather the community support to "fix" it.

And that goes both ways. If the logo of the "official" site is not something so important that git-scm.com can change without gaining community consensus first, then it equally is within the editorial discretion of individual git package's maintainer to keep using the original not the updated logo.

Sebastian Schuberth· Aug 9, 2012, 16:13 UTC · re: Junio C Hamano · lore

Re: [PATCH v2 resend] gitk: Use an external icon file on Windows

On Thu, Aug 9, 2012 at 5:54 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 9 quoted lines
>>> Forwarding a misdirected patch to the maintainer who is free to pick
>>> or ignore.
>>
>> How am I supposed to know if a patch has been ignored as an oversight
>> (in which case I would resend), or because the maintainer decided not
>> to include it (in which case I would not resend in order to not annoy
>> the maintainer)?
>
> By hearing from Paul (or asking directly), perhaps?

I did that, in a private mail due to some temporary mailing list problems, but did not get an answer. So my question was referring to Paul. How I should know whether Paul ignores my patch due to an oversight, or because he is not interested? And because of this ambiguity in ignoring a patch I think an explicit NACK should be mandatory if a maintainer is not interested in a patch.

Show 5 quoted lines
> And that goes both ways.  If the logo of the "official" site is not
> something so important that git-scm.com can change without gaining
> community consensus first, then it equally is within the editorial
> discretion of individual git package's maintainer to keep using the
> original not the updated logo.

I admit that I was assuming community consensus on the new logo exactly *because* I saw it on git-scm.com. On the other hand, from my experience the Git community is not exactly one where is it particularly easy to get consensus on something, so I completely understand and support Scott's habit to sometimes go one way without consulting the community first.

Anyway, I'll include the patch into Git for Windows, because that's what our users ask for.

-- 
Sebastian Schuberth

← back to recent threads