Code

git.git
12 years agogitk: Make "git describe" output clickable, too
Jim Meyering [Sat, 10 Dec 2011 15:08:57 +0000 (16:08 +0100)]
gitk: Make "git describe" output clickable, too

Automake's contribution guidelines suggest using "git describe" output
in commit logs to reference previous commits.  By contrast, in
coreutils, I had acquired the habit of using a bare SHA1 prefix (8 hex
digits), since gitk creates clickable links for that, and not for "git
describe" output.

I prefer the readability of the full "git describe" output, yet want
to retain the gitk links, so this renders as clickable not just
SHA1-like strings, but also an SHA1-like string that is prefixed by
"-g".

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
12 years agogitk: Fix the display of files when filtered by path
Pat Thoyts [Tue, 13 Dec 2011 16:50:50 +0000 (16:50 +0000)]
gitk: Fix the display of files when filtered by path

Launching 'gitk -- .' or 'gitk -- ..\t' restricts the display to files
under the given directory but the file list is left empty. This is because
the path_filter function fails to match the filenames which are relative
to the working tree to the filter which is filessytem relative.
This solves the problem by making both names fully qualified filesystem
paths before performing the comparison.

Tested-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
12 years agogitk: Use a tabbed dialog to edit preferences
Pat Thoyts [Tue, 13 Dec 2011 14:56:49 +0000 (14:56 +0000)]
gitk: Use a tabbed dialog to edit preferences

This commit converts the user preferences dialog into a tabbed property
sheet grouping general properties, colours and font selections onto
separate pages. The previous implementation was exceeding the screen
height on some systems and this avoids such problems and permits extension
using new pages in the future.

If themed Tk is unavailable or undesired a reasonable facsimile of the
tabbed notebook widget is used instead.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
12 years agogitk: Use "gitk: repo-top-level-dir" as window title
Zbigniew Jędrzejewski-Szmek [Wed, 9 Nov 2011 16:28:28 +0000 (17:28 +0100)]
gitk: Use "gitk: repo-top-level-dir" as window title

Previously, when run in a subdirectory, gitk would show the name
of this subdirectory as title, which was misleading. When run with
GIT_DIR set, it would show the cwd, which is even more misleading.

In case of non-bare repos, the .git suffix in the path is skipped.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
12 years agogitk: Make vi-style keybindings more vi-like
Jonathan Nieder [Mon, 19 Sep 2011 16:49:50 +0000 (11:49 -0500)]
gitk: Make vi-style keybindings more vi-like

When commit 6e2dda35 (Add new keybindings, 2005-09-22) added vi-style
keybindings to gitk (an excellent idea!), instead of adopting the
usual "hjkl = left, down, up, right" bindings used by less, vi, rogue,
and many other programs, it used "ijkl = up, left, down, right" to
mimic the inverted-T formation of the arrow keys on a qwerty keyboard,
in the style of Lode runner.  So using 'j' and 'k' to scroll through
commits produces utterly confusing results to the vi user, as 'k'
moves down and 'j' moves to the previous commit.

Luckily most non-vi-users are probably using an alternate set of keys
(cursor keys or z/x + n/p) anyway.  Switch to the expected vi/nethack
convention.

Requested-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
12 years agogitk: Make "touching paths" search support backslashes
Yggy King [Wed, 13 Jul 2011 08:30:26 +0000 (01:30 -0700)]
gitk: Make "touching paths" search support backslashes

Gitk can search for commits touching a specified path. The search text is
always treated as a regular expression, regardless of the matching option
selected (Exact, IgnCase, or Regexp). In particular, backslashes escape
the next character. This is inconvenient on Windows systems, where backslashes
are the norm for path specifiers, for example when copy/pasting from
Windows Explorer or a cmd shell -- these copy-pasted paths must be manually
modified in the gitk search text edit box before they will work.

This change uses the match option "Exact" to mean that a slash is a slash,
not part of a regular expression. Backslashes are converted to frontslashes
before searching, thus allowing easy copy/pasting of paths on Windows
systems. If the previous behaviour of "touching paths" search is desired,
simply select the "Regexp" search mode.

One potential drawback is that the default setting for the match option
($findtype in the code) is "Exact", and so this change alters the default
behaviour, which may confuse users and lead to bug reports.

Signed-off-by: Yggy King <yggy@zeroandone.ca>
Signed-off-by: Paul Mackerras <paulus@samba.org>
12 years agogitk: Show modified files with separate work tree
Martin von Zweigbergk [Tue, 24 May 2011 02:44:08 +0000 (22:44 -0400)]
gitk: Show modified files with separate work tree

"git rev-parse --is-inside-work-tree" is currently used to determine
whether to show modified files in gitk (the red and green fake
commits). This does not work if the current directory is not inside
the work tree, as can be the case e.g. if GIT_WORK_TREE is
set. Instead, check if the repository is not bare and that we are not
inside the .git directory.

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
12 years agogitk: Simplify calculation of gitdir
Martin von Zweigbergk [Tue, 5 Apr 2011 02:14:18 +0000 (22:14 -0400)]
gitk: Simplify calculation of gitdir

Since 5024baa ([PATCH] Make gitk work when launched in a subdirectory,
2007-01-09), gitk has used 'git rev-parse --git-dir' to find the .git
directory. However, gitk still first checks for the $GIT_DIR
environment variable and that the value returned from git-rev-parse
does not point to a file. Since git-rev-parse does both of these
checks already, the checks can safely be removed from gitk. This makes
the gitdir procedure small enough to inline.

This cleanup introduces a UI regression in that the error message will
now be "Cannot find a git repository here." even in the case where
GIT_DIR points to a file, for which the error message was previously
"Cannot find the git directory \"%s\".". It should be noted, though,
that even before this patch, 'gitk --git-dir=path/to/some/file' would
give the former error message.

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
12 years agogitk: Run 'git rev-parse --git-dir' only once
Martin von Zweigbergk [Tue, 5 Apr 2011 02:14:17 +0000 (22:14 -0400)]
gitk: Run 'git rev-parse --git-dir' only once

It seems like gitk has been setting the global variable 'gitdir' at
startup since aa81d97 (gitk: Fix Update menu item, 2006-02-28).  It
should therefore no longer be necessary to call the procedure with the
same name (more than once to set the global variable).  Remove the
other call sites and use the global variable instead.

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
12 years agogitk: Put temporary directory inside .git
Martin von Zweigbergk [Tue, 5 Apr 2011 02:14:16 +0000 (22:14 -0400)]
gitk: Put temporary directory inside .git

When running "External diff" from gitk, the "from" and "to" files will
first be copied into a directory that is currently
".git/../.gitk-tmp.$pid".  When gitk is closed, the directory is
deleted. When the work tree is not at ".git/.." (which is supported
since the previous commit), that directory may not even be git-related
and it does not seem unlikely that permissions may not allow the
temporary directory to be created there.  Move the directory inside
.git instead.

This introduces a regression in the case that the .git directory
is readonly, but .git/.. is writeable.

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
12 years agogitk: Fix "External diff" with separate work tree
Martin von Zweigbergk [Tue, 5 Apr 2011 02:14:15 +0000 (22:14 -0400)]
gitk: Fix "External diff" with separate work tree

Running "External diff" to compare the index and work tree currently
brings up an empty blame view when the work tree is not the parent of
the git directory.  This is because the file that is taken from the
work tree is assumed to be in
$GIT_DIR/../<repo-relative-file-name>.  Fix it by feeding the diff tool
a path under $GIT_WORK_TREE instead of "$GIT_DIR/..".

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
12 years agogitk: Fix "blame parent commit" with separate work tree
Martin von Zweigbergk [Tue, 5 Apr 2011 02:14:14 +0000 (22:14 -0400)]
gitk: Fix "blame parent commit" with separate work tree

Running "blame parent commit" currently brings up an empty blame view
when the the work tree is not the parent of the git directory.  Fix it
by feeding git-blame paths relative to $GIT_WORK_TREE instead of
"$GIT_DIR/..".

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
12 years agogitk: Fix "show origin of this line" with separate work tree
Martin von Zweigbergk [Tue, 5 Apr 2011 02:14:13 +0000 (22:14 -0400)]
gitk: Fix "show origin of this line" with separate work tree

Running "show origin of this line" currently fails when the the work
tree is not the parent of the git directory.  Fix it by feeding
git-blame paths relative to $GIT_WORK_TREE instead of "$GIT_DIR/..".

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
12 years agogitk: Fix file highlight when run in subdirectory
Martin von Zweigbergk [Tue, 5 Apr 2011 02:14:12 +0000 (22:14 -0400)]
gitk: Fix file highlight when run in subdirectory

The "highlight this only" and "highlight this too" commands in gitk
add the path relative to $GIT_WORK_TREE to the "Find" input box. When
the search (using git-diff-tree) is run, the paths are used
unmodified, except for some shell escaping. Since the search is run
from gitk's working directory, no commits matching the paths will be
found if gitk was started in a subdirectory.

Make the paths passed to git-diff-tree relative to gitk's working
directory instead of being relative to $GIT_WORK_TREE. If, however,
gitk is run outside of the working directory (e.g. with $GIT_WORK_TREE
set), we still need to use the path relative to $GIT_WORK_TREE.

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
12 years agogitk: Update copyright
Paul Mackerras [Sun, 24 Jul 2011 05:34:48 +0000 (15:34 +1000)]
gitk: Update copyright

Signed-off-by: Paul Mackerras <paulus@samba.org>
12 years agogitk: When a commit contains a note, mark it with a yellow box
Raphael Zimmerer [Tue, 19 Apr 2011 20:37:09 +0000 (22:37 +0200)]
gitk: When a commit contains a note, mark it with a yellow box

It is desirable to see at a glance which commits do contain notes.
Therefore mark them with a yellow rectangle.

That can be suppressed with `gitk --no-notes`.

Signed-off-by: Raphael Zimmerer <killekulla@rdrz.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
12 years agogitk: Remember time zones from author and commit timestamps
Anders Kaseorg [Wed, 19 Jan 2011 19:47:25 +0000 (14:47 -0500)]
gitk: Remember time zones from author and commit timestamps

When resolving a conflicted cherry-pick, this lets us pass
GIT_AUTHOR_DATE to git citool with the correct timezone.
It does this by making elements 2 and 4 of the commitinfo array
entries, which store the author and committer dates of the commit,
be 2-element lists storing the numerical date and timezone offset,
rather than just the numerical date.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Signed-off-by: Paul Mackerras <paulus@samba.org>
12 years agogitk: Remove unused $cdate array
Anders Kaseorg [Wed, 19 Jan 2011 19:46:59 +0000 (14:46 -0500)]
gitk: Remove unused $cdate array

It was unused since commit 9f1afe05c3 ("gitk: New improved gitk").

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Signed-off-by: Paul Mackerras <paulus@samba.org>
13 years agogitk: Update cherry-pick error message parsing
Anders Kaseorg [Wed, 19 Jan 2011 19:45:00 +0000 (14:45 -0500)]
gitk: Update cherry-pick error message parsing

Commit 981ff5c37ae20687c98d98c8689d5e89016026d2 changed the error
message from git cherry-pick from
    Automatic cherry-pick failed.  [...advice...]
to
    error: could not apply 7ab78c9... Do something neat.
    [...advice...]

Update gitk’s regex to match this, restoring the ability to launch git
citool to resolve conflicted cherry-picks.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Signed-off-by: Paul Mackerras <paulus@samba.org>
13 years agogitk: Quote tag names in event bindings to avoid problems with % chars
Pat Thoyts [Tue, 1 Mar 2011 23:50:50 +0000 (23:50 +0000)]
gitk: Quote tag names in event bindings to avoid problems with % chars

Tag names that contain a % character require quoting when used in event
bindings or the name may be mis-recognised for percent substitution in
the event script.

Reported-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
13 years agogitk: Allow user to control how much of the SHA1 ID gets auto-selected
Paul Mackerras [Wed, 9 Mar 2011 09:52:38 +0000 (20:52 +1100)]
gitk: Allow user to control how much of the SHA1 ID gets auto-selected

This adds a new spinbox on the Edit Preferences pane to allow the user
to control how many characters of the SHA1 ID get autoselected.

Signed-off-by: Paul Mackerras <paulus@samba.org>
13 years agogitk: spelling fixes in Russian translation
Skip [Mon, 17 Jan 2011 21:23:12 +0000 (22:23 +0100)]
gitk: spelling fixes in Russian translation

Signed-off-by: Skip <bsvskip@rambler.ru>
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
13 years agogitk: Take only numeric version components when computing $git_version
Anders Kaseorg [Fri, 7 Jan 2011 00:42:33 +0000 (17:42 -0700)]
gitk: Take only numeric version components when computing $git_version

This fixes errors running with release candidate versions of Git:
  Error in startup script: expected version number but got "1.7.4-rc0"

Also, $git_version is no longer artificially limited to three
components.  That limitation was added by commit 194bbf6cc8c2
("gitk: Handle msysGit version during version comparisons") to deal
with msysGit version strings like “1.6.4.msysgit.0”, and we don’t need
it now.  Hence as another side effect, this enables showing notes with
git version 1.6.6.2 or 1.6.6.3, as originally intended by commit
7defefb13427 ("gitk: Show notes by default (like git log does").

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reported-by: Mathias Lafeldt <misfire@debugon.org>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
13 years agogitk: Add Brazilian Portuguese (pt-BR) translation
Alexandre Erwin Ittner [Tue, 7 Dec 2010 22:56:06 +0000 (20:56 -0200)]
gitk: Add Brazilian Portuguese (pt-BR) translation

Translating a SCM is tricky due to amount of jargon, so, I tried to
keep the wording consistent with both the German and Italian git
translations and the pt-BR translation of other SCMs.

Signed-off-by: Alexandre Erwin Ittner <alexandre@ittner.com.br>
Signed-off-by: Paul Mackerras <paulus@samba.org>
13 years agogitk: Make text selectable on Mac
Stefan Haller [Sun, 14 Nov 2010 12:22:56 +0000 (13:22 +0100)]
gitk: Make text selectable on Mac

Stolen from git-gui, 23effa79f7 (original log message by
Shawn O. Pearce <spearce@spearce.org> follows):

    git-gui: Force focus to the diff viewer on mouse click.

    Apparently a "feature" of Tcl/Tk on Mac OS X is that a disabled text
    widget cannot receive focus or receive a selection within it.  This
    makes the diff viewer almost useless on that platform as you cannot
    select individual parts of the buffer.

    Now we force focus into the diff viewer when its clicked on with
    button 1.  This works around the feature and allows selection to
    work within the viewer just like it does on other less sane systems,
    like Microsoft Windows.

Signed-off-by: Stefan Haller <stefan@haller-berlin.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
13 years agogitk: Prevent the text pane from becoming editable
Stefan Haller [Sun, 14 Nov 2010 12:21:50 +0000 (13:21 +0100)]
gitk: Prevent the text pane from becoming editable

When setting the "Patch/Tree" radio buttons to "Tree" and
clicking on a file to display it, the text pane would
accidentally become editable (because of the early return
in getblobline).

Signed-off-by: Stefan Haller <stefan@haller-berlin.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
13 years agogitk: Add the equivalent of diff --color-words
Thomas Rast [Sat, 16 Oct 2010 10:15:10 +0000 (12:15 +0200)]
gitk: Add the equivalent of diff --color-words

Use the newly added 'diff --word-diff=porcelain' to teach gitk a
color-words mode, with two different modes analogous to the
--word-diff=plain and --word-diff=color settings.  These are selected
by a dropdown box.

As an extra twist, automatically enable this word-diff support when
the user mentions a word-diff related option on the command line.
These options were previously ignored because they would break diff
parsing.

Both of these features are only enabled if we have a version of git
that supports --word-diff=porcelain, meaning at least 1.7.2.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Paul Mackerras <paulus@samba.org>
13 years agogitk: Update Swedish translation (290t)
Peter Krefting [Sun, 12 Sep 2010 20:17:05 +0000 (21:17 +0100)]
gitk: Update Swedish translation (290t)

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
Signed-off-by: Paul Mackerras <paulus@samba.org>
13 years agogitk: Show notes by default (like git log does)
Kirill Smelkov [Thu, 20 May 2010 09:50:41 +0000 (13:50 +0400)]
gitk: Show notes by default (like git log does)

Starting from ~ git-1.6.6, log, show & whatchanged show notes by default.

On the other hand, gitk does not show notes by default, because under
the hood it calls 'git log --pretty=raw ...' to get the log, and in
'git log' notes are turned off when user specifies format or pretty
settings.

Yes, it is possible to invoke 'gitk --show-notes' explicitly, but since
from user's perspective, gitk is gui enabled git log, it would be
logical for gitk to show notes by default too for consistency.

In git, --show-notes was introduced in 66b2ed (Fix "log" family not to
be too agressive about showing notes) which predates 1.6.6.2.

Notes can still be supressed with 'gitk --no-notes'.

Cc: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Display dirty submodules correctly
Jens Lehmann [Fri, 9 Apr 2010 20:16:42 +0000 (22:16 +0200)]
gitk: Display dirty submodules correctly

Since recently "git diff --submodule" prints out extra lines when the
submodule contains untracked or modified files. Show all those lines of
one submodule under the same header.

Also for newly added or removed submodules the submodule name contained
trailing garbage because the extraction of the name was not done right.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Fix display of copyright symbol
Pat Thoyts [Fri, 12 Mar 2010 18:31:49 +0000 (18:31 +0000)]
gitk: Fix display of copyright symbol

The script file uses utf-8 encoding but when sourced it will be read
using the default system encoding which is never utf8 on windows.
This causes the copyright symbol to display incorrectly in the about
dialog.  Using the unicode escape sequence avoids incorrect decoding
but does require a double escape in the .po files.

Also adjusted the year range.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Add emacs editor variable block
Pat Thoyts [Fri, 12 Mar 2010 18:31:48 +0000 (18:31 +0000)]
gitk: Add emacs editor variable block

Help contributors use the correct indentation style.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Avoid calling tk_setPalette on Windows
Pat Thoyts [Fri, 12 Mar 2010 18:31:47 +0000 (18:31 +0000)]
gitk: Avoid calling tk_setPalette on Windows

This just messes up the system colors.  Leave them alone.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Don't clobber "Remember this view" setting
Jonathan Nieder [Sat, 6 Mar 2010 22:58:42 +0000 (16:58 -0600)]
gitk: Don't clobber "Remember this view" setting

In the View → Edit View... dialog, the "Remember this view" option
always starts out unset.  Using the dialog to change an existing view
and ignoring the parts of the dialog that aren’t relevant results in
both the old and new versions of the view being lost.

The cause: right after newviewopts($curview,perm) is set to an
appropriate value, decode_view_opts is clobbering it with the default
value.  If that call is moved a little earlier, the "Remember this
view" option gets properly set to its previous value, fixing the
problem.

Reported-by: Steve Cotton <steve0001@s.cotton.clara.co.uk>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Add comments to explain encode_view_opts and decode_view_opts
Jonathan Nieder [Sat, 6 Mar 2010 22:48:38 +0000 (16:48 -0600)]
gitk: Add comments to explain encode_view_opts and decode_view_opts

Summarize these functions to save the reader some time.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Use consistent font for all text input fields
Mark Hills [Wed, 13 Jan 2010 20:40:22 +0000 (20:40 +0000)]
gitk: Use consistent font for all text input fields

Instead of setting the font for specific widgets, set the font for the
widget type. If themed widgets are not available, this is via the X
resources. If themed widgets are available, the theme font is used.

The exception is the SHA1 ID which is forced to use the fixed-width
font, even where themed widgets are used.

Signed-off-by: Mark Hills <mark@pogo.org.uk>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Set the font for all listbox widgets
Mark Hills [Wed, 13 Jan 2010 20:40:20 +0000 (20:40 +0000)]
gitk: Set the font for all listbox widgets

This affects the font chooser.

Signed-off-by: Mark Hills <mark@pogo.org.uk>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Set the font for all spinbox widgets
Mark Hills [Wed, 13 Jan 2010 20:40:19 +0000 (20:40 +0000)]
gitk: Set the font for all spinbox widgets

Use the X resources to set the font, removing the need to set the font
for specific widgets.

Signed-off-by: Mark Hills <mark@pogo.org.uk>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Remove forced use of sans-serif font
Mark Hills [Wed, 13 Jan 2010 20:40:18 +0000 (20:40 +0000)]
gitk: Remove forced use of sans-serif font

The X resources set using uifont cover this case.

Signed-off-by: Mark Hills <mark@pogo.org.uk>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Add Ctrl-W shortcut for closing the active window
Jens Lehmann [Tue, 2 Feb 2010 22:11:28 +0000 (23:11 +0100)]
gitk: Add Ctrl-W shortcut for closing the active window

To make the user experience between git gui and gitk more homogeneous,
use Ctrl-W in gitk for closing the active window.  When closing the
main window doquit is called for proper cleanup.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Fix copyright symbol in About box message
Paul Mackerras [Wed, 3 Feb 2010 21:49:00 +0000 (08:49 +1100)]
gitk: Fix copyright symbol in About box message

Somehow it got corrupted in commit d93f1713 ("gitk: Use themed tk
widgets").

Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Update German translation
Christian Stimming [Fri, 29 Jan 2010 11:55:14 +0000 (22:55 +1100)]
gitk: Update German translation

Signed-off-by: Christian Stimming <stimming@tuhh.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Add French translation
Emmanuel Trillaud [Tue, 12 Jan 2010 13:02:50 +0000 (14:02 +0100)]
gitk: Add French translation

Signed-off-by: Emmanuel Trillaud <etrillaud@gmail.com>
Signed-off-by: Thomas Moulard <thomas.moulard@gmail.com>
Signed-off-by: Guy Brand <gb@unistra.fr>
Signed-off-by: Nicolas Sebrecht <nicolas.s.dev@gmx.fr>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: update Italian translation
Michele Ballabio [Fri, 29 Jan 2010 11:51:28 +0000 (22:51 +1100)]
gitk: update Italian translation

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Update Swedish translation
Peter Krefting [Fri, 29 Jan 2010 11:50:29 +0000 (22:50 +1100)]
gitk: Update Swedish translation

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Adjust two equal strings which differed in whitespace
Markus Heidelberg [Sat, 9 Jan 2010 22:11:12 +0000 (23:11 +0100)]
gitk: Adjust two equal strings which differed in whitespace

There were the two strings "SHA1 ID: " and "SHA1 ID:" as description
for the SHA1 search textbox.  Change it to two equal strings, the
space is now outside of the translated string.

Furthermore the German translation wasn't unique, but "SHA1:" resp.
"SHA1-Hashwert:". The former was displayed after initialisation, the
latter after changes to the textbox, for example when clearing the text.
But it was too long to be displayed fully, so use a shorter translation.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Display submodule diffs with appropriate encoding
Kirill Smelkov [Tue, 5 Jan 2010 12:44:54 +0000 (15:44 +0300)]
gitk: Display submodule diffs with appropriate encoding

Previously, when submodule commit headings contained non-latin-1
characters, they were displayed incorrectly in gitk, because $line was
not properly decoded, for example:

----------------------------- Documentation/Dokko -----------------------------
Submodule Documentation/Dokko 2ca20c7..0ea204d:
  > Ð\9fÑ\80оÑ\82околÑ\8b Ñ\81опÑ\80Ñ\8fжениÑ\8f Ð\98Ð\9cС "Ð\9cоÑ\81Ñ\82ик-21631"  (Ð\9bÐ\982 Ð¸ Ð¡Ð°Ð½Ð´Ð°Ð»)
  > hardware: Ð´Ð¾ÐºÑ\83менÑ\82аÑ\86иÑ\8f Ð½Ð° InnoDisk SATA 10000
  > hardware: Ð´Ð¾ÐºÑ\83менÑ\82аÑ\86иÑ\8f Ð½Ð° IEI PCISA-6770E2 v3.0
  > hardware: Ð´Ð¾ÐºÑ\83менÑ\82аÑ\86иÑ\8f Ð½Ð° Fastwel NIB941
  > hardware: Ð´Ð¾ÐºÑ\83менÑ\82аÑ\86иÑ\8f Ð½Ð° IEI IPX-9S
  > hardware: Ð´Ð¾ÐºÑ\83менÑ\82аÑ\86иÑ\8f Ð½Ð° Hirschmann 5TX-EEC

instead of

----------------------------- Documentation/Dokko -----------------------------
Submodule Documentation/Dokko 2ca20c7..0ea204d:
  > Протоколы сопряжения ИМС "Мостик-21631"  (ЛИ2 и Сандал)
  > hardware: документация на InnoDisk SATA 10000
  > hardware: документация на IEI PCISA-6770E2 v3.0
  > hardware: документация на Fastwel NIB941
  > hardware: документация на IEI IPX-9S
  > hardware: документация на Hirschmann 5TX-EEC

This fixes it.

Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Fix display of newly-created tags
Dave Dulson [Sun, 3 Jan 2010 14:56:25 +0000 (14:56 +0000)]
gitk: Fix display of newly-created tags

If the user creates a tag with the "create tag" dialog in gitk and
then clicks on the newly-created tag, its contents don't get
displayed.  The reason is that rereadrefs hasn't been called, meaning
the tag doesn't exist in $tagobjid.  This causes the cat-file to fail.
Instead of using $tagobjid, pass the $tag directly, ensuring the tag
contents are populated correctly.

Signed-off-by: David Dulson <dave@dulson.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Enable gitk to create tags with messages
Dave Dulson [Sun, 3 Jan 2010 14:55:52 +0000 (14:55 +0000)]
gitk: Enable gitk to create tags with messages

Currently, tags created using the "create tag" dialog in gitk are
always lightweight tags, i.e., they don't have any annotation
(message).  This enables the user to specify a message; if they do,
gitk will create an unsigned, annotated tag object.

Signed-off-by: David Dulson <dave@dulson.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Update Hungarian translation
Miklos Vajna [Mon, 14 Dec 2009 13:12:25 +0000 (14:12 +0100)]
gitk: Update Hungarian translation

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Add Hungarian translation
Laszlo Papp [Tue, 12 Jan 2010 10:40:41 +0000 (21:40 +1100)]
gitk: Add Hungarian translation

[Junio C Hamano <gitster@pobox.com>: Fix a couple of wrapped lines]

Signed-off-by: Laszlo Papp <djszapi@archlinux.us>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Add "--no-replace-objects" option
Christian Couder [Sat, 12 Dec 2009 04:52:39 +0000 (05:52 +0100)]
gitk: Add "--no-replace-objects" option

Replace refs are useful to change some git objects after they
have started to be shared between different repositories. One
might want to ignore them to see the original state, and
"--no-replace-objects" option can be used from the command
line to do so.

This option simply sets the GIT_NO_REPLACE_OBJECTS environment
variable, and that is enough to make gitk ignore replace refs.

The GIT_NO_REPLACE_OBJECTS is set to "1" instead of "" as it is
safer on some platforms, thanks to Johannes Sixt and Michael J
Gruber.

Tested-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Fix selection of tags
Pat Thoyts [Sat, 14 Nov 2009 13:21:09 +0000 (13:21 +0000)]
gitk: Fix selection of tags

When a tag is clicked an error is raised due to a missing parameter in
a function call.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Default to the system colours on Windows
Pat Thoyts [Fri, 6 Nov 2009 23:28:01 +0000 (23:28 +0000)]
gitk: Default to the system colours on Windows

Also convert a button to use the themed widget set.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Merge branch 'dev' into master
Paul Mackerras [Sat, 14 Nov 2009 10:26:31 +0000 (21:26 +1100)]
gitk: Merge branch 'dev' into master

Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Update Japanese translation
Mizar [Sat, 14 Nov 2009 10:21:08 +0000 (21:21 +1100)]
gitk: Update Japanese translation

Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Fix "git gui blame" invocation when called from top-level directory
Markus Heidelberg [Tue, 3 Nov 2009 23:21:41 +0000 (00:21 +0100)]
gitk: Fix "git gui blame" invocation when called from top-level directory

When run in the top-level directory of a git repository, "git
rev-parse --git-dir" doesn't return an absolute path, but merely
".git", so the selected file for "git gui blame" has a relative path.
The function make_relative then tries to make the already relative
path relative, which results in a path like "../../../../Makefile"
with as many ".." as there are elements of [pwd].

This regression was introduced by commit 9712b81 (gitk: Fix bugs in
blaming code, 2008-12-06), which fixed "git gui blame" when called from
subdirs.

This also fixes it for bare repositories.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Disable checkout of remote branches
Sitaram Chamarty [Tue, 3 Nov 2009 16:00:12 +0000 (21:30 +0530)]
gitk: Disable checkout of remote branches

At the command line, trying to check out a remote branch gives you a
detailed warning message, but the gitk GUI currently allows it without
any fuss.

Since the GUI is often used by people much less familiar with git, it
seems reasonable to make the GUI more restrictive than the command line,
not less.

This prevents a lot of detached HEAD commits by new users.

Signed-off-by: Sitaram Chamarty <sitaramc@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Improve appearance of radiobuttons and checkbuttons
Paul Mackerras [Sat, 14 Nov 2009 10:15:01 +0000 (21:15 +1100)]
gitk: Improve appearance of radiobuttons and checkbuttons

Commit 5497f7a23ac11f9b230892220d5ed80263eedd1f ("gitk: Add configuration
for UI colour scheme") added a call to tk_setPalette at startup.
Unfortunately, tk_setPalette always chooses a dark red color for
the selectColor value if none is given explicitly, and this makes
checkbuttons and radiobuttons look rather bad.

This restores the previous appearance by specifying selectColor
explicitly.  For light backgrounds we use white for selectColor, and
for dark backgrounds we use black.  The formula and threshold for
distinguishing light from dark are the same as used in tk_setPalette
for choosing the foreground color.

Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Skip translation of "wrong Tcl version" message
Bernt Hansen [Mon, 2 Nov 2009 12:41:00 +0000 (07:41 -0500)]
gitk: Skip translation of "wrong Tcl version" message

We check the required Tcl version number before we setup msgcat for
language translation.  If the Tcl version is too old just display the
untranslated error text.

The caller of show_error can now pass an alternative function for mc.
The Tcl list function turns the translation into a no-op.

This fixes the error:
    Error in startup script: invalid command name "mc"
when attempting to start gitk with Tcl 8.3.

Tested with both Tcl 8.3 and 8.4.

Signed-off-by: Bernt Hansen <bernt@norang.ca>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Add Japanese translation
Mizar [Thu, 29 Oct 2009 16:22:26 +0000 (01:22 +0900)]
gitk: Add Japanese translation

Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Use the --submodule option for displaying diffs when available
Jens Lehmann [Wed, 28 Oct 2009 11:40:45 +0000 (12:40 +0100)]
gitk: Use the --submodule option for displaying diffs when available

When displaying diffs in a submodule, this makes gitk display the
headlines of the commits being diffed, instead of just showing
not-quite-helpful SHA-1 pairs, if the underlying git installation
supports this.  That makes it much easier to evaluate the changes, as
it eliminates the need to start a gitk inside the submodule and use
the superprojects hashes there to find out what the commits are about.

Since the --submodule option of git diff is new in git version 1.6.6,
this only uses the --submodule option when a git version of 1.6.6 or
higher is detected.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Fix diffing committed -> staged (typo in diffcmd)
Jens Lehmann [Tue, 27 Oct 2009 17:13:42 +0000 (18:13 +0100)]
gitk: Fix diffing committed -> staged (typo in diffcmd)

When highlighting a commit, using the context menu over the staged changes
and then selecting "Diff this -> selected" the diff was empty.  The same
happened when highlighting the staged changes and using "Diff selected ->
this" over a commit.  The reason was a copy/paste error in [diffcmd].
This fixes it.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Add configuration for UI colour scheme
Guillermo S. Romero [Thu, 15 Oct 2009 16:51:49 +0000 (18:51 +0200)]
gitk: Add configuration for UI colour scheme

This adds an option to control the global colour scheme in the
Edit > Preferences dialog so that the whole interface can have
a non-default main colour.

Signed-off-by: Guillermo S. Romero <gsromero@infernal-iceberg.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Work around leftover temporary save file
Pat Thoyts [Tue, 15 Sep 2009 09:26:30 +0000 (10:26 +0100)]
gitk: Work around leftover temporary save file

If a file exists and is hidden on Windows the Tcl open command will
fail as the attributes provided in the CREAT call fail to match those
of the existing file.  Forcing removal of the temporary file before we
begin solves any problems caused by previous failures to save the
application settings.  An alternative would be to remove the hidden
attribute before calling 'open'.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Don't compare fake children when comparing commits
Paul Mackerras [Thu, 10 Sep 2009 11:58:40 +0000 (21:58 +1000)]
gitk: Don't compare fake children when comparing commits

This fixes a bug where the compare-commits function would advance
to a fake node (one representing local changes, either checked in
but not committed, or not checked in) and then get an error when
trying to get the patch-id.  This fixes it by only considering the
real children of each commit.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Show diff of commits at end of compare-commits output
Paul Mackerras [Mon, 7 Sep 2009 00:08:21 +0000 (10:08 +1000)]
gitk: Show diff of commits at end of compare-commits output

When comparing a string of commits, when we find two non-merge commits
that differ, we now write the two commits to files and diff the files.
This pulls out the logic for creating a temporary directory from
external_diff into a separate procedure so that the new diffcommits
procedure can use it.

Because the diff command returns an exit status of 1 when the files
differ, and Tcl treats that as an error, this adds catch {} around the
close statements in getblobdiffline.

At present this only removes the temporary files when gitk exits.  It
should remove them when the diff is done.

Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Show diff of commits at end of compare-commits output
Paul Mackerras [Mon, 7 Sep 2009 00:08:21 +0000 (10:08 +1000)]
gitk: Show diff of commits at end of compare-commits output

When comparing a string of commits, when we find two non-merge commits
that differ, we now write the two commits to files and diff the files.
This pulls out the logic for creating a temporary directory from
external_diff into a separate procedure so that the new diffcommits
procedure can use it.

Because the diff command returns an exit status of 1 when the files
differ, and Tcl treats that as an error, this adds catch {} around the
close statements in getblobdiffline.

At present this only removes the temporary files when gitk exits.  It
should remove them when the diff is done.

Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Add a user preference to enable/disable use of themed widgets
Paul Mackerras [Sat, 5 Sep 2009 12:06:46 +0000 (22:06 +1000)]
gitk: Add a user preference to enable/disable use of themed widgets

Also move the hide-remotes option up into the commit display options
in the Edit->Preferences panel, since it affects the commit display
more than the diff display.

Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agoMerge branch 'master' into dev
Paul Mackerras [Sat, 5 Sep 2009 07:34:03 +0000 (17:34 +1000)]
Merge branch 'master' into dev

14 years agogitk: Update Swedish translation (280t0f0u)
Peter Krefting [Fri, 10 Jul 2009 07:08:15 +0000 (08:08 +0100)]
gitk: Update Swedish translation (280t0f0u)

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Parse arbitrary commit-ish in SHA1 field
Thomas Rast [Thu, 13 Aug 2009 07:25:03 +0000 (09:25 +0200)]
gitk: Parse arbitrary commit-ish in SHA1 field

We only accepted either SHA1s or heads/tags that have been read.  This
meant the user could not, e.g., enter HEAD to go back to the current
commit.

This adds code to call out to git rev-parse --verify if all other
methods of interpreting the string the user entered fail.
(git-rev-parse alone is not enough as we really want a single
revision.)

The error paths change slighly, because we now know from the rev-parse
invocation whether the expression was valid at all.  The previous
"unknown" path is now only triggered if the revision does exist, but
is not in the current view display.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Fix direction of symmetric difference in optimized mode
Thomas Rast [Wed, 5 Aug 2009 21:15:36 +0000 (23:15 +0200)]
gitk: Fix direction of symmetric difference in optimized mode

ee66e08 (gitk: Make updates go faster, 2008-05-09) implemented an
optimized mode where gitk parses the arguments with rev-parse, and
manually reads history in chunks.  As mentioned in the commit message,
symmetric differences are a problem there:

    One wrinkle is that we have to turn symmetric diff arguments (of the
    form a...b) back into symmetric diff form so that --left-right still
    works, as git rev parse turns a...b into a b ^merge_base(a,b).

However, git-rev-parse returns a...b in the swapped order

    b a ^merge_base(a,b)

This has been the case since at least 1f8115b (the state of master at
the time of the abovementioned ee66e08; Merge branch 'maint',
2008-05-08).  So gitk flipped the sides of symmetric differences
whenever it was in optimized mode.

Fix this by swapping the sides of the reconstruction code.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: New option to hide remote refs
Thomas Rast [Mon, 3 Aug 2009 21:53:36 +0000 (23:53 +0200)]
gitk: New option to hide remote refs

In repositories with lots of remotes, looking at the history in gitk
can be borderline insane with all the red labels for remote refs.
Introduce a new option in the preferences that makes gitk ignore
remote refs entirely, so they don't take up space in the display.

Wished-for-by: Thell Fowler <tbfowler4@gmail.com>
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Do not hard-code "encoding" in attribute lookup functions
Johannes Sixt [Tue, 21 Jul 2009 08:09:48 +0000 (10:09 +0200)]
gitk: Do not hard-code "encoding" in attribute lookup functions

Commit 39ee47e (Clean up file encoding code and add enable/disable option,
2008-10-15) rewrote the attribute lookup functions gitattr and
cache_gitattr, but in the process hard-coded the attribute name "encoding"
instead of using the functions' parameters. This fixes it.

This is not a serious regression because currently all callers look only
for "encoding".

Further note that this fix assumes that future callers will not pass an
attribute name that contains regex special characters.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Allow diff view without context lines
Markus Heidelberg [Sat, 23 May 2009 17:31:37 +0000 (19:31 +0200)]
gitk: Allow diff view without context lines

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Add another string to translation
Michele Ballabio [Sat, 23 May 2009 09:48:25 +0000 (11:48 +0200)]
gitk: Add another string to translation

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Add option 'Simple history' to the options menu
Dirk Suesserott [Thu, 21 May 2009 13:35:40 +0000 (15:35 +0200)]
gitk: Add option 'Simple history' to the options menu

When clicked, the option --simplify-by-decoration is added to gitk/git log.
This yields to a simplified history where only decorated commits are shown,
i.e. those with a yellow tag or a green branch flag.

Signed-off-by: Dirk Suesserott <newsletter@dirk.my1.cc>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Handle msysGit version during version comparisons
Pat Thoyts [Mon, 18 May 2009 21:46:01 +0000 (22:46 +0100)]
gitk: Handle msysGit version during version comparisons

msysGit generates version strings with text appended which cannot
be used with vcompare; trying to use them generates a Tcl error.
Limit git_version to the first three digits which are the real git
version to avoid this error.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Make more options easily accessible from Edit View dialog
Elijah Newren [Mon, 23 Mar 2009 17:57:46 +0000 (11:57 -0600)]
gitk: Make more options easily accessible from Edit View dialog

Commit 218a900bd8efd0d49f8a0d9491aa4786a998d4f4 added a number of new
individual fields for the Edit View dialog to make them more accessible
to end users, while still allowing all options to be specified in the
"arguments to git log" field.  This extends the dialog further, to
include refs, author, committer, commit message, and patch contents.
As before everything still remains accessible from the "arguments to
git log" input field.

Additionally, this provides hints for the format of the various input
fields (for example, listing some sample date strings in different
formats), and puts related query items into subsections to make it
easier to digest the number of options that exist.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Check git version before using --textconv flag
Paul Mackerras [Sat, 16 May 2009 11:06:01 +0000 (21:06 +1000)]
gitk: Check git version before using --textconv flag

Commit 785b7535 ("gitk: use --textconv to generate diff text")
added the --textconv flag to the git diff commands used to
display commit diffs.  Since some people use newer gitk with older
git installations, this adds a check on the git version to check
that it understands --textconv before using it.

Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Use --textconv to generate diff text
Johannes Sixt [Tue, 28 Apr 2009 12:03:54 +0000 (14:03 +0200)]
gitk: Use --textconv to generate diff text

For the most part gitk's focus is on showing history and changes in
a human readable form.  For this reason, it makes sense to generate
the patch text in the diff view using --textconv so that textconv
drivers are used if they are defined.

gitk can also generate patches, but we do not use --textconv because
such patches could not be applied.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Update German translation.
Christian Stimming [Tue, 12 May 2009 20:20:23 +0000 (22:20 +0200)]
gitk: Update German translation.

Signed-off-by: Christian Stimming <stimming@tuhh.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
14 years agogitk: Fix errors in the theme patch
Pat Thoyts [Tue, 12 May 2009 14:45:06 +0000 (15:45 +0100)]
gitk: Fix errors in the theme patch

This fixes a typo in the commit selection combobox that prevented it
from working properly, and sets the width of the widget.  This also
fixes show_error to handle errors arising before the gui is fully
configured (ie: invalid command line parameters)

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agogitk: Use themed tk widgets
Pat Thoyts [Fri, 17 Apr 2009 00:24:35 +0000 (01:24 +0100)]
gitk: Use themed tk widgets

With Tk 8.5+, this uses the themed widgets to improve the appearance
on Windows and MacOSX.  On X11 less difference is apparent, but users
can select alternate themes by setting *TkTheme in the resource
database (eg: *TkTheme: clam).

With Tk 8.6 there is a built-in font selection dialog.  This will make
use of that when available, as on Windows and MacOSX it calls the
native font selection dialog.

[paulus@samba.org - folded in subsequent patch to restore saved
pane sizes for ttk widgets, and trimmed trailing whitespace.]

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agoMerge branch 'master' into dev
Paul Mackerras [Thu, 30 Apr 2009 23:34:57 +0000 (09:34 +1000)]
Merge branch 'master' into dev

15 years agogitk: Add Russian translation
Alex Riesen [Mon, 27 Apr 2009 18:04:27 +0000 (20:04 +0200)]
gitk: Add Russian translation

Thanks go to Dmitry Potapov for proofreading and suggested translation
of the word 'merge'.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agogitk: Fix compare-commits function when we have local changes
Paul Mackerras [Tue, 21 Apr 2009 12:22:31 +0000 (22:22 +1000)]
gitk: Fix compare-commits function when we have local changes

This fixes a bug in the compare-commits function added in commit
010509f2 ("gitk: Add a command to compare two strings of commits")
where gitk would show an error dialog if the comparison of commits
got to a fake commit (one showing local changes).  It extends
getpatchid to handle these fake commits by using [diffcmd] to get
the git diff command variant to use, and also handles the situation
where an error occurs.

Now that we can have the fake commit IDs showing up, which are
00..00 and 00..01, the short ID is ambiguous.  To make sure the links
point to the right commit, this adds a new [appendshortlink] procedure
which takes the full link destination, and uses that rather than
appendwithlinks.

Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agogitk: Avoid crash if closed while reading references
Pat Thoyts [Wed, 15 Apr 2009 16:14:03 +0000 (17:14 +0100)]
gitk: Avoid crash if closed while reading references

As recorded in msysGit issue 125, if the user closes gitk while it
reports itself as still reading references then Tk will crash in the
geometry management code.  This has been fixed for Tk 8.5.7 and above.
This patch avoids the problem by flushing outstanding geometry events
before calling the readrefs procedure.

See also http://code.google.com/p/msysgit/issues/detail?id=125

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agogitk: Handle external diff tool with spaces in the path
Pat Thoyts [Wed, 15 Apr 2009 15:54:19 +0000 (16:54 +0100)]
gitk: Handle external diff tool with spaces in the path

This fixes the launching of external diff to handle a diff tool
that has spaces in the path.  This ensures a correctly formed
tcl list is passed to the open command with a single pipe character
prefixing the list (as per the tcl manual page for open).

The specific fault observed was that selecting WinMerge as the diff
tool from the default installed location in Program Files failed to
be launched from the context menu.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agogitk: Remember and restore the window state with the geometry
Pat Thoyts [Tue, 14 Apr 2009 21:09:53 +0000 (22:09 +0100)]
gitk: Remember and restore the window state with the geometry

This records the window state in ~/.gitk.  On startup, if the gitk
window was previously maximized (zoomed), then we restore that state.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agogitk: Map KP_Divide to focus the search box
Michele Ballabio [Mon, 30 Mar 2009 12:55:21 +0000 (14:55 +0200)]
gitk: Map KP_Divide to focus the search box

Commit 97bed034 changed the behavior of the '/' key on the keyboard,
but the '/' on the keypad was left unused.  They now both do the same
thing.

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agogitk: Mark some more strings for translation
Michele Ballabio [Mon, 30 Mar 2009 19:17:25 +0000 (21:17 +0200)]
gitk: Mark some more strings for translation

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agogitk: Mark forgotten string for translation
Christian Stimming [Thu, 26 Mar 2009 20:13:45 +0000 (21:13 +0100)]
gitk: Mark forgotten string for translation

Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agogitk: Make .gitk a hidden file under windows
Paul Mackerras [Mon, 23 Mar 2009 10:37:51 +0000 (21:37 +1100)]
gitk: Make .gitk a hidden file under windows

This sets the hidden attribute on the ~/.gitk file so it doesn't
appear in the windows user profile.

Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agogitk: Add a command to compare two strings of commits
Paul Mackerras [Thu, 9 Apr 2009 12:10:20 +0000 (22:10 +1000)]
gitk: Add a command to compare two strings of commits

This adds a row context menu command to compare this commit and its
descendants with the marked commit and its descendants.  The results
are shown in the bottom-left pane.  Commits are compared by checking
whether their headlines are the same and their patches have the same
patch ID as generated by git patch-id.

Merges are ignored and skipped over (as long as they have one
descendant).  If two commits have the same patch ID then the process
will continue and compare their descendants, as long as they both have
exactly one descendant.  If either commit has 0 or 2 or more descendants,
the comparison stops there.  There is currently a limit of 100
comparisons.

This can be useful for checking whether one string of commits is just
a rebased version of another string of commits.  Mark the end of one
string (i.e. the oldest commit in the string) and invoke "Compare with
marked commit" on the end of the other string.

As this is implemented, the UI will be unresponsive while the results
are being generated.  This should be fixed.

Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agogitk: Add a way to mark a commit, plus a "find descendant" command
Paul Mackerras [Wed, 8 Apr 2009 23:34:46 +0000 (09:34 +1000)]
gitk: Add a way to mark a commit, plus a "find descendant" command

This adds a context-menu command to put a mark on this commit.  There
is at most one marked commit at any time, and it is indicated by a box
drawn around the headline.  Once a commit is marked, two other
context-menu commands become available: one to select the marked commit,
and another to find the closest common descendant of this commit and
the marked commit.

The "find common descendant" command uses the displayed parent/child
relationships (i.e. the rewritten parent pointers produced by git log),
not the real parent/child relationships.  Currently the UI will be
unresponsive while gitk is working out the nearest common descendant;
this should be improved in future.

Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agogitk: Fixes for Mac OS X TkAqua
Daniel A. Steffen [Mon, 23 Mar 2009 11:17:38 +0000 (12:17 +0100)]
gitk: Fixes for Mac OS X TkAqua

- middle button is B3 on TkAqua
- add horizontal mousehweel scrolling
- nicer default fonts
- use OSX-specific extdifftool
- remove quit menu item, call doquit on quit event
- move about & preferences menu items into apple menu
- don't set menu font

Signed-off-by: Daniel A. Steffen <das@users.sourceforge.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agogitk: Provide a 32x32 window icon based on the git logo
Stephen Boyd [Thu, 19 Mar 2009 08:54:18 +0000 (01:54 -0700)]
gitk: Provide a 32x32 window icon based on the git logo

This simply expands the 16x16 logo image to 32x32 and provides it as
an alternative icon image.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agogitk: Provide a window icon if possible
Giuseppe Bilotta [Thu, 19 Mar 2009 08:54:17 +0000 (01:54 -0700)]
gitk: Provide a window icon if possible

Try to set up a 16x16 Tk photo image (based on the git logo) and use
it as window icon.  The code is wrapped in a catch because it may fail
in earlier Tcl/Tk 8.4 releases that don't provide 'wm iconphoto'.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>