Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions git-gui/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ GIT-GUI-BUILD-OPTIONS
GIT-VERSION-FILE
git-gui
git-gui--askpass
git-gui--askyesno
lib/tclIndex
16 changes: 12 additions & 4 deletions git-gui/GIT-VERSION-GEN
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,27 @@ DEF_VER=0.21.GITGUI
LF='
'

if test "$#" -ne 2
if test "$#" -lt 2
then
echo >&2 "usage: $0 <SOURCE_DIR> <OUTPUT>"
echo >&2 "usage: $0 <SOURCE_DIR> <OUTPUT> [<PARENT_PROJECT_DIR>]"
exit 1
fi

SOURCE_DIR="$1"
OUTPUT="$2"
PARENT_PROJECT_DIR="$3"

# Protect us from reading Git version information outside of the Git directory
# in case it is not a repository itself, but embedded in an unrelated
# repository.
GIT_CEILING_DIRECTORIES="$SOURCE_DIR/.."
# repository. The PARENT_PROJECT_DIR variable can be used to override this, for
# example when git-gui is included as a subproject.
if test -n "$PARENT_PROJECT_DIR"
then
GIT_CEILING_DIRECTORIES="$PARENT_PROJECT_DIR/.."
else
GIT_CEILING_DIRECTORIES="$SOURCE_DIR/.."
fi

export GIT_CEILING_DIRECTORIES

tree_search ()
Expand Down
9 changes: 6 additions & 3 deletions git-gui/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ all::
#

GIT-VERSION-FILE: FORCE
@$(SHELL_PATH) ./GIT-VERSION-GEN . $@
@$(SHELL_PATH) ./GIT-VERSION-GEN . $@ "$(PARENT_PROJECT_DIR)"

uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not')
Expand Down Expand Up @@ -177,10 +177,13 @@ GIT-GUI-BUILD-OPTIONS: FORCE
git-gui--askpass: git-gui--askpass.sh GIT-GUI-BUILD-OPTIONS generate-script.sh
$(QUIET_GEN)$(SHELL_PATH) generate-script.sh $@ $< ./GIT-GUI-BUILD-OPTIONS

git-gui--askyesno: git-gui--askyesno.sh GIT-GUI-BUILD-OPTIONS generate-script.sh
$(QUIET_GEN)$(SHELL_PATH) generate-script.sh $@ $< ./GIT-GUI-BUILD-OPTIONS

ifdef GITGUI_WINDOWS_WRAPPER
all:: git-gui
endif
all:: $(GITGUI_MAIN) git-gui--askpass lib/tclIndex $(ALL_MSGFILES)
all:: $(GITGUI_MAIN) git-gui--askpass git-gui--askyesno lib/tclIndex $(ALL_MSGFILES)

install: all
$(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(gitexecdir_SQ)' $(INSTALL_D1)
Expand Down Expand Up @@ -221,7 +224,7 @@ dist-version: GIT-VERSION-FILE
@sed 's|^GITGUI_VERSION=||' <GIT-VERSION-FILE >$(TARDIR)/version

clean::
$(RM_RF) $(GITGUI_MAIN) git-gui--askpass lib/tclIndex po/*.msg $(PO_TEMPLATE)
$(RM_RF) $(GITGUI_MAIN) git-gui--askpass git-gui--askyesno lib/tclIndex po/*.msg $(PO_TEMPLATE)
$(RM_RF) GIT-VERSION-FILE GIT-GUI-BUILD-OPTIONS
ifdef GITGUI_WINDOWS_WRAPPER
$(RM_RF) git-gui
Expand Down
File renamed without changes.
18 changes: 18 additions & 0 deletions git-gui/git-gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3900,6 +3900,24 @@ if {[winfo exists $ui_comm]} {

backup_commit_buffer

# Grey out comment lines (which are stripped from the final commit message by
# wash_commit_message).
$ui_comm tag configure commit_comment -foreground gray
proc dim_commit_comment_lines {} {
global ui_comm comment_string
$ui_comm tag remove commit_comment 1.0 end
set text [$ui_comm get 1.0 end]
# See also cmt_rx in wash_commit_message
set cmt_rx [strcat {^} [regsub -all {\W} $comment_string {\\&}]]
set ranges [regexp -all -indices -inline -line -- $cmt_rx $text]
foreach pair $ranges {
set idx "1.0 + [lindex $pair 0] chars"
$ui_comm tag add commit_comment $idx "$idx lineend + 1 char"
}
}
dim_commit_comment_lines
bind $ui_comm <<Modified>> { after idle dim_commit_comment_lines }

# -- If the user has aspell available we can drive it
# in pipe mode to spellcheck the commit message.
#
Expand Down
2 changes: 2 additions & 0 deletions git-gui/lib/diff.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,8 @@ proc read_diff {fd conflict_size cont_info} {
#
if {[string match {@@@ *} $line]} {
set is_3way_diff 1
apply_tab_size 2
} elseif {[string match {@@ *} $line]} {
apply_tab_size 1
}

Expand Down
31 changes: 17 additions & 14 deletions git-gui/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project('git-gui',

fs = import('fs')

shell = find_program('sh')
shell = find_program('/bin/sh', 'sh')
tclsh = find_program('tclsh')
wish = find_program('wish')

Expand Down Expand Up @@ -34,6 +34,7 @@ version_file = custom_target(
'@INPUT@',
meson.current_source_dir(),
'@OUTPUT@',
get_option('parent_project_dir'),
],
build_always_stale: true,
)
Expand All @@ -53,19 +54,21 @@ if target_machine.system() == 'windows'
)
endif

custom_target(
output: 'git-gui--askpass',
input: 'git-gui--askpass.sh',
command: [
shell,
meson.current_source_dir() / 'generate-script.sh',
'@OUTPUT@',
'@INPUT@',
meson.current_build_dir() / 'GIT-GUI-BUILD-OPTIONS',
],
install: true,
install_dir: get_option('libexecdir') / 'git-core',
)
foreach script : [ 'git-gui--askpass', 'git-gui--askyesno' ]
custom_target(
output: script,
input: script + '.sh',
command: [
shell,
meson.current_source_dir() / 'generate-script.sh',
'@OUTPUT@',
'@INPUT@',
meson.current_build_dir() / 'GIT-GUI-BUILD-OPTIONS',
],
install: true,
install_dir: get_option('libexecdir') / 'git-core',
)
endforeach

custom_target(
input: 'git-gui.sh',
Expand Down
2 changes: 2 additions & 0 deletions git-gui/meson_options.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
option('parent_project_dir', type: 'string', value: '',
description: 'The directory of the parent project. This is used so that the version can be determined even in case git-gui is included as a subtree.')
1 change: 1 addition & 0 deletions gitk-git/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/GIT-TCLTK-VARS
/gitk-wish
po/gitk.pot
7 changes: 5 additions & 2 deletions gitk-git/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,12 @@ gitk-wish: gitk GIT-TCLTK-VARS
$(SHELL_PATH) ./generate-tcl.sh "$(TCLTK_PATH_SQ)" "$<" "$@"

$(PO_TEMPLATE): gitk
$(XGETTEXT) -kmc -LTcl -o $@ gitk
$(XGETTEXT) -kmc -LTcl --package-name=Gitk -o $@ gitk
update-po:: $(PO_TEMPLATE)
$(foreach p, $(ALL_POFILES), echo Updating $p ; msgmerge -U $p $(PO_TEMPLATE) ; )
$(foreach p, $(ALL_POFILES), echo Updating $p ; msgmerge -U --add-location $p $(PO_TEMPLATE) ; )
@echo "Before committing changes, ensure that a clean-filter is installed:"; \
echo; \
echo " git config filter.gettext-no-location.clean \"msgcat --no-location -\""
$(ALL_MSGFILES): %.msg : %.po
@echo Generating catalog $@
$(MSGFMT) --statistics --tcl -l $(basename $(notdir $<)) -d $(dir $@) $<
Expand Down
21 changes: 15 additions & 6 deletions gitk-git/gitk
Original file line number Diff line number Diff line change
Expand Up @@ -6831,16 +6831,18 @@ proc drawtags {id x xt y1} {
} else {
# draw a head or other ref
if {[incr nheads -1] >= 0} {
set col $headbgcolor
set refoutlinecol $headoutlinecolor
set reffillcol $headbgcolor
if {$tag eq $mainhead} {
set font mainfontbold
}
} else {
set col "#ddddff"
set refoutlinecol black
set reffillcol "#ddddff"
}
set xl [expr {$xl - $delta/2}]
$canv create polygon $x $yt $xr $yt $xr $yb $x $yb \
-width 1 -outline black -fill $col -tags tag.$id
-width 1 -outline $refoutlinecol -fill $reffillcol -tags tag.$id
if {[regexp {^(remotes/[^/]*/|remotes/)} $tag match remoteprefix]} {
set rwid [font measure mainfont $remoteprefix]
set xi [expr {$x + 1}]
Expand All @@ -6850,7 +6852,8 @@ proc drawtags {id x xt y1} {
-width 0 -fill $remotebgcolor -tags tag.$id
}
}
set t [$canv create text $xl $y1 -anchor w -text $tag -fill $headfgcolor \
set textfgcolor [expr {$ntags >= 0 ? $tagfgcolor : $headfgcolor}]
set t [$canv create text $xl $y1 -anchor w -text $tag -fill $textfgcolor \
-font $font -tags [list tag.$id text]]
if {$ntags >= 0} {
$canv bind $t <1> $tagclick
Expand Down Expand Up @@ -11796,7 +11799,7 @@ proc prefspage_general {notebook} {

proc prefspage_colors {notebook} {
global bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
global diffbgcolors
global diffbgcolors linkfgcolor
global themeloader

set page [create_prefs_page $notebook.colors]
Expand Down Expand Up @@ -11873,14 +11876,19 @@ proc prefspage_colors {notebook} {
-command [list choosecolor selectbgcolor {} $page [mc "background"]]
grid x $page.selbgbut $page.selbgsep -sticky w

label $page.linkfg -padx 40 -relief sunk -background $linkfgcolor
ttk::button $page.linkfgbut -text [mc "Link"] \
-command [list choosecolor linkfgcolor {} $page [mc "link"]]
grid x $page.linkfgbut $page.linkfg -sticky w

grid columnconfigure $page 2 -weight 1

return $page
}

proc prefspage_set_colorswatches {page} {
global bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
global diffbgcolors
global diffbgcolors linkfgcolor

$page.bg configure -background $bgcolor
$page.fg configure -background $fgcolor
Expand All @@ -11891,6 +11899,7 @@ proc prefspage_set_colorswatches {page} {
$page.hunksep configure -background [lindex $diffcolors 2]
$page.markbgsep configure -background $markbgcolor
$page.selbgsep configure -background $selectbgcolor
$page.linkfg configure -background $linkfgcolor
}

proc prefspage_fonts {notebook} {
Expand Down
1 change: 1 addition & 0 deletions gitk-git/po/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/*.po filter=gettext-no-location
2 changes: 1 addition & 1 deletion gitk-git/po/bg.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: gitk master\n"
"Project-Id-Version: Gitk master\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-07-22 18:34+0200\n"
"PO-Revision-Date: 2025-07-28 13:38+0200\n"
Expand Down
Loading