Skip to content

Commit f2457a6

Browse files
committed
Merge branch 'master' of https://github.com/j6t/gitk
* 'master' of https://github.com/j6t/gitk: gitk: add README with usage, build, and contribution details gitk: fix trackpad scrolling for Tcl/Tk 8.7+ gitk: use <Button-3> for ctx menus on macOS with Tcl 8.7+
2 parents 4975ec3 + ac8fec7 commit f2457a6

File tree

2 files changed

+118
-1
lines changed

2 files changed

+118
-1
lines changed

gitk-git/README.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
Gitk - The Git Repository Browser
2+
=================================
3+
4+
Gitk is a graphical Git repository browser. It displays the commit
5+
history of a Git repository as a graph, showing the relationships
6+
between commits, branches, and tags.
7+
8+
Usage
9+
=====
10+
11+
To view the history of the current repository:
12+
```bash
13+
gitk
14+
```
15+
16+
To view the history of specific files or directories:
17+
```bash
18+
gitk path/to/file
19+
gitk path/to/directory
20+
```
21+
22+
To view a specific branch or range of commits:
23+
```bash
24+
gitk branch-name
25+
gitk v1.0..v2.0
26+
```
27+
28+
For more usage examples and options, see the [gitk manual](https://git-scm.com/docs/gitk).
29+
30+
Building
31+
========
32+
33+
Gitk is a Tcl/Tk application. It requires Tcl/Tk to be installed on
34+
your system.
35+
36+
Running directly
37+
----------------
38+
39+
Gitk can be run from the source directory without installation:
40+
41+
```bash
42+
./gitk
43+
```
44+
45+
This allows for quick testing of changes.
46+
47+
Installation
48+
------------
49+
50+
To install system-wide, you can use either `make` or `meson`:
51+
52+
```bash
53+
# Install to default location ($HOME/bin)
54+
make install
55+
56+
# Install to system-wide location
57+
sudo make install prefix=/usr/local
58+
59+
# Install to custom location
60+
make install prefix=/opt/gitk
61+
62+
# Using Meson
63+
meson setup builddir
64+
meson compile -C builddir
65+
meson install -C builddir
66+
```
67+
68+
Both build systems will handle setting the correct Tcl/Tk interpreter
69+
path and installing translation files.
70+
71+
Contributing
72+
============
73+
74+
Contributions are welcome! The preferred method for submitting patches
75+
is via email to the Git mailing list, as this allows for more thorough
76+
review and broader community feedback. However, GitHub pull requests
77+
are also accepted.
78+
79+
All commits must be signed off (use `git commit --signoff`) and should
80+
have commit messages prefixed with `gitk:`.
81+
82+
Email Patches
83+
-------------
84+
85+
Send patches to [email protected] and CC [email protected]. See the Git
86+
project's [patch submission guidelines](https://git-scm.com/docs/SubmittingPatches)
87+
for detailed instructions on creating and sending patches.
88+
89+
License
90+
=======
91+
92+
Gitk is distributed under the GNU General Public License, either
93+
version 2, or (at your option) any later version.

gitk-git/gitk

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2301,6 +2301,11 @@ proc scrollval {D {koff 0}} {
23012301
return [expr int(-($D / $scroll_D0) * max(1, $kscroll-$koff))]
23022302
}
23032303
2304+
proc precisescrollval {D {koff 0}} {
2305+
global kscroll
2306+
return [expr (-($D / 10.0) * max(1, $kscroll-$koff))]
2307+
}
2308+
23042309
proc bind_mousewheel {} {
23052310
global canv cflist ctext
23062311
bindall <MouseWheel> {allcanvs yview scroll [scrollval %D] units}
@@ -2319,6 +2324,25 @@ proc bind_mousewheel {} {
23192324
bind $cflist <Alt-MouseWheel> {$cflist yview scroll [scrollval 5*%D 2] units}
23202325
bind $cflist <Alt-Shift-MouseWheel> break
23212326
bind $canv <Alt-Shift-MouseWheel> {$canv xview scroll [scrollval 5*%D] units}
2327+
2328+
bindall <TouchpadScroll> {
2329+
lassign [tk::PreciseScrollDeltas %D] deltaX deltaY
2330+
allcanvs yview scroll [precisescrollval $deltaY] units
2331+
}
2332+
bind $ctext <TouchpadScroll> {
2333+
lassign [tk::PreciseScrollDeltas %D] deltaX deltaY
2334+
$ctext yview scroll [precisescrollval $deltaY 2] units
2335+
$ctext xview scroll [precisescrollval $deltaX 2] units
2336+
}
2337+
bind $cflist <TouchpadScroll> {
2338+
lassign [tk::PreciseScrollDeltas %D] deltaX deltaY
2339+
$cflist yview scroll [precisescrollval $deltaY 2] units
2340+
}
2341+
bind $canv <TouchpadScroll> {
2342+
lassign [tk::PreciseScrollDeltas %D] deltaX deltaY
2343+
$canv xview scroll [precisescrollval $deltaX] units
2344+
allcanvs yview scroll [precisescrollval $deltaY] units
2345+
}
23222346
}
23232347
}
23242348
@@ -12596,7 +12620,7 @@ set foundbgcolor yellow
1259612620
set currentsearchhitbgcolor orange
1259712621
1259812622
# button for popping up context menus
12599-
if {[tk windowingsystem] eq "aqua"} {
12623+
if {[tk windowingsystem] eq "aqua" && [package vcompare $::tcl_version 8.7] < 0} {
1260012624
set ctxbut <Button-2>
1260112625
} else {
1260212626
set ctxbut <Button-3>

0 commit comments

Comments
 (0)