Help contributors use the correct indentation style.
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
[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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>