Commit Graph

423 Commits

Author SHA1 Message Date
Pat Thoyts
67112c484b git-gui: generic version trimming
Rather than attempting to trim off all the non-version number suffixes
from the 'git version' result, let us scan along from the beginning until
we find a non-numeric part and stop there. Any such dot-version number will
be compatible with the Tcl package version comparison command which is the
aim of this code.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-10-07 22:28:45 +01:00
Pat Thoyts
c0d2c38d78 git-gui: enable the Tk console when tracing/debugging on Windows
Without any standard channels the trace option is pretty useless on Win32
unless you can show the Tk console which captures such output. This also
permits introspection of the running application to assist in debugging.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-10-05 23:51:34 +01:00
Pat Thoyts
7ae1e72762 git-gui: show command-line errors in a messagebox on Windows
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-10-05 23:39:54 +01:00
Sebastian Schuberth
ff9db6c79d On Windows, avoid git-gui to call Cygwin's nice utility
It's a common case for Windows developers to have both Cygwin and msysGit
installed. Unfortunately, some scenarios also require to have Cygwin in PATH.
By default, Cygwin comes with nice.exe, while msysGit does not. Since git-gui
calls nice if it is in PATH, this results in Cygwin's nice.exe being called
from msysGit's git-gui. Mixing Cygwin and msysGit generally is not a good idea,
and in this particular case it causes differences not being correctly detected.
So we only call nice.exe on Windows if it is in the same directory as git.exe.
This way, this work-around does neither affect a pure Cygwin environment, or
the case when nice.exe will be shipped with msysGit at some point in time.

This fixes msysGit issue 394.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-10-05 10:58:14 +01:00
Pat Thoyts
2473543caa git-gui: avoid mis-encoding the copyright message on Windows.
On Windows the tcl script file will use the system encoding and attempting
to convert the copyright mis-encodes the string. Instead, keep the message
as ASCII and substitute in the correct unicode character when running.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-09-13 20:41:42 +01:00
Pat Thoyts
d5257fb3c1 git-gui: handle textconv filter on Windows and in development
When developing/testing we run git-gui.sh directly and the makefile
configured variables are not properly set. Configure the new shellpath
accessor to handle this case.

On Windows we may not find the shell so in this case revert to simply
executing the filter command without the shell intermediate.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-08-12 21:37:32 +01:00
Matthieu Moy
62f9a632c8 git-gui: use shell to launch textconv filter in "blame"
The textconv filters may include multiple arguments and may make use
of unix shell features. To maintain compatibility with 'git blame'
ensure these commands are passed through bash.

Reported-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-08-12 21:35:09 +01:00
Pat Thoyts
780777720a git-gui: display error launching blame as a message box.
This does not appear to Windows users and can follow the form of the fatal
error messages near the top of the script file.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-08-08 00:07:43 +01:00
Pat Thoyts
ea47503d4d git-gui: Make usage statement visible on Windows.
On Windows stdout and stderr are not connected to anything so the usage
statement is never shown to the user when an error is made with a command
line like 'git gui browser'. Use a messagebox on windows.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-08-08 00:07:01 +01:00
Pat Thoyts
2810a58dba git-gui: fix size and position of window panes on startup
The themed panedwindow needs to have the sash position set after the
widget has been mapped therefore apply this setting in the Map event
binding. To avoid visible redraws as the application is constructed
the main window should be withdrawn until all the widgets have been added

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-08-02 13:42:45 +01:00
Pat Thoyts
9cb268c426 git-gui: mc cannot be used before msgcat has been loaded
If someone attempts to use an older version that Tk 8.4 the error was
masked by the lack of a mc command.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-08-02 12:13:05 +01:00
Clément Poulain
1fbaccad4d git-gui: use textconv filter for diff and blame
Create a checkbox "Use Textconv For Diffs and Blame" in git-gui options.
If checked and if the driver for the concerned file exists, git-gui calls diff
and blame with --textconv option

Signed-off-by: Clément Poulain <clement.poulain@ensimag.imag.fr>
Signed-off-by: Diane Gasselin <diane.gasselin@ensimag.imag.fr>
Signed-off-by: Axel Bonnet <axel.bonnet@ensimag.imag.fr>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-07-30 10:05:27 +01:00
Markus Heidelberg
2e0cda658e git-gui: fix "Explore Working Copy" for Windows again
It has already been fixed in commit 454efb47 (git-gui (Win): make
"Explore Working Copy" more robust, 2009-04-01), but has been broken in
commit 21985a11 (git-gui: handle non-standard worktree locations,
2010-01-23) by accidentally replacing too much with a new variable.

The problem can be reproduced when starting git-gui from within a
subdirectory. The solution is to convert the path name, explorer.exe is
invoked with, to a platform native name.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-07-30 09:57:26 +01:00
Pat Thoyts
13a3d637b2 git-gui: Handle failure of core.worktree to identify the working directory.
Commit 21985a11 'git-gui: handle non-standard worktree locations' attempts
to use either GIT_WORK_TREE or core.worktree to set the _gitworktree
variable but these may not be set which leads to a failure to launch
gitk to review history. Use _gitdir to set the location for a standard
git layout where the parent of the .git directory is the working tree.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-07-10 23:40:59 +01:00
Shawn O. Pearce
2a9edd0305 Merge branch 'maint'
* maint:
  git-gui: check whether systems nice command works or disable it
2010-02-08 07:57:37 -08:00
Heiko Voigt
9c898a18ea git-gui: check whether systems nice command works or disable it
This fixes issue 394 from msysgit. It seems that the Gnuwin32 project
provides a nice command but it returns a "not implemented" error. To
help users we now try to execute once and disable it in case it fails.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-02-08 07:56:55 -08:00
Shawn O. Pearce
e1a3f28b14 Merge branch 'maint'
* maint:
  git-gui: fix shortcut for menu "Commit/Revert Changes"
2010-01-29 07:58:56 -08:00
Heiko Voigt
d6db1bbe11 git-gui: fix shortcut for menu "Commit/Revert Changes"
The shortcut was not properly recognized previously.

Signed-off-by: Heiko Voigt <heiko.voigt@mahr.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-29 07:58:52 -08:00
Jens Lehmann
831cc7ebb4 git-gui: Quote git path when starting another gui in a submodule
In do_git_gui the path of the git executable has to be put into a
list, otherwise calling it will fail when when spaces are present
in its path.

Reported-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-28 15:44:41 -08:00
Pat Thoyts
c80d7be5e1 git-gui: use themed tk widgets with Tk 8.5
This patch enables the use of themed Tk widgets with Tk 8.5 and above.
These make a significant difference on Windows in making the
application appear native. On Windows and MacOSX ttk defaults to the
native look as much as possible. On X11 the user may select a theme
using the TkTheme XRDB resource class by adding an line to the
.Xresources file. The set of installed theme names is available using
the Tk command 'ttk::themes'. The default on X11 is similar to the current
un-themed style - a kind of thin bordered motif look.

A new git config variable 'gui.usettk' may be set to disable this if
the user prefers the classic Tk look. Using Tk 8.4 will also avoid the
use of themed widgets as these are only available since 8.5.

Some support is included for Tk 8.6 features (themed spinbox and native
font chooser for MacOSX and Windows).

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-27 17:13:52 -08:00
Shawn O. Pearce
73b3446b82 git-gui: Remove unused icon file_parttick
This icon hasn't been used in git gui.  I think it dates back to
the original set of icons I took from Paul Mackerras' prototype
that I turned into git gui.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-25 07:33:41 -08:00
Peter Oberndorfer
0602de48f7 git-gui: use different icon for new and modified files in the index
This allows to quickly differentiate between new and modified files
in the index without selecting the file and looking at the diff.

Signed-off-by: Peter Oberndorfer <kumbayo84@arcor.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-25 07:31:38 -08:00
Giuseppe Bilotta
a9fa11fe5b git-gui: set GIT_DIR and GIT_WORK_TREE after setup
Rather than juggling with the env var GIT_DIR around the invocation of
gitk, set it and GIT_WORK_TREE after finishing setup, ensuring that any
external tool works with the setup we're running with.

This also allows us to remove a couple of conditionals when running gitk
or git gui in a submodule, as we know that the variables are present and
have to be unset and reset before and after the invocation.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23 16:02:16 -08:00
Giuseppe Bilotta
29e5573d1e git-gui: handle bare repos correctly
Refactor checking for a bare repository into its own proc, that relies
on git rev-parse --is-bare-repository if possible. For older versions of
git we fall back to a logic such that the repository is considered bare
if:
 * either the core.bare setting is true
 * or the worktree is not set and the directory name ends with .git
The error message for the case of an unhandled bare repository is also
updated to reflect the fact that the problem is not the funny name but
the bareness.

The new refactored proc is also used to disable the menu entry to
explore the working copy, and to skip changing to the worktree before
the gitk invocation.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23 15:14:21 -08:00
Giuseppe Bilotta
21985a1136 git-gui: handle non-standard worktree locations
Don't rely on the git worktree being the updir of the gitdir, since it
might not be. Instead, define (and use) a new _gitworktree global
variable, setting it to $GIT_WORK_TREE if present, falling back to
core.worktree if defined, and finally to whatever we guess the correct
worktree is. Getting core.worktree requires the config from the alleged
git dir _gitdir to be loaded early.

Supporting non-standard worktree locations also breaks the git-gui
assumption (made when calling gitk) that the worktree was the dirname of
$_gitdir and that, by consequence, the git dir could be set to the tail
of $_gitdir once we changed to the worktree root directory. Therefore,
we need to export a GIT_DIR environment variable set to the full,
normalized path of $_gitdir instead. We also skip changing to the worktree
directory if it's empty (i.e. if we're working on a bare repository).

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23 15:14:21 -08:00
Jeff Epler
ff07c3b621 git-gui: Support applying a range of changes at once
Multiple lines can be selected in the diff viewer and applied all
at once, rather than selecting "Stage Line For Commit" on each
individual line.

Signed-off-by: Jeff Epler <jepler@unpythonic.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23 15:14:15 -08:00
Jens Lehmann
25476c63e7 git-gui: Add a special diff popup menu for submodules
To make it easier for users to deal with submodules, a special diff
popup menu has been added for submodules. The "Show Less Context"
and "Show More Context" entries have been removed, as they don't make
any sense for a submodule summary. Four new entries are added to the
top of the popup menu to gain access to more detailed information
about the changes in a submodule than the plain summary does offer.

These are:
- "Visualize These Changes In The Submodule"
  starts gitk showing the selected commit range

- "Visualize These Changes In The Submodule"
  starts gitk showing the whole submodule history of the current branch

- "Visualize All Branch History In The Submodule"
  starts gitk --all in the submodule

- "Start git gui In The Submodule"
  guess what :-)

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23 15:14:15 -08:00
Giuseppe Bilotta
87cd09f43e git-gui: work from the .git dir
When git-gui is run from a .git dir, _gitdir would be set to "." by
rev-parse, something that confuses the worktree detection.

Fix by expanding the value of _gitdir to pwd in this special case.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23 15:14:04 -08:00
Jens Lehmann
7ec2b69f1a git-gui: Correct file_states when unstaging partly staged entry
When unstaging a partly staged file or submodule, the file_states
list was not updated properly (unless unstaged linewise). Its
index_info part did not contain the former head_info as it should
have but kept its old value.

This seems not to have had any bad effects but diminishes the value
of the file_states list for future enhancements.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23 14:46:13 -08:00
Peter Krefting
e27d106ec4 git-gui: Fix gitk for branch whose name matches local file
When trying to run gitk on a branch name whose name matches a local
file, it will toss an error saying that the name is ambiguous. Adding
a pair of dashes will make gitk parse the options to the left of
it as branch names. Since wish eats the first pair of dashes we
throw at it, we need to add a second one to ensure they get through.

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23 14:46:12 -08:00
Vitaly _Vi Shukela
b677c66e29 git-gui: Add hotkeys for "Unstage from commit" and "Revert changes"
Signed-off-by: Vitaly _Vi Shukela <public_vi@tut.by>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-06 18:21:11 -08:00
Jindrich Makovicka
60204ddb99 git-gui: suppress RenderBadPicture X error caused by Tk bug
Due to a bug in Tk, git-gui almost always (unless git-gui is closed
right after starting) produces an X window error message on exit,
something like:

X Error of failed request:  RenderBadPicture (invalid Picture parameter)
  Major opcode of failed request:  150 (RENDER)
  Minor opcode of failed request:  7 (RenderFreePicture)
  Picture id in failed request: 0x3a000dc
  Serial number of failed request:  1965
  Current serial number in output stream:  1980

Respective Tk bug report is here:

http://sourceforge.net/tracker/?func=detail&atid=112997&aid=1821174&group_id=12997

This bug is triggered only when the send command is blocked via
rename send {} . The following patch re-enables send just before
quiting git-gui to suppress the error.

Signed-off-by: Jindrich Makovicka <makovick@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-12-07 07:39:58 -08:00
Vietor Liu
acb9108c19 git-gui: adjust the minimum height of diff pane for shorter screen height
When the main window is maximized, if the screen height is shorter (e.g.
Netbook screen 1024x600), both the partial commit pane and the status bar
are hidden. The diff pane is resizable, so that it can use less vertical
height, allowing the overall window to be shorter and still display both
the entire commit pane and status bar.

Signed-off-by: Vietor Liu <vietor@vxwo.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-10-27 11:25:59 -07:00
Jens Lehmann
cd846aa183 git-gui: fix use of uninitialized variable
This fixes a bug introduced by the "display summary when showing diff of a
submodule" patch. It lead to a "no such variable" error when opening the
diff context menu while no diff was shown.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-09-25 16:42:00 -07:00
Alexey Borzenkov
ed7b603381 git-gui: store wm state and fix wm geometry
I often close git gui window when it is maximized, and when I reopen
it next time the it would usually become out of place (e.g. a huge
window with a top-left corner somewhere close to the center of the
screen). Fix it by storing and restoring wm state in config, as well
as setting wm state to normal before retrieving wm geometry info.

Signed-off-by: Alexey Borzenkov <snaury@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-09-12 11:35:29 -07:00
Dan Zwell
dd6451f9c7 git-gui: Limit display to a maximum number of files
When there is a large number of new or modified files,
"display_all_files" takes a long time, and git-gui appears to hang.

This change limits the number of files that are displayed.  This
limit can be set as gui.maxfilesdisplayed, and is 5000 by default.

A warning is shown the first time the list of files is truncated
in this GUI session.  Subsequent truncations are not mentioned to
the user.

Signed-off-by: Dan Zwell <dzwell@zwell.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-08-12 07:41:52 -07:00
Jens Lehmann
246295bdeb git-gui: display summary when showing diff of a submodule
As it is hard to say what changed in a submodule by looking at the hashes,
let's show the colored submodule summary instead.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-08-10 08:30:26 -07:00
Daniel A. Steffen
a91be3fcbe git-gui: Fixes for Mac OS X TkAqua
- detect more Tk.framework variants
- fix apple menu setup, use native preferences menu item
- don't set menu font

Signed-off-by: Daniel A. Steffen <das@users.sourceforge.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-05-01 15:04:52 -07:00
Shawn O. Pearce
4339d5109c Merge branch 'maint'
* maint:
  git-gui: Ensure consistent usage of mergetool.keepBackup
  git-gui: fix use of undeclared variable diff_empty_count
2009-04-08 07:41:13 -07:00
Ferry Huberts
fb25092a88 git-gui: Ensure consistent usage of mergetool.keepBackup
In several places merge.keepBackup is used i.s.o.
mergetool.keepBackup. This patch makes it all
consistent.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-04-08 07:40:58 -07:00
Joerg Bornemann
8052e788b5 git-gui: fix use of undeclared variable diff_empty_count
Commit 584fa9cc introduced the global variable diff_empty_count, which
is used in diff.tcl. This variable wasn't declared anywhere which
resulted in an ugly error message box instead of the intended
informative message.

Signed-off-by: Joerg Bornemann <joerg.bornemann@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-04-08 07:38:11 -07:00
Markus Heidelberg
454efb47b6 git-gui (Win): make "Explore Working Copy" more robust
Starting the Explorer from the git-gui menu "Explore Working Copy"
didn't work, when git-gui was started via Windows Explorer shell
extension (Git GUI Here) from a directory within the project.
The Explorer raised an error message like this:

    Path "C:/somedir/worktree" is not available or not a directory

It worked when started from the project directory itself, because then
the path argument for the Explorer was just '.' (current directory)
without any problematic forward slashes.

To make it work, convert the path given as argument to explorer.exe to
its native format with backslashes.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-04-05 13:05:29 -07:00
Markus Heidelberg
3eb5682b0b git-gui: use git --html-path to get the location of installed HTML docs
Previously a hardcoded path $GIT_EXEC_PATH/../Documentation/ was used to
search for the documentation, when the user has asked for it via menu
"Help -> Online Documentation".
This didn't work for the default directory structure.

To find the path reliably, use the new git command line option, which
returns the correct path.

If the output of `git --html-path` is empty because git is not found or
the option is not yet supported in the installed git, the documentation
from kernel.org is launched. There is no additional guessing of the
right location of the installed docs.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-04-05 12:29:10 -07:00
Markus Heidelberg
bf516ecaac git-gui: fix deleting from the context menu with empty selection
An "Application Error" was raised when trying to delete text from the
commit message field when no text was selected.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-03-30 07:06:37 -07:00
Alexander Gavrilov
764369c5ea git-gui: Support more git version notations.
Recently the msysgit repository has got a '1.6.1-msysgit1'
tag, which, when used to build the git version, is not
handled gracefully by the git-gui version code.

This patch changes the regular expressions to fix it, and
removes the hardcoded 'rc' string. Now git-gui can accept
a version tail like '.foo123.GIT.bar.456.7.g89ab'

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-02-08 11:50:58 -08:00
Johannes Schindelin
d4d1351b96 git-gui: Get rid of the last remnants of GIT_CONFIG_LOCAL
In dc871831(Only use GIT_CONFIG in "git config", not other programs),
GIT_CONFIG_LOCAL was rested in peace, in favor of not reading
/etc/gitconfig and $HOME/.gitconfig at all when GIT_CONFIG is set.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-12-17 07:50:55 -08:00
Alexander Gavrilov
95e706b5ec git-gui: Fix handling of relative paths in blame.
Currently using '..' or '.' in the file path for gui blame
causes it to break, because the path is passed inside the
SHA:PATH spec to cat-file, which apparently does not understand
such items. As a result, cat-file returns nothing, and the
viewer crashes because of an "index out of range" error.

This commit adds a simple function that normalizes such paths.
I choose not to use [file normalize], because it uses some data
from the file system, e.g. dereferences symlinks, and creates
an absolute path, while blame may be used to inspect historical
information that bears no relation to the current filesystem state.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-12-08 08:33:05 -08:00
Alexander Gavrilov
0ce76ded1b git-gui: Add a Tools menu for arbitrary commands.
Due to the emphasis on scriptability in the git
design, it is impossible to provide 100% complete
GUI. Currently unaccounted areas include git-svn
and other source control system interfaces, TopGit,
all custom scripts.

This problem can be mitigated by providing basic
customization capabilities in Git Gui. This commit
adds a new Tools menu, which can be configured
to contain items invoking arbitrary shell commands.

The interface is powerful enough to allow calling
both batch text programs like git-svn, and GUI editors.
To support the latter use, the commands have access
to the name of the currently selected file through
the environment.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-11-16 13:33:09 -08:00
Alexander Gavrilov
7cf4566f48 git-gui: Fix the after callback execution in rescan.
The rescan function receives a callback command
as its parameter, which is supposed to be executed
after the scan finishes. It is generally used to
update status. However, rescan may initiate a
loading of a diff, which always calls ui_ready after
completion. If the after handler is called before
that, ui_ready will override the new status.

This commit ensures that the after callback is
properly threaded through the diff machinery.

Since it uncovered the fact that force_first_diff
actually didn't work due to an undeclared global
variable, and the desired effects appeared only
because of the race condition between the diff
system and the rescan callback, I also reimplement
this function to make it behave as originally
intended.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-11-16 13:33:09 -08:00
Alexander Gavrilov
153ad78b50 git-gui: Implement system-wide configuration handling.
With the old implementation any system-wide options appear
to be set locally in the current repository. This commit
adds explicit handling of system options, essentially
interpreting them as customized default_config.

The difficulty in interpreting system options stems from
the fact that simple 'git config' lists all values, while
'git config --global' only values set in ~/.gitconfig,
excluding both local and system options.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-11-16 13:33:09 -08:00