Git development
 help / color / mirror / Atom feed
* counting the number of connections?
From: Tay Ray Chuan @ 2009-02-28  6:44 UTC (permalink / raw)
  To: git

Hi,

some time ago I noticed curl doesn't remember your credentials (apart
from those it can get from ~/.netrc), and very recently there was an
thread on repeated prompting for credentials while pushing to https.

I've written a simple patch series, which allows git to play nice
without curl_multi. That is, git uses a single persistent connection
throughout.

However, I'm at a loss at how to test for this. How does one count the
number of connections made during the lifespan of a program's
execution? So far, I've been relying on my firewall log (Comodo on
windows). Perhaps there a more operating system/software-agnostic
method to do this?

-- 
Cheers,
Ray Chuan

^ permalink raw reply

* Re: [PATCH 0/3] git remote: set-head and new show output (UPDATED)
From: Jeff King @ 2009-02-28  6:33 UTC (permalink / raw)
  To: Jay Soffian; +Cc: git, Junio C Hamano
In-Reply-To: <cover.1235759631.git.jaysoffian@gmail.com>

On Fri, Feb 27, 2009 at 02:10:03PM -0500, Jay Soffian wrote:

> I didn't want to resend the whole series (gmane 111394), so what I did was
> create a new patch which comes after patch 7 in that series. Call it patch 7a.
> The rest of that series is then identical (modulo line number offsets in
> patches touching remote.c) except for patches 8 and 19. Patches 7a, and the
> new 8 and 19 follow this email.

These look good to me.

-Peff

^ permalink raw reply

* Re: [PATCH 3/4] diffcore-pickaxe: further refactor count_match()
From: Junio C Hamano @ 2009-02-28  6:08 UTC (permalink / raw)
  To: René Scharfe; +Cc: git
In-Reply-To: <7vy6vrgxnn.fsf@gitster.siamese.dyndns.org>

Junio C Hamano <gitster@pobox.com> writes:

> René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:
> ...
>> In any case, there is also memmem(), which uses the same fast algorithm
>> as strstr() in recent glibc versions.  Like this?
>
> Thanks; it would be nice to bench this change.

With memmem() patch applied on top of [1-4/4], the same test as described
in the commit log message of [4/4] which was:

    $ STRING='Ensure that the real time constraints are schedulable.'
    $ git log -S"$STRING" HEAD -- kernel/sched.c >/dev/null

    (Before the patch, best of 5 runs)
    5.59user 0.15system 0:05.74elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
    0inputs+0outputs (0major+39956minor)pagefaults 0swaps

    (After the patch, best of 5 runs)
    3.04user 0.17system 0:03.23elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
    0inputs+0outputs (0major+49697minor)pagefaults 0swaps

    The file "kernel/sched.c" has roughly 900 changes applied to it, and over
    its lifetime, it has grown from 5kB to 9kB in size.  I'd expect a larger
    file may see a bigger performance boost.

(With memmem() patch, best of 5 runs)
2.46user 0.15system 0:02.62elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+49698minor)pagefaults 0swaps

^ permalink raw reply

* Re: git-svn woes
From: Junio C Hamano @ 2009-02-28  5:54 UTC (permalink / raw)
  To: Eric Wong; +Cc: Nicolas Pitre, git, Deskin Miller
In-Reply-To: <20090228040949.GA13863@dcvr.yhbt.net>

Eric Wong <normalperson@yhbt.net> writes:

> Junio C Hamano <gitster@pobox.com> wrote:
>> Eric Wong <normalperson@yhbt.net> writes:
>> 
>> > I've been poking around at this for a bit, I am pretty confused
>> > by this, too.  It's been a rough week, so I could be missing
>> > something obvious...
>> >
>> > Junio: since 1.6.2 might be out the door before we have time to resolve
>> > this, I'm leaning towards disabling the broken-symlink-workaround by
>> > default for the release. It seems far more people are negatively
>> > affected by the attempted fix around this rare problem than helped.
>> 
>> I agree that unfortunately is the message I am getting from the list ever
>> since the feature was introduced.
>
> OK, here goes:

Thanks; applied together with Ben Walton's "format_svn_date" fix.

^ permalink raw reply

* Re: git-svn woes
From: Eric Wong @ 2009-02-28  4:09 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Nicolas Pitre, git, Deskin Miller
In-Reply-To: <7vtz6fgrdi.fsf@gitster.siamese.dyndns.org>

Junio C Hamano <gitster@pobox.com> wrote:
> Eric Wong <normalperson@yhbt.net> writes:
> 
> > I've been poking around at this for a bit, I am pretty confused
> > by this, too.  It's been a rough week, so I could be missing
> > something obvious...
> >
> > Junio: since 1.6.2 might be out the door before we have time to resolve
> > this, I'm leaning towards disabling the broken-symlink-workaround by
> > default for the release. It seems far more people are negatively
> > affected by the attempted fix around this rare problem than helped.
> 
> I agree that unfortunately is the message I am getting from the list ever
> since the feature was introduced.

OK, here goes:

>From 0985d9190d0f85b1285de4f23f87bdfd9e0c0fff Mon Sep 17 00:00:00 2001
From: Eric Wong <normalperson@yhbt.net>
Date: Fri, 27 Feb 2009 19:40:16 -0800
Subject: [PATCH] git-svn: disable broken symlink workaround by default

Even though this will break things for some extremely rare
repositories used by broken Windows clients, it's probably not
worth enabling this by default as it has negatively affected
many more users than it has helped from what we've seen so far.

The extremely rare repositories that have broken symlinks in
them will be silently corrupted in import; but users can still
reenable this option and restart the import.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
 git-svn.perl                     |    2 +-
 t/t9131-git-svn-empty-symlink.sh |   10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index 55702d0..959eb52 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3297,7 +3297,7 @@ sub new {
 sub _mark_empty_symlinks {
 	my ($git_svn, $switch_path) = @_;
 	my $bool = Git::config_bool('svn.brokenSymlinkWorkaround');
-	return {} if (defined($bool) && ! $bool);
+	return {} if (!defined($bool)) || (defined($bool) && ! $bool);
 
 	my %ret;
 	my ($rev, $cmt) = $git_svn->last_rev_commit;
diff --git a/t/t9131-git-svn-empty-symlink.sh b/t/t9131-git-svn-empty-symlink.sh
index 20529a8..8f35e29 100755
--- a/t/t9131-git-svn-empty-symlink.sh
+++ b/t/t9131-git-svn-empty-symlink.sh
@@ -83,6 +83,8 @@ EOF
 '
 
 test_expect_success 'clone using git svn' 'git svn clone -r1 "$svnrepo" x'
+test_expect_success 'enable broken symlink workaround' \
+  '(cd x && git config svn.brokenSymlinkWorkaround true)'
 test_expect_success '"bar" is an empty file' 'test -f x/bar && ! test -s x/bar'
 test_expect_success 'get "bar" => symlink fix from svn' \
 		'(cd x && git svn rebase)'
@@ -97,4 +99,12 @@ test_expect_success 'get "bar" => symlink fix from svn' \
 		'(cd y && git svn rebase)'
 test_expect_success '"bar" does not become a symlink' '! test -L y/bar'
 
+# svn.brokenSymlinkWorkaround is unset
+test_expect_success 'clone using git svn' 'git svn clone -r1 "$svnrepo" z'
+test_expect_success '"bar" is an empty file' 'test -f z/bar && ! test -s z/bar'
+test_expect_success 'get "bar" => symlink fix from svn' \
+		'(cd z && git svn rebase)'
+test_expect_success '"bar" does not become a symlink' '! test -L z/bar'
+
+
 test_done
-- 
1.6.2.rc2.5.g0c347

^ permalink raw reply related

* Re: How can I force git to recognize a change change in file modes?
From: Jan Krüger @ 2009-02-28  3:55 UTC (permalink / raw)
  To: Brent Goodrick; +Cc: git
In-Reply-To: <e38bce640902271717s46cf47f9i7c6bf5aac0d5f273@mail.gmail.com>

Hi,

> I checked in a slew of scripts, only to realize that the file
> permissions were too open (I want them to be chmod 700, not chmod
> 755).  Somehow I thought that git was tracking those permission bits,
> but simply using "chmod 700 <fileset>; git add <fileset>" did not add
> the change of file modes, well, at least git status output doesn't
> show it. Is there a way to do this?

git doesn't track permissions quite that closely; all it remembers is
whether the file should be executable or not.

-Jan

^ permalink raw reply

* Re: git-svn woes
From: Junio C Hamano @ 2009-02-28  3:41 UTC (permalink / raw)
  To: Eric Wong; +Cc: Nicolas Pitre, git, Deskin Miller
In-Reply-To: <20090228033108.GB28606@dcvr.yhbt.net>

Eric Wong <normalperson@yhbt.net> writes:

> I've been poking around at this for a bit, I am pretty confused
> by this, too.  It's been a rough week, so I could be missing
> something obvious...
>
> Junio: since 1.6.2 might be out the door before we have time to resolve
> this, I'm leaning towards disabling the broken-symlink-workaround by
> default for the release. It seems far more people are negatively
> affected by the attempted fix around this rare problem than helped.

I agree that unfortunately is the message I am getting from the list ever
since the feature was introduced.

^ permalink raw reply

* Re: git-svn woes
From: Eric Wong @ 2009-02-28  3:31 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Nicolas Pitre, git, Deskin Miller
In-Reply-To: <86d4c5e00902271253y50eaef01x8ca837d3a0ed7ef6@mail.gmail.com>

Deskin Miller <deskinm@gmail.com> wrote:
> On Fri, Feb 27, 2009 at 15:37, Nicolas Pitre <nico@cam.org> wrote:
> >
> > OK... I cannot pretend to be a newbie with git.  However it's the first
> > time I try git-svn and it looks like a couple basic things aren't right.
> >
> > I initially cloned svn://svn.berlios.de/openocd using "git svn clone -s".
> > So far so good.  Now I'm attempting to update using "git svn fetch" but
> > the operation always fails with the following error:
> >
> > |branch_from: /openocd/branches => /openocd/branches/xscale
> > |Found possible branch point:
> > |svn://svn.berlios.de/openocd/openocd/branches/xscale =>
> > |svn://svn.berlios.de/openocd/branches/xscale, 1231
> > |Initializing parent: xscale@1231
> > |Found branch parent: (xscale) 657522f3f2d1ab8b679fd5b45ce4e9ca1974af18
> > |Following parent with do_switch
> > |Scanning for empty symlinks, this may take a while if you have many empty files
> > |You may disable this with `git config svn.brokenSymlinkWorkaround false'.
> > |This may be done in a different terminal without restarting git svn
> > |Malformed network data: Malformed network data at /home/nico/libexec/git-core/git-svn line 3333
> 
> I experience the same error as you do with 1.6.2-rc2.  This error is
> occurring in the new broken-symlink-workaround code.  I'm not sure
> what is going on and don't have time to examine it closely, but the
> function where the error occurs doesn't run if the config
> svn.brokenSymlinkWorkaround option is set false; doing so makes the
> fetch continue for me.
> 
> Any ideas, Eric?

I've been poking around at this for a bit, I am pretty confused
by this, too.  It's been a rough week, so I could be missing
something obvious...

Junio: since 1.6.2 might be out the door before we have time to resolve
this, I'm leaning towards disabling the broken-symlink-workaround by
default for the release. It seems far more people are negatively
affected by the attempted fix around this rare problem than helped.

> > Thing is... the repository never gets updated and by far.  According to
> > "git svn info", the fetched revision is 1232, while a separate
> > repository using native svn claims to be at revision 1383.
> >
> > Furthermore, the "git svn info" command produces yet more errors, such
> > as:
> >
> > |Use of uninitialized value $lc_author in concatenation (.) or string at /home/nico/libexec/git-core/git-svn line 964.
> > |Use of uninitialized value $lc_rev in concatenation (.) or string at /home/nico/libexec/git-core/git-svn line 965.
> > |Use of uninitialized value $t in gmtime at /home/nico/libexec/git-core/git-svn line 4743.
> > |Use of uninitialized value $t in numeric comparison (<=>) at /home/nico/libexec/git-core/git-svn line 4744.
> > |Use of uninitialized value $t in subtraction (-) at /home/nico/libexec/git-core/git-svn line 4745.
> > |Use of uninitialized value $t in localtime at /home/nico/libexec/git-core/git-svn line 4746.
> >
> > This is with git from current "next". I cannot spend time to try fixing
> > the issue myself (especially as I'm not familiar at all with the inner
> > workings of svn), so my only option at the moment is to give up on
> > git-svn altogether.  :-(
> 
> Oh, don't give up quite yet :)
> 
> Deskin Miler

-- 
Eric Wong

^ permalink raw reply

* Re: [PATCH] git-svn - return original format_svn_date semantics
From: Eric Wong @ 2009-02-28  3:22 UTC (permalink / raw)
  To: Ben Walton; +Cc: git
In-Reply-To: <1235790705-12903-1-git-send-email-bwalton@artsci.utoronto.ca>

Ben Walton <bwalton@artsci.utoronto.ca> wrote:
> When %z was removed from the strftime call and subsituted with a
> local gmt offset calculation, time() was no longer the default for
> all time functions as it was with the previous localtime(shift).
> This is now corrected so that format_svn_time behaves as it used to.
> 
> Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>

Thanks Ben,

I'm pretty sure there's another bug lurking in there with the "info"
command, but this should at least cleanup the output as a stopgap
measure until somebody has time to properly fix it.

Acked-by: Eric Wong <normalperson@yhbt.net>

> ---
>  git-svn.perl |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/git-svn.perl b/git-svn.perl
> index d967594..55702d0 100755
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -4738,7 +4738,7 @@ sub run_pager {
>  
>  sub format_svn_date {
>  	# some systmes don't handle or mishandle %z, so be creative.
> -	my $t = shift;
> +	my $t = shift || time;
>  	my $gm = timelocal(gmtime($t));
>  	my $sign = qw( + + - )[ $t <=> $gm ];
>  	my $gmoff = sprintf("%s%02d%02d", $sign, (gmtime(abs($t - $gm)))[2,1]);
> -- 
> 1.6.0.4

^ permalink raw reply

* [PATCH] git-svn - return original format_svn_date semantics
From: Ben Walton @ 2009-02-28  3:11 UTC (permalink / raw)
  To: normalperson; +Cc: git, Ben Walton

When %z was removed from the strftime call and subsituted with a
local gmt offset calculation, time() was no longer the default for
all time functions as it was with the previous localtime(shift).
This is now corrected so that format_svn_time behaves as it used to.

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
---
 git-svn.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index d967594..55702d0 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -4738,7 +4738,7 @@ sub run_pager {
 
 sub format_svn_date {
 	# some systmes don't handle or mishandle %z, so be creative.
-	my $t = shift;
+	my $t = shift || time;
 	my $gm = timelocal(gmtime($t));
 	my $sign = qw( + + - )[ $t <=> $gm ];
 	my $gmoff = sprintf("%s%02d%02d", $sign, (gmtime(abs($t - $gm)))[2,1]);
-- 
1.6.0.4

^ permalink raw reply related

* Re: [PATCH] gitk: make use of themed widgets where available
From: Paul Mackerras @ 2009-02-28  2:45 UTC (permalink / raw)
  To: Pat Thoyts; +Cc: git
In-Reply-To: <87ljrre7nr.fsf@users.sourceforge.net>

Pat Thoyts writes:

>     This patch improves the appearence of gitk on Windows XP and Vista
>     by making use of the themed widgets that are provided in Tk 8.5
>     and above. For good Vista support 8.6 will be needed.

Wow.  It'll take me a while to digest this.  Before I start diving
into it, does gitk still work on Tk 8.4 with this patch?

Paul.

^ permalink raw reply

* Re: git-svn and repository hierarchy?
From: Peter Harris @ 2009-02-28  2:41 UTC (permalink / raw)
  To: Josef Wolf, git
In-Reply-To: <20090227235824.GD14187@raven.wolf.lan>

On Fri, Feb 27, 2009 at 6:58 PM, Josef Wolf wrote:
>
> At the time I read the tutorials/howtos/whatever, I thought I understand
> what "rebase" actually means.  But now I get pretty much confused, since
> there are "git rebase", "git pull --rebase" and "git svn rebase" involved,
> and they all seem to do very different things.

(simplified, take with grain of salt:)
"git pull" is short for "git fetch && git merge <tracking branch>"
"git pull --rebase" is short for "git fetch && git rebase <tracking branch>"
"git svn rebase" is short for "git svn fetch && git rebase <svn
tracking branch>"
"git svn dcommit" is short for "while (changes) { svn ci && git svn rebase }"

It's all just shortcuts for the same operations underneath. Does that help?

Peter Harris

^ permalink raw reply

* Re: [WARNING] Proposed future changes that are backward incompatible
From: Markus Heidelberg @ 2009-02-28  2:36 UTC (permalink / raw)
  To: George Spelvin; +Cc: git, gitster
In-Reply-To: <20090227192708.6266.qmail@science.horizon.com>

George Spelvin, 27.02.2009:
> There's one more change that was suggested that I'd like to propose:
> - Make "git grep" search the whole repository by default; include an
>   explicit "." path limiter to search only the current directory.
> 
> In addition to being more consistent with other commands like "git log",
> this saves a lot of typing working in drivers/net/usb/ if the identifier
> you're looking for is in include/.

I use ctags from within the editor Vim therefor. Also grepping may show
too many unwanted results.

Markus

^ permalink raw reply

* [PATCH] gitk: put all startup code into a proc to enable re-sourcing
From: Pat Thoyts @ 2009-02-28  0:17 UTC (permalink / raw)
  To: git; +Cc: paulus


    All the startup code is moved into a procedure. All the variables
    get initialized using 'variable' to ensure they are in the global
    namespace.  This makes it possible to re-source the script during
    development from the Tk console or a tkcon interactive session.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
---
 gitk |  578 +++++++++++++++++++++++++++++++++++-------------------------------
 1 files changed, 309 insertions(+), 269 deletions(-)

diff --git a/gitk b/gitk
index dc2a439..f8c3c73 100755
--- a/gitk
+++ b/gitk
@@ -7,6 +7,8 @@ exec wish "$0" -- "$@"
 # and distributed under the terms of the GNU General Public Licence,
 # either version 2, or (at your option) any later version.
 
+package require Tk
+
 proc gitdir {} {
     global env
     if {[info exists env(GIT_DIR)]} {
@@ -1794,39 +1796,48 @@ proc show_error {w top msg} {
 }
 
 proc error_popup {msg {owner .}} {
-    set w .error
-    toplevel $w
-    make_transient $w $owner
-    show_error $w $w $msg
+    if {[tk windowingsystem] eq "win32"} {
+        tk_messageBox -icon error -type ok -title [wm title .] \
+            -parent $owner -message $msg
+    } else {
+        set w .error
+        toplevel $w
+        make_transient $w $owner
+        show_error $w $w $msg
+    }
 }
 
 proc confirm_popup {msg {owner .}} {
-    global confirm_ok
+    global confirm_ok use_ttk
+    set ttk [expr {$use_ttk ? "ttk" : ""}]
     set confirm_ok 0
     set w .confirm
     toplevel $w
     make_transient $w $owner
     message $w.m -text $msg -justify center -aspect 400
     pack $w.m -side top -fill x -padx 20 -pady 20
-    button $w.ok -text [mc OK] -command "set confirm_ok 1; destroy $w"
+    ${ttk}::button $w.ok -text [mc OK] -command "set confirm_ok 1; destroy $w"
     pack $w.ok -side left -fill x
-    button $w.cancel -text [mc Cancel] -command "destroy $w"
+    ${ttk}::button $w.cancel -text [mc Cancel] -command "destroy $w"
     pack $w.cancel -side right -fill x
     bind $w <Visibility> "grab $w; focus $w"
-    bind $w <Key-Return> "set confirm_ok 1; destroy $w"
+    bind $w <Key-Return> [list $w.ok invoke]
     bind $w <Key-space>  "set confirm_ok 1; destroy $w"
-    bind $w <Key-Escape> "destroy $w"
+    bind $w <Key-Escape> [list $w.cancel invoke]
+    tk::PlaceWindow $w widget $owner
     tkwait window $w
     return $confirm_ok
 }
 
 proc setoptions {} {
-    option add *Panedwindow.showHandle 1 startupFile
-    option add *Panedwindow.sashRelief raised startupFile
+    if {[tk windowingsystem] ne "win32"} {
+        option add *Panedwindow.showHandle 1 startupFile
+        option add *Panedwindow.sashRelief raised startupFile
+        option add *Menu.font uifont startupFile
+    }
     option add *Button.font uifont startupFile
     option add *Checkbutton.font uifont startupFile
     option add *Radiobutton.font uifont startupFile
-    option add *Menu.font uifont startupFile
     option add *Menubutton.font uifont startupFile
     option add *Label.font uifont startupFile
     option add *Message.font uifont startupFile
@@ -10649,274 +10660,303 @@ proc get_path_encoding {path} {
     return $tcl_enc
 }
 
-# First check that Tcl/Tk is recent enough
-if {[catch {package require Tk 8.4} err]} {
-    show_error {} . [mc "Sorry, gitk cannot run with this version of Tcl/Tk.\n\
+proc init {args} {
+    global env argv0
+
+    ## For msgcat loading, first locate the installation location.
+    if { [info exists ::env(GITK_MSGSDIR)] } {
+        ## Msgsdir was manually set in the environment.
+        variable gitk_msgsdir $::env(GITK_MSGSDIR)
+    } else {
+        ## Let's guess the prefix from argv0.
+        set gitk_prefix [file dirname [file dirname [file normalize $argv0]]]
+        variable gitk_libdir [file join $gitk_prefix share gitk lib]
+        variable gitk_msgsdir [file join $gitk_libdir msgs]
+        unset gitk_prefix
+    }
+
+    ## Internationalization (i18n) through msgcat and gettext. See
+    ## http://www.gnu.org/software/gettext/manual/html_node/Tcl.html
+    package require msgcat
+    namespace import ::msgcat::mc
+    ## And eventually load the actual message catalog
+    ::msgcat::mcload $gitk_msgsdir
+    
+
+    # First check that Tcl/Tk is recent enough
+    if {[catch {package require Tk 8.4} err]} {
+        tk_messageBox -icon error -type ok \
+            -title "[file tail $argv0]: [file tail [pwd]]"\
+            -message [mc "Sorry, gitk cannot run with this version of Tcl/Tk.\n\
 		     Gitk requires at least Tcl/Tk 8.4."]
-    exit 1
-}
+        exit 1
+    }
 
-# defaults...
-set wrcomcmd "git diff-tree --stdin -p --pretty"
+    # Hide the main window until everything is ready.
+    wm withdraw .
 
-set gitencoding {}
-catch {
-    set gitencoding [exec git config --get i18n.commitencoding]
-}
-catch {
-    set gitencoding [exec git config --get i18n.logoutputencoding]
-}
-if {$gitencoding == ""} {
-    set gitencoding "utf-8"
-}
-set tclencoding [tcl_encoding $gitencoding]
-if {$tclencoding == {}} {
-    puts stderr "Warning: encoding $gitencoding is not supported by Tcl/Tk"
-}
+    # defaults...
+    variable wrcomcmd "git diff-tree --stdin -p --pretty"
 
-set gui_encoding [encoding system]
-catch {
-    set enc [exec git config --get gui.encoding]
-    if {$enc ne {}} {
-	set tclenc [tcl_encoding $enc]
-	if {$tclenc ne {}} {
-	    set gui_encoding $tclenc
-	} else {
-	    puts stderr "Warning: encoding $enc is not supported by Tcl/Tk"
-	}
-    }
-}
-
-set mainfont {Helvetica 9}
-set textfont {Courier 9}
-set uifont {Helvetica 9 bold}
-set tabstop 8
-set findmergefiles 0
-set maxgraphpct 50
-set maxwidth 16
-set revlistorder 0
-set fastdate 0
-set uparrowlen 5
-set downarrowlen 5
-set mingaplen 100
-set cmitmode "patch"
-set wrapcomment "none"
-set showneartags 1
-set maxrefs 20
-set maxlinelen 200
-set showlocalchanges 1
-set limitdiffs 1
-set datetimeformat "%Y-%m-%d %H:%M:%S"
-set autoselect 1
-set perfile_attrs 0
-
-set extdifftool "meld"
-
-set colors {green red blue magenta darkgrey brown orange}
-set bgcolor white
-set fgcolor black
-set diffcolors {red "#00a000" blue}
-set diffcontext 3
-set ignorespace 0
-set selectbgcolor gray85
-set markbgcolor "#e0e0ff"
-
-set circlecolors {white blue gray blue blue}
-
-# button for popping up context menus
-if {[tk windowingsystem] eq "aqua"} {
-    set ctxbut <Button-2>
-} else {
-    set ctxbut <Button-3>
-}
-
-## For msgcat loading, first locate the installation location.
-if { [info exists ::env(GITK_MSGSDIR)] } {
-    ## Msgsdir was manually set in the environment.
-    set gitk_msgsdir $::env(GITK_MSGSDIR)
-} else {
-    ## Let's guess the prefix from argv0.
-    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
-## http://www.gnu.org/software/gettext/manual/html_node/Tcl.html
-package require msgcat
-namespace import ::msgcat::mc
-## And eventually load the actual message catalog
-::msgcat::mcload $gitk_msgsdir
-
-catch {source ~/.gitk}
-
-font create optionfont -family sans-serif -size -12
-
-parsefont mainfont $mainfont
-eval font create mainfont [fontflags mainfont]
-eval font create mainfontbold [fontflags mainfont 1]
-
-parsefont textfont $textfont
-eval font create textfont [fontflags textfont]
-eval font create textfontbold [fontflags textfont 1]
-
-parsefont uifont $uifont
-eval font create uifont [fontflags uifont]
-
-setoptions
-
-# check that we can find a .git directory somewhere...
-if {[catch {set gitdir [gitdir]}]} {
-    show_error {} . [mc "Cannot find a git repository here."]
-    exit 1
-}
-if {![file isdirectory $gitdir]} {
-    show_error {} . [mc "Cannot find the git directory \"%s\"." $gitdir]
-    exit 1
-}
-
-set selecthead {}
-set selectheadid {}
-
-set revtreeargs {}
-set cmdline_files {}
-set i 0
-set revtreeargscmd {}
-foreach arg $argv {
-    switch -glob -- $arg {
-	"" { }
-	"--" {
-	    set cmdline_files [lrange $argv [expr {$i + 1}] end]
-	    break
-	}
-	"--select-commit=*" {
-	    set selecthead [string range $arg 16 end]
-	}
-	"--argscmd=*" {
-	    set revtreeargscmd [string range $arg 10 end]
-	}
-	default {
-	    lappend revtreeargs $arg
-	}
+    set gitencoding {}
+    catch {
+        set gitencoding [exec git config --get i18n.commitencoding]
+    }
+    catch {
+        set gitencoding [exec git config --get i18n.logoutputencoding]
+    }
+    if {$gitencoding == ""} {
+        set gitencoding "utf-8"
+    }
+    variable tclencoding [tcl_encoding $gitencoding]
+    if {$tclencoding == {}} {
+        puts stderr "Warning: encoding $gitencoding is not supported by Tcl/Tk"
     }
-    incr i
-}
 
-if {$selecthead eq "HEAD"} {
-    set selecthead {}
-}
+    variable gui_encoding [encoding system]
+    catch {
+        set enc [exec git config --get gui.encoding]
+        if {$enc ne {}} {
+            set tclenc [tcl_encoding $enc]
+            if {$tclenc ne {}} {
+                set gui_encoding $tclenc
+            } else {
+                puts stderr "Warning: encoding $enc is not supported by Tcl/Tk"
+            }
+        }
+    }
+    
+    variable have_tk85 [package vsatisfies [package provide Tk] 8.5]
+    variable use_ttk [llength [info commands ::ttk::style]]
+    variable mainfont {Helvetica 9}
+    variable textfont {Courier 9}
+    variable uifont {Helvetica 9 bold}
+    variable tabstop 8
+    variable findmergefiles 0
+    variable maxgraphpct 50
+    variable maxwidth 16
+    variable revlistorder 0
+    variable fastdate 0
+    variable uparrowlen 5
+    variable downarrowlen 5
+    variable mingaplen 100
+    variable cmitmode "patch"
+    variable wrapcomment "none"
+    variable showneartags 1
+    variable maxrefs 20
+    variable maxlinelen 200
+    variable showlocalchanges 1
+    variable limitdiffs 1
+    variable datetimeformat "%Y-%m-%d %H:%M:%S"
+    variable autoselect 1
+    variable perfile_attrs 0
+
+    variable extdifftool "meld"
+
+    variable colors {green red blue magenta darkgrey brown orange}
+    variable bgcolor white
+    variable fgcolor black
+    variable diffcolors {red "#00a000" blue}
+    variable diffcontext 3
+    variable ignorespace 0
+    variable selectbgcolor gray85
+    variable markbgcolor "#e0e0ff"
+
+    variable circlecolors {white blue gray blue blue}
+
+    # button for popping up context menus
+    if {[tk windowingsystem] eq "aqua"} {
+        variable ctxbut <Button-2>
+    } else {
+        variable ctxbut <Button-3>
+    }
 
-if {$i >= [llength $argv] && $revtreeargs ne {}} {
-    # no -- on command line, but some arguments (other than --argscmd)
-    if {[catch {
-	set f [eval exec git rev-parse --no-revs --no-flags $revtreeargs]
-	set cmdline_files [split $f "\n"]
-	set n [llength $cmdline_files]
-	set revtreeargs [lrange $revtreeargs 0 end-$n]
-	# Unfortunately git rev-parse doesn't produce an error when
-	# something is both a revision and a filename.  To be consistent
-	# with git log and git rev-list, check revtreeargs for filenames.
-	foreach arg $revtreeargs {
-	    if {[file exists $arg]} {
-		show_error {} . [mc "Ambiguous argument '%s': both revision\
+
+    catch {source ~/.gitk}
+
+    font create optionfont -family sans-serif -size -12
+
+    parsefont mainfont $mainfont
+    eval font create mainfont [fontflags mainfont]
+    eval font create mainfontbold [fontflags mainfont 1]
+
+    parsefont textfont $textfont
+    eval font create textfont [fontflags textfont]
+    eval font create textfontbold [fontflags textfont 1]
+    
+    parsefont uifont $uifont
+    eval font create uifont [fontflags uifont]
+
+    setoptions
+
+    # check that we can find a .git directory somewhere...
+    if {[catch {set gitdir [gitdir]}]} {
+        show_error {} . [mc "Cannot find a git repository here."]
+        exit 1
+    }
+    if {![file isdirectory $gitdir]} {
+        show_error {} . [mc "Cannot find the git directory \"%s\"." $gitdir]
+        exit 1
+    }
+
+    variable selecthead {}
+    variable selectheadid {}
+    
+    variable revtreeargs {}
+    set cmdline_files {}
+    set i 0
+    set revtreeargscmd {}
+    foreach arg $args {
+        switch -glob -- $arg {
+            "" { }
+            "--" {
+                set cmdline_files [lrange $args [expr {$i + 1}] end]
+                break
+            }
+            "--select-commit=*" {
+                set selecthead [string range $arg 16 end]
+            }
+            "--argscmd=*" {
+                set revtreeargscmd [string range $arg 10 end]
+            }
+            default {
+                lappend revtreeargs $arg
+            }
+        }
+        incr i
+    }
+    
+    if {$selecthead eq "HEAD"} {
+        set selecthead {}
+    }
+    
+    if {$i >= [llength $args] && $revtreeargs ne {}} {
+        # no -- on command line, but some arguments (other than --argscmd)
+        if {[catch {
+            set f [eval exec git rev-parse --no-revs --no-flags $revtreeargs]
+            set cmdline_files [split $f "\n"]
+            set n [llength $cmdline_files]
+            set revtreeargs [lrange $revtreeargs 0 end-$n]
+            # Unfortunately git rev-parse doesn't produce an error when
+            # something is both a revision and a filename.  To be consistent
+            # with git log and git rev-list, check revtreeargs for filenames.
+            foreach arg $revtreeargs {
+                if {[file exists $arg]} {
+                    show_error {} . [mc "Ambiguous argument '%s': both revision\
 				 and filename" $arg]
-		exit 1
-	    }
-	}
-    } err]} {
-	# unfortunately we get both stdout and stderr in $err,
-	# so look for "fatal:".
-	set i [string first "fatal:" $err]
-	if {$i > 0} {
-	    set err [string range $err [expr {$i + 6}] end]
-	}
-	show_error {} . "[mc "Bad arguments to gitk:"]\n$err"
-	exit 1
+                    exit 1
+                }
+            }
+        } err]} {
+            # unfortunately we get both stdout and stderr in $err,
+            # so look for "fatal:".
+            set i [string first "fatal:" $err]
+            if {$i > 0} {
+                set err [string range $err [expr {$i + 6}] end]
+            }
+            show_error {} . "[mc "Bad arguments to gitk:"]\n$err"
+            exit 1
+        }
     }
-}
 
-set nullid "0000000000000000000000000000000000000000"
-set nullid2 "0000000000000000000000000000000000000001"
-set nullfile "/dev/null"
-
-set have_tk85 [expr {[package vcompare $tk_version "8.5"] >= 0}]
-
-set runq {}
-set history {}
-set historyindex 0
-set fh_serial 0
-set nhl_names {}
-set highlight_paths {}
-set findpattern {}
-set searchdirn -forwards
-set boldids {}
-set boldnameids {}
-set diffelide {0 0}
-set markingmatches 0
-set linkentercount 0
-set need_redisplay 0
-set nrows_drawn 0
-set firsttabstop 0
-
-set nextviewnum 1
-set curview 0
-set selectedview 0
-set selectedhlview [mc "None"]
-set highlight_related [mc "None"]
-set highlight_files {}
-set viewfiles(0) {}
-set viewperm(0) 0
-set viewargs(0) {}
-set viewargscmd(0) {}
-
-set selectedline {}
-set numcommits 0
-set loginstance 0
-set cmdlineok 0
-set stopped 0
-set stuffsaved 0
-set patchnum 0
-set lserial 0
-set isworktree [expr {[exec git rev-parse --is-inside-work-tree] == "true"}]
-setcoords
-makewindow
-# wait for the window to become visible
-tkwait visibility .
-wm title . "[file tail $argv0]: [file tail [pwd]]"
-readrefs
-
-if {$cmdline_files ne {} || $revtreeargs ne {} || $revtreeargscmd ne {}} {
-    # create a view for the files/dirs specified on the command line
-    set curview 1
-    set selectedview 1
-    set nextviewnum 2
-    set viewname(1) [mc "Command line"]
-    set viewfiles(1) $cmdline_files
-    set viewargs(1) $revtreeargs
-    set viewargscmd(1) $revtreeargscmd
-    set viewperm(1) 0
-    set vdatemode(1) 0
-    addviewmenu 1
-    .bar.view entryconf [mca "Edit view..."] -state normal
-    .bar.view entryconf [mca "Delete view"] -state normal
-}
-
-if {[info exists permviews]} {
-    foreach v $permviews {
-	set n $nextviewnum
-	incr nextviewnum
-	set viewname($n) [lindex $v 0]
-	set viewfiles($n) [lindex $v 1]
-	set viewargs($n) [lindex $v 2]
-	set viewargscmd($n) [lindex $v 3]
-	set viewperm($n) 1
-	addviewmenu $n
+    variable nullid "0000000000000000000000000000000000000000"
+    variable nullid2 "0000000000000000000000000000000000000001"
+    variable nullfile "/dev/null"
+    
+    variable runq {}
+    variable history {}
+    variable historyindex 0
+    variable fh_serial 0
+    variable nhl_names {}
+    variable highlight_paths {}
+    variable findpattern {}
+    variable searchdirn -forwards
+    variable boldids {}
+    variable boldnameids {}
+    variable diffelide {0 0}
+    variable markingmatches 0
+    variable linkentercount 0
+    variable need_redisplay 0
+    variable nrows_drawn 0
+    variable firsttabstop 0
+
+    global nextviewnum curview selectedview selectedhlview
+    global highlight_related highlight_files
+    global viewcomplete viewactive viewname viewinstances
+    global viewfiles viewargs viewargscmd viewperm nextviewnum
+
+    set nextviewnum 1
+    set curview 0
+    set selectedview 0
+    set selectedhlview [mc "None"]
+    set highlight_related [mc "None"]
+    set highlight_files {}
+    set viewfiles(0) {}
+    set viewperm(0) 0
+    set viewargs(0) {}
+    set viewargscmd(0) {}
+
+    variable selectedline {}
+    variable numcommits 0
+    variable loginstance 0
+    variable cmdlineok 0
+    variable stopped 0
+    variable stuffsaved 0
+    variable patchnum 0
+    variable lserial 0
+    variable isworktree [expr {[exec git rev-parse --is-inside-work-tree] == "true"}]
+    setcoords
+    makewindow
+    # wait for the window to become visible
+    wm deiconify .
+    tkwait visibility .
+    wm title . "[file tail $argv0]: [file tail [pwd]]"
+    readrefs
+
+    if {$cmdline_files ne {} || $revtreeargs ne {} || $revtreeargscmd ne {}} {
+        # create a view for the files/dirs specified on the command line
+        set curview 1
+        set selectedview 1
+        set nextviewnum 2
+        set viewname(1) [mc "Command line"]
+        set viewfiles(1) $cmdline_files
+        set viewargs(1) $revtreeargs
+        set viewargscmd(1) $revtreeargscmd
+        set viewperm(1) 0
+        set vdatemode(1) 0
+        addviewmenu 1
+        .bar.view entryconf [mca "Edit view..."] -state normal
+        .bar.view entryconf [mca "Delete view"] -state normal
+    }
+
+    if {[info exists permviews]} {
+        foreach v $permviews {
+            set n $nextviewnum
+            incr nextviewnum
+            set viewname($n) [lindex $v 0]
+            set viewfiles($n) [lindex $v 1]
+            set viewargs($n) [lindex $v 2]
+            set viewargscmd($n) [lindex $v 3]
+            set viewperm($n) 1
+            addviewmenu $n
+        }
     }
-}
 
-if {[tk windowingsystem] eq "win32"} {
-    focus -force .
+    if {[tk windowingsystem] eq "win32"} {
+        focus -force .
+        bind . <Control-F2> {console show}
+    }
+
+    getcommits {}
 }
 
-getcommits {}
+if {!$tcl_interactive} {
+    if {![info exists initialized]} {
+        set initialized 1
+        set r [catch [linsert $argv 0 init] err]
+        if {$r} {
+            tk_messageBox -icon error -title "Gitk error" \
+                -message $errorInfo
+        }
+    }
+}
-- 
1.6.0.2.1172.ga5ed0

^ permalink raw reply related

* Re: [PATCH] autoconf: Add support for --infodir
From: Jakub Narebski @ 2009-02-28  1:57 UTC (permalink / raw)
  To: David Syzdek; +Cc: git, Jeff King, Tim Visher
In-Reply-To: <9a0027270902271712y57839e22w492f7ad46baf49b@mail.gmail.com>

On Sat, 28 Feb 2009, David Syzdek wrote:
> On Fri, Feb 27, 2009 at 3:33 PM, Jakub Narebski <jnareb@gmail.com> wrote:
>> On Thu, 26 Feb 2009, Jeff King wrote:
>>> On Thu, Feb 26, 2009 at 09:48:29AM -0500, Tim Visher wrote:
>>>
>>>> I'm working on getting git 1.6.2-rc2 built.  I have a bin, man, info,
>>>> and html directory in my home folder that I'd like to use as the
>>>> defaults for git.  I attempted to do this through
>>>>
>>>>     make configure
>>>>     ./configure --XXdir=/full/path/to/dir
>>>>     make all man info html
>>>>     make install install-man install-info install-html
[...]

>>> The configure support is notoriously incomplete (AFAIK, very few of the
>>> active developers use it regularly). Probably you need something like
>>> this (but I didn't test it):
>>>
>>> diff --git a/config.mak.in b/config.mak.in
>>> index 7cce0c1..505d5c7 100644
>>> --- a/config.mak.in
>>> +++ b/config.mak.in
>>> @@ -18,6 +18,8 @@ datarootdir = @datarootdir@
>>>  template_dir = @datadir@/git-core/templates
>>>
>>>  mandir=@mandir@
>>> +htmldir=@htmldir@
>>> +infodir=@infodir@
>>>
>>>  srcdir = @srcdir@
>>>  VPATH = @srcdir@
>>
>> Well, the infodir part works trivially, because autoconf (and
>> therefore ./configure script) has support for --infodir=DIR.
>> Below there is patch that adds that, with the commit message.
>>
>> But it is more difficult with respect to --htmldir. I am not autoconf
>> hacker, so I don't know how to add support for having --htmldir=DIR in
>> ./configure (in configure.ac).  What can be done is to derive htmldir
>> in config.mak.in from other sources, for example:
> 
> Autoconf add support for --htmldir in version 2.60.  Here is a snippet from
> the help message from a configure script generated with 2.60:
> 
> --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
> 
> --docdir=DIR            documentation root [DATAROOTDIR/doc/PROJECT_TARNAME]
> 
> --htmldir=DIR           html documentation [DOCDIR]
> 
> 
> The current configure.ac requires autoconf version>= 2.59, bumping the
> requirement to autoconf>= 2.60 would allow the autoconf variable $(htmldir)
> to be used.  Bumping the required version of autoconf will affect users with
> older linux installations who use git to upgrade git; and may affect the
> maintainer's ability to create a "release" tarball if he has an older
> version of autoconf.

Well, I have autoconf 2.59, so I cannot test the following patch
(and I am not sure if it is welcome). And of course it needs commit
message, at least with explanation why bumping required version of
autoconf was needed.

-- >8 --
diff --git a/config.mak.in b/config.mak.in
index acff9ed..56a0147 100644
--- a/config.mak.in
+++ b/config.mak.in
@@ -19,6 +19,7 @@ template_dir = @datadir@/git-core/templates
 
 mandir=@mandir@
 infodir=@infodir@
+htmldir=@htmldir@
 
 srcdir = @srcdir@
 VPATH = @srcdir@
diff --git a/configure.ac b/configure.ac
index 082a03d..b1ab0e1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
 #                                               -*- Autoconf -*-
 # Process this file with autoconf to produce a configure script.
 
-AC_PREREQ(2.59)
+AC_PREREQ(2.60)
 AC_INIT([git], [@@GIT_VERSION@@], [git@vger.kernel.org])
 
 AC_CONFIG_SRCDIR([git.c])

-- 
Jakub Narebski
Poland

^ permalink raw reply related

* [PATCH] gitk: avoid a crash in Tk if the application is closed early
From: Pat Thoyts @ 2009-02-28  0:19 UTC (permalink / raw)
  To: git; +Cc: paulus


    This evades Tk bug [2645457] that can lead to a crash in gitk if
    the application is closed while the commits are still being read
    from the git subprocess. By calling update to flush all the
    outstanding geometry events we avoid the chance of trying to map a
    deleted window.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
---
 gitk |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/gitk b/gitk
index 2b5265a..cd7ea2f 100755
--- a/gitk
+++ b/gitk
@@ -1795,6 +1795,7 @@ proc make_transient {window origin} {
 proc show_error {w top msg} {
     variable use_ttk
     set ttk [expr {$use_ttk ? "ttk" : ""}]
+    if {[wm state $top] eq "withdrawn"} { wm deiconify $top }
     message $w.m -text $msg -justify center -aspect 400
     pack $w.m -side top -fill x -padx 20 -pady 20
     ${ttk}::button $w.ok -default active -text [mc OK] -command "destroy $top"
@@ -10998,12 +10999,9 @@ proc init {args} {
     variable lserial 0
     variable isworktree [expr {[exec git rev-parse --is-inside-work-tree] == "true"}]
     setcoords
-    makewindow
-    # wait for the window to become visible
-    wm deiconify .
-    tkwait visibility .
+    wm withdraw .
     wm title . "[file tail $argv0]: [file tail [pwd]]"
-    readrefs
+    makewindow
 
     if {$cmdline_files ne {} || $revtreeargs ne {} || $revtreeargscmd ne {}} {
         # create a view for the files/dirs specified on the command line
@@ -11034,11 +11032,20 @@ proc init {args} {
         }
     }
 
+    # wait for the window to become visible
+    wm deiconify .
+    tkwait visibility .
+
     if {[tk windowingsystem] eq "win32"} {
         focus -force .
         bind . <Control-F2> {console show}
     }
 
+    # flush all geometry events to prevent possible crash if someone exits
+    # during the following reads.
+    update
+
+    readrefs
     getcommits {}
 }
 
-- 
1.6.0.2.1172.ga5ed0

^ permalink raw reply related

* Re: [PATCH 3/4] diffcore-pickaxe: further refactor count_match()
From: Junio C Hamano @ 2009-02-28  1:25 UTC (permalink / raw)
  To: René Scharfe; +Cc: git
In-Reply-To: <49A88FA7.1020402@lsrfire.ath.cx>

René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:

>> -
>> -	} else { /* Classic exact string match */
>> -		/* Yes, I've heard of strstr(), but the thing is *data may
>> -		 * not be NUL terminated.  Sue me.
>> -		 */
>> +	} else {
>> +		/* data many not be NUL terminated; we cannot use strstr() */
>
> That looks fishy to me.  regexec() expects data to be a NUL-terminated
> string, so either the comment is wrong or the regexp case needs to take
> better care to add a NUL at the end of the buffer.

Probably yes, but regexp side is not my code and I never use it, so... ;-)

> In any case, there is also memmem(), which uses the same fast algorithm
> as strstr() in recent glibc versions.  Like this?

Thanks; it would be nice to bench this change.

^ permalink raw reply

* How can I force git to recognize a change change in file modes?
From: Brent Goodrick @ 2009-02-28  1:17 UTC (permalink / raw)
  To: git

Hi,

I checked in a slew of scripts, only to realize that the file
permissions were too open (I want them to be chmod 700, not chmod
755).  Somehow I thought that git was tracking those permission bits,
but simply using "chmod 700 <fileset>; git add <fileset>" did not add
the change of file modes, well, at least git status output doesn't
show it. Is there a way to do this?

Thanks,
Brent

^ permalink raw reply

* Re: [PATCH] autoconf: Add support for --infodir
From: David Syzdek @ 2009-02-28  1:15 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git
In-Reply-To: <20090228002550.22597.53878.stgit@localhost.localdomain>

On Fri, Feb 27, 2009 at 3:33 PM, Jakub Narebski <jnareb@gmail.com> wrote:
>
> On Thu, 26 Feb 2009, Jeff King wrote:
> > On Thu, Feb 26, 2009 at 09:48:29AM -0500, Tim Visher wrote:
> >
> >> I'm working on getting git 1.6.2-rc2 built.  I have a bin, man, info,
> >> and html directory in my home folder that I'd like to use as the
> >> defaults for git.  I attempted to do this through
> >>
> >>     make configure
> >>     ./configure --XXdir=/full/path/to/dir
> >>     make all man info html
> >>     make install install-man install-info install-html
> >>
> >> But other than the binaries (and I'm not even totally convinced they
> >> got in correctly) and the man pages, everything else seems to be
> >> attempting to go to the typical places in /usr/local.
> >>
> >> What am I doing wrong?
>
> Why don't you use simply --prefix=DIR?
>
> >
> > The configure support is notoriously incomplete (AFAIK, very few of the
> > active developers use it regularly). Probably you need something like
> > this (but I didn't test it):
> >
> > diff --git a/config.mak.in b/config.mak.in
> > index 7cce0c1..505d5c7 100644
> > --- a/config.mak.in
> > +++ b/config.mak.in
> > @@ -18,6 +18,8 @@ datarootdir = @datarootdir@
> >  template_dir = @datadir@/git-core/templates
> >
> >  mandir=@mandir@
> > +htmldir=@htmldir@
> > +infodir=@infodir@
> >
> >  srcdir = @srcdir@
> >  VPATH = @srcdir@
>
> Well, the infodir part works trivially, because autoconf (and
> therefore ./configure script) has support for --infodir=DIR.
> Below there is patch that adds that, with the commit message.
>
> But it is more difficult with respect to --htmldir. I am not autoconf
> hacker, so I don't know how to add support for having --htmldir=DIR in
> ./configure (in configure.ac).  What can be done is to derive htmldir
> in config.mak.in from other sources, for example:
>

Autoconf add support for --htmldir in version 2.60.  Here is a snippet
from the help message from a configure script generated with 2.60:
   --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
   --docdir=DIR            documentation root [DATAROOTDIR/doc/PROJECT_TARNAME]
   --htmldir=DIR           html documentation [DOCDIR]

The current configure.ac requires autoconf version >= 2.59, bumping
the requirement to autoconf >= 2.60 would allow the autoconf variable
$(htmldir) to be used.  Bumping the required version of autoconf will
affect users with older linux installations who use git to upgrade
git; and may affect the maintainer's ability to create a "release"
tarball if he has an older version of autoconf.

>  htmldir=@datadir@/doc/git
>
> or something like that.
>
> -- >8 --
> Now that we actually (can) install some info files, and that $infodir
> is set and used in Makefile(s), let add support for --infodir=DIR
> [PREFIX/info] ./configure option in config.mak.in.
>
> Half of patch by Jeff King <peff@peff.net>m adding --XXdir support
> (the easy part: autoconf has --infodir, but not --htmldir).
>
> Signed-off-by: Jakub Narebski <jnareb@gmail.com>
> ---
>  config.mak.in |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/config.mak.in b/config.mak.in
> index 7cce0c1..acff9ed 100644
> --- a/config.mak.in
> +++ b/config.mak.in
> @@ -18,6 +18,7 @@ datarootdir = @datarootdir@
>  template_dir = @datadir@/git-core/templates
>
>  mandir=@mandir@
> +infodir=@infodir@
>
>  srcdir = @srcdir@
>  VPATH = @srcdir@
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



--
An earthquake wiped out Etchisketchistan today.
  -- Onion TV

^ permalink raw reply

* Re: [PATCH 3/4] diffcore-pickaxe: further refactor count_match()
From: René Scharfe @ 2009-02-28  1:13 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <cd73512d11e63554396983ed4e9556b2d18b3e4a.1235629933.git.gitster@pobox.com>

Junio C Hamano schrieb:
> -static unsigned int count_match(int one_or_more,
> -				struct diff_filespec *one,
> -				const char *needle, unsigned long len,
> -				regex_t *regexp)
> +static unsigned int count_match_internal(int one_or_more,
> +					 const char *data, unsigned long sz,
> +					 const char *needle, unsigned long len,
> +					 regex_t *regexp)
>  {

I don't especially like flags like one_or_more.  Having two functions
(which possibly call a common function that does most of the work) is
nicer.  And it's a bit sad here because there already are two functions
with nice names: count_match() and has_match().  But, well, since the
functions are not exported anyway it doesn't matter much.

> @@ -29,16 +20,14 @@ static unsigned int count_match(int one_or_more,
>  		while (*data && !regexec(regexp, data, 1, &regmatch, flags)) {
>  			flags |= REG_NOTBOL;
>  			data += regmatch.rm_so;
> -			if (*data) data++;
> +			if (*data)
> +				data++;
>  			cnt++;
>  			if (one_or_more)
>  				break;
>  		}
> -
> -	} else { /* Classic exact string match */
> -		/* Yes, I've heard of strstr(), but the thing is *data may
> -		 * not be NUL terminated.  Sue me.
> -		 */
> +	} else {
> +		/* data many not be NUL terminated; we cannot use strstr() */

That looks fishy to me.  regexec() expects data to be a NUL-terminated
string, so either the comment is wrong or the regexp case needs to take
better care to add a NUL at the end of the buffer.

In any case, there is also memmem(), which uses the same fast algorithm
as strstr() in recent glibc versions.  Like this?


diff --git a/diffcore-pickaxe.c b/diffcore-pickaxe.c
index f4870b4..4c19967 100644
--- a/diffcore-pickaxe.c
+++ b/diffcore-pickaxe.c
@@ -11,7 +11,6 @@ static unsigned int count_match_internal(int one_or_more,
 					 regex_t *regexp)
 {
 	unsigned int cnt = 0;
-	unsigned long offset;
 
 	if (regexp) {
 		regmatch_t regmatch;
@@ -27,15 +26,15 @@ static unsigned int count_match_internal(int one_or_more,
 				break;
 		}
 	} else {
-		/* data many not be NUL terminated; we cannot use strstr() */
-		for (offset = 0; offset + len <= sz; offset++) {
-			/* we count non-overlapping occurrences of needle */
-			if (!memcmp(needle, data + offset, len)) {
-				offset += len - 1;
-				cnt++;
-				if (one_or_more)
-					break;
-			}
+		while (sz) {
+			const char *found = memmem(data, sz, needle, len);
+			if (!found)
+				break;
+			sz -= found - data + len;
+			data = found + len;
+			cnt++;
+			if (one_or_more)
+				break;
 		}
 	}
 	return cnt;

^ permalink raw reply related

* Re: [PATCH] gitk: make use of themed widgets where available
From: Pat Thoyts @ 2009-02-28  0:59 UTC (permalink / raw)
  To: git
In-Reply-To: <fabb9a1e0902271647n36152700p101a92d793dabb41@mail.gmail.com>

Sverre Rabbelier <srabbelier <at> gmail.com> writes:

> 
> Heya,
> 
> On Sat, Feb 28, 2009 at 01:18, Pat Thoyts
> <patthoyts <at> users.sourceforge.net> wrote:
> >    This patch improves the appearence of gitk on Windows XP and Vista
> >    by making use of the themed widgets that are provided in Tk 8.5
> >    and above. For good Vista support 8.6 will be needed.
> 
> Screenies with before/after? :D
> 

After (on Vista) http://www.patthoyts.tk/screenshots/gitk-vista.png

Pat Thoyts

^ permalink raw reply

* Re: [PATCH] gitk: make use of themed widgets where available
From: Sverre Rabbelier @ 2009-02-28  0:47 UTC (permalink / raw)
  To: Pat Thoyts; +Cc: git, paulus
In-Reply-To: <87ljrre7nr.fsf@users.sourceforge.net>

Heya,

On Sat, Feb 28, 2009 at 01:18, Pat Thoyts
<patthoyts@users.sourceforge.net> wrote:
>    This patch improves the appearence of gitk on Windows XP and Vista
>    by making use of the themed widgets that are provided in Tk 8.5
>    and above. For good Vista support 8.6 will be needed.

Screenies with before/after? :D

-- 
Cheers,

Sverre Rabbelier

^ permalink raw reply

* Re: [PATCH] autoconf: Add support for --infodir
From: Jakub Narebski @ 2009-02-28  0:45 UTC (permalink / raw)
  To: git; +Cc: Jeff King, Tim Visher
In-Reply-To: <20090228002550.22597.53878.stgit@localhost.localdomain>

Gaah, this was meant to be reply to message by Peff
Message-ID: <20090226150013.GA9785@coredump.intra.peff.net>
in the "`./configure --XXdir=` ignored?" thread, but I mis-pasted
reply-to id.

Jakub Narebski <jnareb@gmail.com> writes:
> -- >8 --
> Now that we actually (can) install some info files, and that $infodir
> is set and used in Makefile(s), let add support for --infodir=DIR
> [PREFIX/info] ./configure option in config.mak.in.
> 
> Half of patch by Jeff King <peff@peff.net>m adding --XXdir support 

That was of course meant to be s/>m/>,/

Half of patch by Jeff King <peff@peff.net>, adding --XXdir support 

[...]
-- 
Jakub Narebski
Poland
ShadeHawk on #git

^ permalink raw reply

* [PATCH] gitk: make use of themed widgets where available
From: Pat Thoyts @ 2009-02-28  0:18 UTC (permalink / raw)
  To: git; +Cc: paulus


    This patch improves the appearence of gitk on Windows XP and Vista
    by making use of the themed widgets that are provided in Tk 8.5
    and above. For good Vista support 8.6 will be needed.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
---
 gitk |  432 ++++++++++++++++++++++++++++++++++++++++--------------------------
 1 files changed, 262 insertions(+), 170 deletions(-)

diff --git a/gitk b/gitk
index f8c3c73..2b5265a 100755
--- a/gitk
+++ b/gitk
@@ -1765,6 +1765,15 @@ proc removehead {id name} {
     unset headids($name)
 }
 
+proc ttk_toplevel {w args} {
+    variable use_ttk
+    eval [linsert $args 0 ::toplevel $w]
+    if {$use_ttk} {
+        place [ttk::frame $w._toplevel_background] -x 0 -y 0 -relwidth 1 -relheight 1
+    }
+    return $w
+}
+
 proc make_transient {window origin} {
     global have_tk85
 
@@ -1784,14 +1793,16 @@ proc make_transient {window origin} {
 }
 
 proc show_error {w top msg} {
+    variable use_ttk
+    set ttk [expr {$use_ttk ? "ttk" : ""}]
     message $w.m -text $msg -justify center -aspect 400
     pack $w.m -side top -fill x -padx 20 -pady 20
-    button $w.ok -text [mc OK] -command "destroy $top"
+    ${ttk}::button $w.ok -default active -text [mc OK] -command "destroy $top"
     pack $w.ok -side bottom -fill x
     bind $top <Visibility> "grab $top; focus $top"
-    bind $top <Key-Return> "destroy $top"
-    bind $top <Key-space>  "destroy $top"
-    bind $top <Key-Escape> "destroy $top"
+    bind $top <Key-Return> [list $w.ok invoke]
+    bind $top <Key-space>  [list $w.ok invoke]
+    bind $top <Key-Escape> [list $w.ok invoke]
     tkwait window $top
 }
 
@@ -1801,18 +1812,29 @@ proc error_popup {msg {owner .}} {
             -parent $owner -message $msg
     } else {
         set w .error
-        toplevel $w
+        ttk_toplevel $w
         make_transient $w $owner
         show_error $w $w $msg
     }
 }
 
+variable fullscreen 0
+proc togglefullscreen {} {
+    variable fullscreen
+    if {[catch {
+        set ofs [wm attribute . -fullscreen]
+        if {$ofs} {set fs 0} else {set fs 1}
+        wm attribute . -fullscreen $fs
+        set fullscreen $fs
+    } err]} { error_popup "fullscreen error: $err" }
+}
+
 proc confirm_popup {msg {owner .}} {
     global confirm_ok use_ttk
     set ttk [expr {$use_ttk ? "ttk" : ""}]
     set confirm_ok 0
     set w .confirm
-    toplevel $w
+    ttk_toplevel $w
     make_transient $w $owner
     message $w.m -text $msg -justify center -aspect 400
     pack $w.m -side top -fill x -padx 20 -pady 20
@@ -1853,11 +1875,18 @@ proc setoptions {} {
 # description depends on type; it's the sublist for cascade, the
 # command to invoke for command, or {variable value} for radiobutton
 proc makemenu {m items} {
-    menu $m
-    if {[tk windowingsystem] eq {aqua}} {
-	set Meta1 Cmd
-    } else {
-	set Meta1 Ctrl
+    set Meta1 Ctrl
+    switch -exact -- [tk windowingsystem] {
+        win32 {
+            menu $m -tearoff 0
+        }
+        aqua {
+            menu $m
+            set Meta1 Cmd
+        }
+        default {
+            menu $m
+        }
     }
     foreach i $items {
 	set name [mc [lindex $i 1]]
@@ -1913,7 +1942,8 @@ proc makewindow {} {
     global headctxmenu progresscanv progressitem progresscoords statusw
     global fprogitem fprogcoord lastprogupdate progupdatepending
     global rprogitem rprogcoord rownumsel numcommits
-    global have_tk85
+    global have_tk85 use_ttk
+    set ttk [expr {$use_ttk ? "ttk" : ""}]
 
     # The "mc" arguments here are purely so that xgettext
     # sees the following string as needing to be translated
@@ -1945,8 +1975,10 @@ proc makewindow {} {
     }
     . configure -menu .bar
 
+    place [${ttk}::frame ._main_background] -x 0 -y 0 -relwidth 1 -relheight 1
+
     # the gui has upper and lower half, parts of a paned window.
-    panedwindow .ctop -orient vertical
+    ${ttk}::panedwindow .ctop -orient vertical
 
     # possibly use assumed geometry
     if {![info exists geometry(pwsash0)]} {
@@ -1954,46 +1986,56 @@ proc makewindow {} {
         set geometry(topwidth) [expr {80 * $charspc}]
         set geometry(botheight) [expr {15 * $linespc}]
         set geometry(botwidth) [expr {50 * $charspc}]
-        set geometry(pwsash0) "[expr {40 * $charspc}] 2"
-        set geometry(pwsash1) "[expr {60 * $charspc}] 2"
+        set geometry(pwsash0) [list [expr {40 * $charspc}] 2]
+        set geometry(pwsash1) [list [expr {60 * $charspc}] 2]
     }
 
     # the upper half will have a paned window, a scroll bar to the right, and some stuff below
-    frame .tf -height $geometry(topheight) -width $geometry(topwidth)
-    frame .tf.histframe
-    panedwindow .tf.histframe.pwclist -orient horizontal -sashpad 0 -handlesize 4
+    ${ttk}::frame .tf -height $geometry(topheight) -width $geometry(topwidth)
+    ${ttk}::frame .tf.histframe
+    ${ttk}::panedwindow .tf.histframe.pwclist -orient horizontal 
+    if {!$use_ttk} {
+        .tf.histframe.pwclist configure -sashpad 0 -handlesize 4
+    }
 
     # create three canvases
     set cscroll .tf.histframe.csb
     set canv .tf.histframe.pwclist.canv
     canvas $canv \
 	-selectbackground $selectbgcolor \
-	-background $bgcolor -bd 0 \
-	-yscrollincr $linespc -yscrollcommand "scrollcanv $cscroll"
+	-background $bgcolor -borderwidth 0 \
+	-yscrollincrement $linespc -yscrollcommand "scrollcanv $cscroll"
     .tf.histframe.pwclist add $canv
     set canv2 .tf.histframe.pwclist.canv2
     canvas $canv2 \
 	-selectbackground $selectbgcolor \
-	-background $bgcolor -bd 0 -yscrollincr $linespc
+	-background $bgcolor -borderwidth 0 -yscrollincrement $linespc
     .tf.histframe.pwclist add $canv2
     set canv3 .tf.histframe.pwclist.canv3
     canvas $canv3 \
 	-selectbackground $selectbgcolor \
-	-background $bgcolor -bd 0 -yscrollincr $linespc
+	-background $bgcolor -borderwidth 0 -yscrollincrement $linespc
     .tf.histframe.pwclist add $canv3
-    eval .tf.histframe.pwclist sash place 0 $geometry(pwsash0)
-    eval .tf.histframe.pwclist sash place 1 $geometry(pwsash1)
+    if {$use_ttk} {
+        #set p1 [expr {[winfo screenwidth .] - (40 * $charspc)}]
+        #set p0 [expr {[winfo screenwidth .] - (100 * $charspc)}]
+        #.tf.histframe.pwclist sashpos 0 585
+        #.tf.histframe.pwclist sashpos 1 868
+     } else {
+        eval .tf.histframe.pwclist sash place 0 $geometry(pwsash0)
+        eval .tf.histframe.pwclist sash place 1 $geometry(pwsash1)
+    }
 
     # a scroll bar to rule them
-    scrollbar $cscroll -command {allcanvs yview} -highlightthickness 0
+    ${ttk}::scrollbar $cscroll -command {allcanvs yview} ;#-highlightthickness 0
     pack $cscroll -side right -fill y
     bind .tf.histframe.pwclist <Configure> {resizeclistpanes %W %w}
     lappend bglist $canv $canv2 $canv3
     pack .tf.histframe.pwclist -fill both -expand 1 -side left
 
     # we have two button bars at bottom of top frame. Bar 1
-    frame .tf.bar
-    frame .tf.lbar -height 15
+    ${ttk}::frame .tf.bar
+    ${ttk}::frame .tf.lbar -height 15
 
     set sha1entry .tf.bar.sha1
     set entries $sha1entry
@@ -2002,7 +2044,7 @@ proc makewindow {} {
 	-command gotocommit -width 8
     $sha1but conf -disabledforeground [$sha1but cget -foreground]
     pack .tf.bar.sha1label -side left
-    entry $sha1entry -width 40 -font textfont -textvariable sha1string
+    ${ttk}::entry $sha1entry -width 40 -font textfont -textvariable sha1string
     trace add variable sha1string write sha1change
     pack $sha1entry -side left -pady 2
 
@@ -2029,12 +2071,12 @@ proc makewindow {} {
 	-state disabled -width 26
     pack .tf.bar.rightbut -side left -fill y
 
-    label .tf.bar.rowlabel -text [mc "Row"]
+    ${ttk}::label .tf.bar.rowlabel -text [mc "Row"]
     set rownumsel {}
-    label .tf.bar.rownum -width 7 -font textfont -textvariable rownumsel \
+    ${ttk}::label .tf.bar.rownum -width 7 -font textfont -textvariable rownumsel \
 	-relief sunken -anchor e
-    label .tf.bar.rowlabel2 -text "/"
-    label .tf.bar.numcommits -width 7 -font textfont -textvariable numcommits \
+    ${ttk}::label .tf.bar.rowlabel2 -text "/"
+    ${ttk}::label .tf.bar.numcommits -width 7 -font textfont -textvariable numcommits \
 	-relief sunken -anchor e
     pack .tf.bar.rowlabel .tf.bar.rownum .tf.bar.rowlabel2 .tf.bar.numcommits \
 	-side left
@@ -2043,7 +2085,7 @@ proc makewindow {} {
 
     # Status label and progress bar
     set statusw .tf.bar.status
-    label $statusw -width 15 -relief sunken
+    ${ttk}::label $statusw -width 15 -relief sunken
     pack $statusw -side left -padx 5
     set h [expr {[font metrics uifont -linespace] + 2}]
     set progresscanv .tf.bar.progress
@@ -2060,32 +2102,52 @@ proc makewindow {} {
     set progupdatepending 0
 
     # build up the bottom bar of upper window
-    label .tf.lbar.flabel -text "[mc "Find"] "
-    button .tf.lbar.fnext -text [mc "next"] -command {dofind 1 1}
-    button .tf.lbar.fprev -text [mc "prev"] -command {dofind -1 1}
-    label .tf.lbar.flab2 -text " [mc "commit"] "
+    ${ttk}::label .tf.lbar.flabel -text "[mc "Find"] "
+    ${ttk}::button .tf.lbar.fnext -text [mc "next"] -command {dofind 1 1}
+    ${ttk}::button .tf.lbar.fprev -text [mc "prev"] -command {dofind -1 1}
+    ${ttk}::label .tf.lbar.flab2 -text " [mc "commit"] "
     pack .tf.lbar.flabel .tf.lbar.fnext .tf.lbar.fprev .tf.lbar.flab2 \
 	-side left -fill y
     set gdttype [mc "containing:"]
-    set gm [tk_optionMenu .tf.lbar.gdttype gdttype \
-		[mc "containing:"] \
-		[mc "touching paths:"] \
-		[mc "adding/removing string:"]]
+    if {$use_ttk} {
+        set values [list [mc "containing:"] [mc "touching paths:"] \
+                        [mc "adding/removing string:"]]
+        set gm [ttk::combobox .tf.lbar.gdttype -width 10\
+                    -values $values -textvariable gdtype]
+    } else {
+        set gm [tk_optionMenu .tf.lbar.gdttype gdttype \
+                    [mc "containing:"] \
+                    [mc "touching paths:"] \
+                    [mc "adding/removing string:"]]
+    }
     trace add variable gdttype write gdttype_change
     pack .tf.lbar.gdttype -side left -fill y
 
     set findstring {}
     set fstring .tf.lbar.findstring
     lappend entries $fstring
-    entry $fstring -width 30 -font textfont -textvariable findstring
+    ${ttk}::entry $fstring -width 30 -font textfont -textvariable findstring
     trace add variable findstring write find_change
     set findtype [mc "Exact"]
-    set findtypemenu [tk_optionMenu .tf.lbar.findtype \
-		      findtype [mc "Exact"] [mc "IgnCase"] [mc "Regexp"]]
+    if {$use_ttk} {
+        set values [list [mc "Exact"] [mc "IgnCase"] [mc "Regexp"]]
+        ttk::combobox .tf.lbar.findtype -width 10 \
+            -values $values -textvariable findtype
+     } else {
+        set findtypemenu [tk_optionMenu .tf.lbar.findtype \
+                              findtype [mc "Exact"] [mc "IgnCase"] [mc "Regexp"]]
+    }
     trace add variable findtype write findcom_change
     set findloc [mc "All fields"]
-    tk_optionMenu .tf.lbar.findloc findloc [mc "All fields"] [mc "Headline"] \
-	[mc "Comments"] [mc "Author"] [mc "Committer"]
+    if {$use_ttk} {
+        set values [list [mc "All fields"] [mc "Headline"] \
+                        [mc "Comments"] [mc "Author"] [mc "Committer"]]
+        ttk::combobox .tf.lbar.findloc -width 10 \
+            -values $values -textvariable findloc
+    } else {
+        tk_optionMenu .tf.lbar.findloc findloc [mc "All fields"] [mc "Headline"] \
+            [mc "Comments"] [mc "Author"] [mc "Committer"]
+    }
     trace add variable findloc write find_change
     pack .tf.lbar.findloc -side right
     pack .tf.lbar.findtype -side right
@@ -2096,38 +2158,41 @@ proc makewindow {} {
     pack .tf.bar -in .tf -side bottom -fill x
     pack .tf.histframe -fill both -side top -expand 1
     .ctop add .tf
-    .ctop paneconfigure .tf -height $geometry(topheight)
-    .ctop paneconfigure .tf -width $geometry(topwidth)
+    if {!$use_ttk} {
+        .ctop paneconfigure .tf -height $geometry(topheight)
+        .ctop paneconfigure .tf -width $geometry(topwidth)
+    }
 
     # now build up the bottom
-    panedwindow .pwbottom -orient horizontal
+    ${ttk}::panedwindow .pwbottom -orient horizontal
 
     # lower left, a text box over search bar, scroll bar to the right
     # if we know window height, then that will set the lower text height, otherwise
     # we set lower text height which will drive window height
     if {[info exists geometry(main)]} {
-        frame .bleft -width $geometry(botwidth)
+        ${ttk}::frame .bleft -width $geometry(botwidth)
     } else {
-        frame .bleft -width $geometry(botwidth) -height $geometry(botheight)
+        ${ttk}::frame .bleft -width $geometry(botwidth) -height $geometry(botheight)
     }
-    frame .bleft.top
-    frame .bleft.mid
-    frame .bleft.bottom
+    ${ttk}::frame .bleft.top
+    ${ttk}::frame .bleft.mid
+    ${ttk}::frame .bleft.bottom
 
-    button .bleft.top.search -text [mc "Search"] -command dosearch
+    ${ttk}::button .bleft.top.search -text [mc "Search"] -command dosearch
     pack .bleft.top.search -side left -padx 5
     set sstring .bleft.top.sstring
-    entry $sstring -width 20 -font textfont -textvariable searchstring
+    variable searchstring ""
+    ${ttk}::entry $sstring -width 20 -font textfont -textvariable searchstring
     lappend entries $sstring
     trace add variable searchstring write incrsearch
     pack $sstring -side left -expand 1 -fill x
-    radiobutton .bleft.mid.diff -text [mc "Diff"] \
+    ${ttk}::radiobutton .bleft.mid.diff -text [mc "Diff"] \
 	-command changediffdisp -variable diffelide -value {0 0}
-    radiobutton .bleft.mid.old -text [mc "Old version"] \
+    ${ttk}::radiobutton .bleft.mid.old -text [mc "Old version"] \
 	-command changediffdisp -variable diffelide -value {0 1}
-    radiobutton .bleft.mid.new -text [mc "New version"] \
+    ${ttk}::radiobutton .bleft.mid.new -text [mc "New version"] \
 	-command changediffdisp -variable diffelide -value {1 0}
-    label .bleft.mid.labeldiffcontext -text "      [mc "Lines of context"]: "
+    ${ttk}::label .bleft.mid.labeldiffcontext -text "      [mc "Lines of context"]: "
     pack .bleft.mid.diff .bleft.mid.old .bleft.mid.new -side left
     spinbox .bleft.mid.diffcontext -width 5 -font textfont \
 	-from 1 -increment 1 -to 10000000 \
@@ -2137,7 +2202,7 @@ proc makewindow {} {
     trace add variable diffcontextstring write diffcontextchange
     lappend entries .bleft.mid.diffcontext
     pack .bleft.mid.labeldiffcontext .bleft.mid.diffcontext -side left
-    checkbutton .bleft.mid.ignspace -text [mc "Ignore space change"] \
+    ${ttk}::checkbutton .bleft.mid.ignspace -text [mc "Ignore space change"] \
 	-command changeignorespace -variable ignorespace
     pack .bleft.mid.ignspace -side left -padx 5
     set ctext .bleft.bottom.ctext
@@ -2148,9 +2213,8 @@ proc makewindow {} {
     if {$have_tk85} {
 	$ctext conf -tabstyle wordprocessor
     }
-    scrollbar .bleft.bottom.sb -command "$ctext yview"
-    scrollbar .bleft.bottom.sbhorizontal -command "$ctext xview" -orient h \
-	-width 10
+    ${ttk}::scrollbar .bleft.bottom.sb -command "$ctext yview"
+    ${ttk}::scrollbar .bleft.bottom.sbhorizontal -command "$ctext xview" -orient h
     pack .bleft.top -side top -fill x
     pack .bleft.mid -side top -fill x
     grid $ctext .bleft.bottom.sb -sticky nsew
@@ -2190,14 +2254,16 @@ proc makewindow {} {
     $ctext tag conf found -back yellow
 
     .pwbottom add .bleft
-    .pwbottom paneconfigure .bleft -width $geometry(botwidth)
+    if {!$use_ttk} {
+        .pwbottom paneconfigure .bleft -width $geometry(botwidth)
+    }
 
     # lower right
-    frame .bright
-    frame .bright.mode
-    radiobutton .bright.mode.patch -text [mc "Patch"] \
+    ${ttk}::frame .bright
+    ${ttk}::frame .bright.mode
+    ${ttk}::radiobutton .bright.mode.patch -text [mc "Patch"] \
 	-command reselectline -variable cmitmode -value "patch"
-    radiobutton .bright.mode.tree -text [mc "Tree"] \
+    ${ttk}::radiobutton .bright.mode.tree -text [mc "Tree"] \
 	-command reselectline -variable cmitmode -value "tree"
     grid .bright.mode.patch .bright.mode.tree -sticky ew
     pack .bright.mode -side top -fill x
@@ -2213,7 +2279,7 @@ proc makewindow {} {
 	-spacing1 1 -spacing3 1
     lappend bglist $cflist
     lappend fglist $cflist
-    scrollbar .bright.sb -command "$cflist yview"
+    ${ttk}::scrollbar .bright.sb -command "$cflist yview"
     pack .bright.sb -side right -fill y
     pack $cflist -side left -fill both -expand 1
     $cflist tag configure highlight \
@@ -2293,6 +2359,7 @@ proc makewindow {} {
     bindkey u "$ctext yview scroll -18 units"
     bindkey / {focus $fstring}
     bindkey <Key-Return> {dofind 1 1}
+    bindkey <Alt-Return> [namespace code [list togglefullscreen]]
     bindkey ? {dofind -1 1}
     bindkey f nextfile
     bind . <F5> updatecommits
@@ -2540,10 +2607,15 @@ proc savestuff {w} {
 }
 
 proc resizeclistpanes {win w} {
-    global oldwidth
+    global oldwidth use_ttk
     if {[info exists oldwidth($win)]} {
-	set s0 [$win sash coord 0]
-	set s1 [$win sash coord 1]
+        if {$use_ttk} {
+            set s0 [$win sashpos 0]
+            set s1 [$win sashpos 1]
+        } else {
+            set s0 [$win sash coord 0]
+            set s1 [$win sash coord 1]
+        }
 	if {$w < 60} {
 	    set sash0 [expr {int($w/2 - 2)}]
 	    set sash1 [expr {int($w*5/6 - 2)}]
@@ -2564,16 +2636,25 @@ proc resizeclistpanes {win w} {
 		}
 	    }
 	}
-	$win sash place 0 $sash0 [lindex $s0 1]
-	$win sash place 1 $sash1 [lindex $s1 1]
+        if {$use_ttk} {
+            $win sashpos 0 $sash0
+            $win sashpos 1 $sash1
+        } else {
+            $win sash place 0 $sash0 [lindex $s0 1]
+            $win sash place 1 $sash1 [lindex $s1 1]
+        }
     }
     set oldwidth($win) $w
 }
 
 proc resizecdetpanes {win w} {
-    global oldwidth
+    global oldwidth use_ttk
     if {[info exists oldwidth($win)]} {
-	set s0 [$win sash coord 0]
+        if {$use_ttk} {
+            set s0 [$win sashpos 0]
+        } else {
+            set s0 [$win sash coord 0]
+        }
 	if {$w < 60} {
 	    set sash0 [expr {int($w*3/4 - 2)}]
 	} else {
@@ -2586,7 +2667,11 @@ proc resizecdetpanes {win w} {
 		set sash0 [expr {$w - 15}]
 	    }
 	}
-	$win sash place 0 $sash0 [lindex $s0 1]
+        if {$use_ttk} {
+            $win sashpos 0 $sash0
+        } else {
+            $win sash place 0 $sash0 [lindex $s0 1]
+        }
     }
     set oldwidth($win) $w
 }
@@ -2606,13 +2691,15 @@ proc bindall {event action} {
 }
 
 proc about {} {
-    global uifont
+    global uifont use_ttk
+    set ttk [expr {$use_ttk ? "ttk" : ""}]
     set w .about
     if {[winfo exists $w]} {
 	raise $w
 	return
     }
-    toplevel $w
+    ttk_toplevel $w
+    wm withdraw $w
     wm title $w [mc "About gitk"]
     make_transient $w .
     message $w.m -text [mc "
@@ -2623,14 +2710,18 @@ Copyright © 2005-2008 Paul Mackerras
 Use and redistribute under the terms of the GNU General Public License"] \
 	    -justify center -aspect 400 -border 2 -bg white -relief groove
     pack $w.m -side top -fill x -padx 2 -pady 2
-    button $w.ok -text [mc "Close"] -command "destroy $w" -default active
+    ${ttk}::button $w.ok -text [mc "Close"] -command "destroy $w" -default active
     pack $w.ok -side bottom
     bind $w <Visibility> "focus $w.ok"
     bind $w <Key-Escape> "destroy $w"
     bind $w <Key-Return> "destroy $w"
+    tk::PlaceWindow $w widget .
+    wm deiconify $w
 }
 
 proc keys {} {
+    variable use_ttk
+    set ttk [expr {$use_ttk ? "ttk" : ""}]
     set w .keys
     if {[winfo exists $w]} {
 	raise $w
@@ -2641,7 +2732,7 @@ proc keys {} {
     } else {
 	set M1T Ctrl
     }
-    toplevel $w
+    ttk_toplevel $w
     wm title $w [mc "Gitk key bindings"]
     make_transient $w .
     message $w.m -text "
@@ -2685,7 +2776,7 @@ proc keys {} {
 " \
 	    -justify left -bg white -border 2 -relief groove
     pack $w.m -side top -fill both -padx 2 -pady 2
-    button $w.ok -text [mc "Close"] -command "destroy $w" -default active
+    ${ttk}::button $w.ok -text [mc "Close"] -command "destroy $w" -default active
     bind $w <Key-Escape> [list destroy $w]
     pack $w.ok -side bottom
     bind $w <Visibility> "focus $w.ok"
@@ -3750,16 +3841,17 @@ proc editview {} {
 
 proc vieweditor {top n title} {
     global newviewname newviewopts viewfiles bgcolor
-    global known_view_options
+    global known_view_options use_ttk
+    set ttk [expr {$use_ttk ? "ttk" : ""}]
 
-    toplevel $top
+    ttk_toplevel $top
     wm title $top $title
     make_transient $top .
 
     # View name
-    frame $top.nfr
-    label $top.nl -text [mc "Name"]
-    entry $top.name -width 20 -textvariable newviewname($n)
+    ${ttk}::frame $top.nfr
+    ${ttk}::label $top.nl -text [mc "Name"]
+    ${ttk}::entry $top.name -width 20 -textvariable newviewname($n)
     pack $top.nfr -in $top -fill x -pady 5 -padx 3
     pack $top.nl -in $top.nfr -side left -padx {0 30}
     pack $top.name -in $top.nfr -side left
@@ -3778,7 +3870,7 @@ proc vieweditor {top n title} {
 	if {$flags eq "+" || $flags eq "*"} {
 	    set cframe $top.fr$cnt
 	    incr cnt
-	    frame $cframe
+	    ${ttk}::frame $cframe
 	    pack $cframe -in $top -fill x -pady 3 -padx 3
 	    set cexpand [expr {$flags eq "*"}]
 	} else {
@@ -3786,18 +3878,18 @@ proc vieweditor {top n title} {
 	}
 
 	if {$type eq "b"} {
-	    checkbutton $cframe.c_$id -text $title -variable newviewopts($n,$id)
+	    ${ttk}::checkbutton $cframe.c_$id -text $title -variable newviewopts($n,$id)
 	    pack $cframe.c_$id -in $cframe -side left \
 		-padx [list $lxpad 0] -expand $cexpand -anchor w
 	} elseif {[regexp {^t(\d+)$} $type type sz]} {
-	    message $cframe.l_$id -aspect 1500 -text $title
-	    entry $cframe.e_$id -width $sz -background $bgcolor \
+            ${ttk}::label $cframe.l_$id -text $title
+	    ${ttk}::entry $cframe.e_$id -width $sz -background $bgcolor \
 		-textvariable newviewopts($n,$id)
 	    pack $cframe.l_$id -in $cframe -side left -padx [list $lxpad 0]
 	    pack $cframe.e_$id -in $cframe -side left -expand 1 -fill x
 	} elseif {[regexp {^t(\d+)=$} $type type sz]} {
-	    message $cframe.l_$id -aspect 1500 -text $title
-	    entry $cframe.e_$id -width $sz -background $bgcolor \
+            ${ttk}::label $cframe.l_$id -text $title
+	    ${ttk}::entry $cframe.e_$id -width $sz -background $bgcolor \
 		-textvariable newviewopts($n,$id)
 	    pack $cframe.l_$id -in $cframe -side top -pady [list 3 0] -anchor w
 	    pack $cframe.e_$id -in $cframe -side top -fill x
@@ -3805,7 +3897,7 @@ proc vieweditor {top n title} {
     }
 
     # Path list
-    message $top.l -aspect 1500 \
+    ${ttk}::label $top.l \
 	-text [mc "Enter files and directories to include, one per line:"]
     pack $top.l -in $top -side top -pady [list 7 0] -anchor w -padx 3
     text $top.t -width 40 -height 5 -background $bgcolor -font uifont
@@ -3818,10 +3910,11 @@ proc vieweditor {top n title} {
 	$top.t mark set insert 0.0
     }
     pack $top.t -in $top -side top -pady [list 0 5] -fill both -expand 1 -padx 3
-    frame $top.buts
-    button $top.buts.ok -text [mc "OK"] -command [list newviewok $top $n]
-    button $top.buts.apply -text [mc "Apply (F5)"] -command [list newviewok $top $n 1]
-    button $top.buts.can -text [mc "Cancel"] -command [list destroy $top]
+    ${ttk}::frame $top.buts
+    ${ttk}::button $top.buts.ok -text [mc "OK"] -command [list newviewok $top $n] \
+        -default active
+    ${ttk}::button $top.buts.apply -text [mc "Apply (F5)"] -command [list newviewok $top $n 1]
+    ${ttk}::button $top.buts.can -text [mc "Cancel"] -command [list destroy $top]
     bind $top <Control-Return> [list newviewok $top $n]
     bind $top <F5> [list newviewok $top $n 1]
     bind $top <Escape> [list destroy $top]
@@ -6665,8 +6758,7 @@ proc selectline {l isnew {desired_loc {}}} {
     $sha1entry delete 0 end
     $sha1entry insert 0 $id
     if {$autoselect} {
-	$sha1entry selection from 0
-	$sha1entry selection to end
+	$sha1entry selection range 0 end
     }
     rhighlight_sel $id
 
@@ -8043,7 +8135,8 @@ proc doseldiff {oldid newid} {
 }
 
 proc mkpatch {} {
-    global rowmenuid currentid commitinfo patchtop patchnum
+    global rowmenuid currentid commitinfo patchtop patchnum use_ttk
+    set ttk [expr {$use_ttk ? "ttk" : ""}]
 
     if {![info exists currentid]} return
     set oldid $currentid
@@ -8053,38 +8146,38 @@ proc mkpatch {} {
     set top .patch
     set patchtop $top
     catch {destroy $top}
-    toplevel $top
+    ttk_toplevel $top
     make_transient $top .
-    label $top.title -text [mc "Generate patch"]
+    ${ttk}::label $top.title -text [mc "Generate patch"]
     grid $top.title - -pady 10
-    label $top.from -text [mc "From:"]
-    entry $top.fromsha1 -width 40 -relief flat
+    ${ttk}::label $top.from -text [mc "From:"]
+    ${ttk}::entry $top.fromsha1 -width 40 ;#-relief flat
     $top.fromsha1 insert 0 $oldid
     $top.fromsha1 conf -state readonly
     grid $top.from $top.fromsha1 -sticky w
-    entry $top.fromhead -width 60 -relief flat
+    ${ttk}::entry $top.fromhead -width 60 ;#-relief flat
     $top.fromhead insert 0 $oldhead
     $top.fromhead conf -state readonly
     grid x $top.fromhead -sticky w
-    label $top.to -text [mc "To:"]
-    entry $top.tosha1 -width 40 -relief flat
+    ${ttk}::label $top.to -text [mc "To:"]
+    ${ttk}::entry $top.tosha1 -width 40 ;#-relief flat
     $top.tosha1 insert 0 $newid
     $top.tosha1 conf -state readonly
     grid $top.to $top.tosha1 -sticky w
-    entry $top.tohead -width 60 -relief flat
+    ${ttk}::entry $top.tohead -width 60 ;#-relief flat
     $top.tohead insert 0 $newhead
-    $top.tohead conf -state readonly
+    $top.tohead configure -state readonly
     grid x $top.tohead -sticky w
-    button $top.rev -text [mc "Reverse"] -command mkpatchrev -padx 5
-    grid $top.rev x -pady 10
-    label $top.flab -text [mc "Output file:"]
-    entry $top.fname -width 60
+    ${ttk}::button $top.rev -text [mc "Reverse"] -command mkpatchrev
+    grid $top.rev x -pady 10 -padx 5
+    ${ttk}::label $top.flab -text [mc "Output file:"]
+    ${ttk}::entry $top.fname -width 60
     $top.fname insert 0 [file normalize "patch$patchnum.patch"]
     incr patchnum
     grid $top.flab $top.fname -sticky w
-    frame $top.buts
-    button $top.buts.gen -text [mc "Generate"] -command mkpatchgo
-    button $top.buts.can -text [mc "Cancel"] -command mkpatchcan
+    ${ttk}::frame $top.buts
+    ${ttk}::button $top.buts.gen -text [mc "Generate"] -command mkpatchgo
+    ${ttk}::button $top.buts.can -text [mc "Cancel"] -command mkpatchcan
     bind $top <Key-Return> mkpatchgo
     bind $top <Key-Escape> mkpatchcan
     grid $top.buts.gen $top.buts.can
@@ -8140,7 +8233,7 @@ proc mktag {} {
     set top .maketag
     set mktagtop $top
     catch {destroy $top}
-    toplevel $top
+    ttk_toplevel $top
     make_transient $top .
     label $top.title -text [mc "Create tag"]
     grid $top.title - -pady 10
@@ -8243,7 +8336,7 @@ proc writecommit {} {
     set top .writecommit
     set wrcomtop $top
     catch {destroy $top}
-    toplevel $top
+    ttk_toplevel $top
     make_transient $top .
     label $top.title -text [mc "Write commit to file"]
     grid $top.title - -pady 10
@@ -8300,7 +8393,7 @@ proc mkbranch {} {
 
     set top .makebranch
     catch {destroy $top}
-    toplevel $top
+    ttk_toplevel $top
     make_transient $top .
     label $top.title -text [mc "Create new branch"]
     grid $top.title - -pady 10
@@ -8463,7 +8556,7 @@ proc resethead {} {
 
     set confirm_ok 0
     set w ".confirmreset"
-    toplevel $w
+    ttk_toplevel $w
     make_transient $w .
     wm title $w [mc "Confirm reset"]
     message $w.m -text \
@@ -8644,7 +8737,7 @@ proc showrefs {} {
 	refill_reflist
 	return
     }
-    toplevel $top
+    ttk_toplevel $top
     wm title $top [mc "Tags and heads: %s" [file tail [pwd]]]
     make_transient $top .
     text $top.list -background $bgcolor -foreground $fgcolor \
@@ -9987,7 +10080,7 @@ proc choosefont {font which} {
     if {![winfo exists $top]} {
 	font create sample
 	eval font config sample [font actual $font]
-	toplevel $top
+	ttk_toplevel $top
 	make_transient $top $prefstop
 	wm title $top [mc "Gitk font chooser"]
 	label $top.l -textvariable fontparam(which)
@@ -10088,10 +10181,11 @@ proc chg_fontparam {v sub op} {
 }
 
 proc doprefs {} {
-    global maxwidth maxgraphpct
+    global maxwidth maxgraphpct use_ttk
     global oldprefs prefstop showneartags showlocalchanges
     global bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
     global tabstop limitdiffs autoselect extdifftool perfile_attrs
+    set ttk [expr {$use_ttk ? "ttk" : ""}]
 
     set top .gitkprefs
     set prefstop $top
@@ -10103,97 +10197,95 @@ proc doprefs {} {
 		   limitdiffs tabstop perfile_attrs} {
 	set oldprefs($v) [set $v]
     }
-    toplevel $top
+    ttk_toplevel $top
     wm title $top [mc "Gitk preferences"]
     make_transient $top .
-    label $top.ldisp -text [mc "Commit list display options"]
+    ${ttk}::label $top.ldisp -text [mc "Commit list display options"]
     grid $top.ldisp - -sticky w -pady 10
-    label $top.spacer -text " "
-    label $top.maxwidthl -text [mc "Maximum graph width (lines)"] \
+    ${ttk}::label $top.spacer -text " "
+    ${ttk}::label $top.maxwidthl -text [mc "Maximum graph width (lines)"] \
 	-font optionfont
     spinbox $top.maxwidth -from 0 -to 100 -width 4 -textvariable maxwidth
     grid $top.spacer $top.maxwidthl $top.maxwidth -sticky w
-    label $top.maxpctl -text [mc "Maximum graph width (% of pane)"] \
+    ${ttk}::label $top.maxpctl -text [mc "Maximum graph width (% of pane)"] \
 	-font optionfont
     spinbox $top.maxpct -from 1 -to 100 -width 4 -textvariable maxgraphpct
     grid x $top.maxpctl $top.maxpct -sticky w
-    checkbutton $top.showlocal -text [mc "Show local changes"] \
-	-font optionfont -variable showlocalchanges
+    ${ttk}::checkbutton $top.showlocal -text [mc "Show local changes"] \
+	-variable showlocalchanges
     grid x $top.showlocal -sticky w
-    checkbutton $top.autoselect -text [mc "Auto-select SHA1"] \
-	-font optionfont -variable autoselect
+    ${ttk}::checkbutton $top.autoselect -text [mc "Auto-select SHA1"] \
+	-variable autoselect
     grid x $top.autoselect -sticky w
 
-    label $top.ddisp -text [mc "Diff display options"]
+    ${ttk}::label $top.ddisp -text [mc "Diff display options"]
     grid $top.ddisp - -sticky w -pady 10
-    label $top.tabstopl -text [mc "Tab spacing"] -font optionfont
+    ${ttk}::label $top.tabstopl -text [mc "Tab spacing"] -font optionfont
     spinbox $top.tabstop -from 1 -to 20 -width 4 -textvariable tabstop
     grid x $top.tabstopl $top.tabstop -sticky w
-    checkbutton $top.ntag -text [mc "Display nearby tags"] \
-	-font optionfont -variable showneartags
+    ${ttk}::checkbutton $top.ntag -text [mc "Display nearby tags"] \
+	-variable showneartags
     grid x $top.ntag -sticky w
-    checkbutton $top.ldiff -text [mc "Limit diffs to listed paths"] \
-	-font optionfont -variable limitdiffs
+    ${ttk}::checkbutton $top.ldiff -text [mc "Limit diffs to listed paths"] \
+	-variable limitdiffs
     grid x $top.ldiff -sticky w
-    checkbutton $top.lattr -text [mc "Support per-file encodings"] \
-	-font optionfont -variable perfile_attrs
+    ${ttk}::checkbutton $top.lattr -text [mc "Support per-file encodings"] \
+	-variable perfile_attrs
     grid x $top.lattr -sticky w
 
-    entry $top.extdifft -textvariable extdifftool
-    frame $top.extdifff
-    label $top.extdifff.l -text [mc "External diff tool" ] -font optionfont \
-	-padx 10
-    button $top.extdifff.b -text [mc "Choose..."] -font optionfont \
-	-command choose_extdiff
-    pack $top.extdifff.l $top.extdifff.b -side left
+    ${ttk}::entry $top.extdifft -textvariable extdifftool
+    ${ttk}::frame $top.extdifff
+    ${ttk}::label $top.extdifff.l -text [mc "External diff tool" ] -font optionfont
+    ${ttk}::button $top.extdifff.b -text [mc "Choose..."] -command choose_extdiff
+    pack $top.extdifff.l -padx 10 ; pack $top.extdifff.b -side left
     grid x $top.extdifff $top.extdifft -sticky w
 
-    label $top.cdisp -text [mc "Colors: press to choose"]
+    ${ttk}::label $top.cdisp -text [mc "Colors: press to choose"]
     grid $top.cdisp - -sticky w -pady 10
-    label $top.bg -padx 40 -relief sunk -background $bgcolor
-    button $top.bgbut -text [mc "Background"] -font optionfont \
+    ${ttk}::label $top.bg -relief sunk -background $bgcolor
+    ${ttk}::button $top.bgbut -text [mc "Background"] -font optionfont \
 	-command [list choosecolor bgcolor {} $top.bg [mc "background"] setbg]
     grid x $top.bgbut $top.bg -sticky w
-    label $top.fg -padx 40 -relief sunk -background $fgcolor
-    button $top.fgbut -text [mc "Foreground"] -font optionfont \
+    ${ttk}::label $top.fg -padx 40 -relief sunk -background $fgcolor
+    ${ttk}::button $top.fgbut -text [mc "Foreground"] -font optionfont \
 	-command [list choosecolor fgcolor {} $top.fg [mc "foreground"] setfg]
     grid x $top.fgbut $top.fg -sticky w
-    label $top.diffold -padx 40 -relief sunk -background [lindex $diffcolors 0]
-    button $top.diffoldbut -text [mc "Diff: old lines"] -font optionfont \
+    ${ttk}::label $top.diffold -padx 40 -relief sunk -background [lindex $diffcolors 0]
+    ${ttk}::button $top.diffoldbut -text [mc "Diff: old lines"] -font optionfont \
 	-command [list choosecolor diffcolors 0 $top.diffold [mc "diff old lines"] \
 		      [list $ctext tag conf d0 -foreground]]
     grid x $top.diffoldbut $top.diffold -sticky w
-    label $top.diffnew -padx 40 -relief sunk -background [lindex $diffcolors 1]
-    button $top.diffnewbut -text [mc "Diff: new lines"] -font optionfont \
+    ${ttk}::label $top.diffnew -padx 40 -relief sunk -background [lindex $diffcolors 1]
+    ${ttk}::button $top.diffnewbut -text [mc "Diff: new lines"] -font optionfont \
 	-command [list choosecolor diffcolors 1 $top.diffnew [mc "diff new lines"] \
 		      [list $ctext tag conf dresult -foreground]]
     grid x $top.diffnewbut $top.diffnew -sticky w
-    label $top.hunksep -padx 40 -relief sunk -background [lindex $diffcolors 2]
-    button $top.hunksepbut -text [mc "Diff: hunk header"] -font optionfont \
+    ${ttk}::label $top.hunksep -padx 40 -relief sunk -background [lindex $diffcolors 2]
+    ${ttk}::button $top.hunksepbut -text [mc "Diff: hunk header"] -font optionfont \
 	-command [list choosecolor diffcolors 2 $top.hunksep \
 		      [mc "diff hunk header"] \
 		      [list $ctext tag conf hunksep -foreground]]
     grid x $top.hunksepbut $top.hunksep -sticky w
-    label $top.markbgsep -padx 40 -relief sunk -background $markbgcolor
-    button $top.markbgbut -text [mc "Marked line bg"] -font optionfont \
+    ${ttk}::label $top.markbgsep -padx 40 -relief sunk -background $markbgcolor
+    ${ttk}::button $top.markbgbut -text [mc "Marked line bg"] -font optionfont \
 	-command [list choosecolor markbgcolor {} $top.markbgsep \
 		      [mc "marked line background"] \
 		      [list $ctext tag conf omark -background]]
     grid x $top.markbgbut $top.markbgsep -sticky w
-    label $top.selbgsep -padx 40 -relief sunk -background $selectbgcolor
-    button $top.selbgbut -text [mc "Select bg"] -font optionfont \
+    ${ttk}::label $top.selbgsep -padx 40 -relief sunk -background $selectbgcolor
+    ${ttk}::button $top.selbgbut -text [mc "Select bg"] -font optionfont \
 	-command [list choosecolor selectbgcolor {} $top.selbgsep [mc "background"] setselbg]
     grid x $top.selbgbut $top.selbgsep -sticky w
 
-    label $top.cfont -text [mc "Fonts: press to choose"]
+    ${ttk}::label $top.cfont -text [mc "Fonts: press to choose"]
     grid $top.cfont - -sticky w -pady 10
     mkfontdisp mainfont $top [mc "Main font"]
     mkfontdisp textfont $top [mc "Diff display font"]
     mkfontdisp uifont $top [mc "User interface font"]
 
-    frame $top.buts
-    button $top.buts.ok -text [mc "OK"] -command prefsok -default active
-    button $top.buts.can -text [mc "Cancel"] -command prefscan -default normal
+    ${ttk}::frame $top.buts
+    ${ttk}::button $top.buts.ok -text [mc "OK"] -command prefsok -default active
+    ${ttk}::button $top.buts.can -text [mc "Cancel"] -command prefscan -default normal
     bind $top <Key-Return> prefsok
     bind $top <Key-Escape> prefscan
     grid $top.buts.ok $top.buts.can
@@ -10791,11 +10883,11 @@ proc init {args} {
 
     # check that we can find a .git directory somewhere...
     if {[catch {set gitdir [gitdir]}]} {
-        show_error {} . [mc "Cannot find a git repository here."]
+        error_popup [mc "Cannot find a git repository here."]
         exit 1
     }
     if {![file isdirectory $gitdir]} {
-        show_error {} . [mc "Cannot find the git directory \"%s\"." $gitdir]
+        error_popup [mc "Cannot find the git directory \"%s\"." $gitdir]
         exit 1
     }
 
-- 
1.6.0.2.1172.ga5ed0

^ permalink raw reply related

* [PATCH] autoconf: Add support for --infodir
From: Jakub Narebski @ 2009-02-28  0:33 UTC (permalink / raw)
  To: git; +Cc: Jeff King, Tim Visher, Jakub Narebski
In-Reply-To: <Tim Visher <tim.visher@gmail.com>

On Thu, 26 Feb 2009, Jeff King wrote:
> On Thu, Feb 26, 2009 at 09:48:29AM -0500, Tim Visher wrote:
> 
>> I'm working on getting git 1.6.2-rc2 built.  I have a bin, man, info,
>> and html directory in my home folder that I'd like to use as the
>> defaults for git.  I attempted to do this through
>> 
>>     make configure
>>     ./configure --XXdir=/full/path/to/dir
>>     make all man info html
>>     make install install-man install-info install-html
>> 
>> But other than the binaries (and I'm not even totally convinced they
>> got in correctly) and the man pages, everything else seems to be
>> attempting to go to the typical places in /usr/local.
>> 
>> What am I doing wrong?

Why don't you use simply --prefix=DIR?

> 
> The configure support is notoriously incomplete (AFAIK, very few of the
> active developers use it regularly). Probably you need something like
> this (but I didn't test it):
> 
> diff --git a/config.mak.in b/config.mak.in
> index 7cce0c1..505d5c7 100644
> --- a/config.mak.in
> +++ b/config.mak.in
> @@ -18,6 +18,8 @@ datarootdir = @datarootdir@
>  template_dir = @datadir@/git-core/templates
>  
>  mandir=@mandir@
> +htmldir=@htmldir@
> +infodir=@infodir@
>  
>  srcdir = @srcdir@
>  VPATH = @srcdir@

Well, the infodir part works trivially, because autoconf (and
therefore ./configure script) has support for --infodir=DIR.
Below there is patch that adds that, with the commit message.

But it is more difficult with respect to --htmldir. I am not autoconf
hacker, so I don't know how to add support for having --htmldir=DIR in
./configure (in configure.ac).  What can be done is to derive htmldir
in config.mak.in from other sources, for example:

  htmldir=@datadir@/doc/git

or something like that.

-- >8 --
Now that we actually (can) install some info files, and that $infodir
is set and used in Makefile(s), let add support for --infodir=DIR
[PREFIX/info] ./configure option in config.mak.in.

Half of patch by Jeff King <peff@peff.net>m adding --XXdir support 
(the easy part: autoconf has --infodir, but not --htmldir).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
 config.mak.in |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/config.mak.in b/config.mak.in
index 7cce0c1..acff9ed 100644
--- a/config.mak.in
+++ b/config.mak.in
@@ -18,6 +18,7 @@ datarootdir = @datarootdir@
 template_dir = @datadir@/git-core/templates
 
 mandir=@mandir@
+infodir=@infodir@
 
 srcdir = @srcdir@
 VPATH = @srcdir@

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox