summaryrefslogtreecommitdiff
path: root/git-gui.sh
AgeCommit message (Collapse)AuthorFilesLines
2016-10-06git-gui: handle the encoding of Git's output correctlyLibravatar Karsten Blees1-25/+4
If we use 'eval exec $opt $cmdp $args' to execute git command, tcl engine will convert the output of the git comand with the rule system default code page to unicode. But cp936 -> unicode conversion implicitly done by exec is not reversible. So we have to use git_read instead. Bug report and an original reproducer by Cloud Chou: https://github.com/msysgit/git/issues/302 Cloud Chou find the reason of the bug. Thanks-to: Johannes Schindelin <johannes.schindelin@gmx.de> Thanks-to: Pat Thoyts <patthoyts@users.sourceforge.net> Reported-by: Cloud Chou <515312382@qq.com> Original-test-by: Cloud Chou <515312382@qq.com> Signed-off-by: Karsten Blees <blees@dcon.de> Signed-off-by: Cloud Chou <515312382@qq.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2016-10-06git-gui: unicode file name support on windowsLibravatar Karsten Blees1-4/+7
Assumes file names in git tree objects are UTF-8 encoded. On most unix systems, the system encoding (and thus the TCL system encoding) will be UTF-8, so file names will be displayed correctly. On Windows, it is impossible to set the system encoding to UTF-8. Changing the TCL system encoding (via 'encoding system ...', e.g. in the startup code) is explicitly discouraged by the TCL docs. Change git-gui functions dealing with file names to always convert from and to UTF-8. Signed-off-by: Karsten Blees <blees@dcon.de> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2016-10-03git-gui i18n: mark "usage:" strings for translationLibravatar Vasco Almeida1-2/+2
Mark command-line "usage:" string for translation in git-gui.sh. Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2016-10-03Merge branch 'pt/non-mouse-usage' into puLibravatar Pat Thoyts1-41/+69
2016-10-03Merge branch 'pt/git4win-mods' into puLibravatar Pat Thoyts1-0/+4
2016-10-03git-gui: fix initial git gui message encodingLibravatar yaras1-0/+2
This fix refers https://github.com/git-for-windows/git/issues/664 After `git merge --squash` git creates .git/SQUASH_MSG (UTF-8 encoded) which contains squashed commits. When run `git gui` it copies SQUASH_MSG to PREPARE_COMMIT_MSG, but without honoring UTF-8. This leads to encoding problems on `git gui` commit prompt. The same applies on git cherry-pick conflict, where MERGE_MSG is created and then is copied to PREPARE_COMMIT_MSG. In both cases PREPARE_COMMIT_MSG must be configured to store data in UTF-8. Signed-off-by: yaras <yaras6@gmail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2016-10-03git-gui: fix detection of CygwinLibravatar Pat Thoyts1-0/+4
MSys2 might *look* like Cygwin, but it is *not* Cygwin... Unless it is run with `MSYSTEM=MSYS`, that is. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2016-10-02Amend tab ordering and text widget border and highlighting.Libravatar Pat Thoyts1-30/+38
Tab order follows widget creation order (and Z-order) so amend this to match the layout more logically. For keyboard selection a highlight around the selected text widget is useful. Customized on Windows themed Tk to follow the native theme more closely with a custom EntryFrame style. Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2016-10-01Allow keyboard control to work in the staging widgets.Libravatar Pat Thoyts1-12/+32
Keyboard focus was restricted to the commit message widget and users were forced to use the mouse to select files in the workdir widget and only then could use a key combination to stage the file. It is now possible to use key navigation (Ctrl-Tab, arrow keys and Ctrl-T or Ctrl-U) to stage and unstage files. Suggested by @koppor in git-for-window/git issue #859 Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2015-01-13git-gui: reinstate support for Tcl 8.4Libravatar Kyle J. McKay1-2/+2
Tcl 8.5 introduced an extended vsatisfies syntax that is not supported by Tcl 8.4. Since only Tcl 8.4 is required this presents a problem. The extended syntax was used starting with Git 2.0.0 in commit b3f0c5c0 (git-gui: tolerate major version changes when comparing the git version, 2014-05-17), so that a major version change would still satisfy the condition. However, what we really want is just a basic version compare, so use vcompare instead to restore compatibility with Tcl 8.4. Signed-off-by: Kyle J. McKay <mackyle@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2015-01-05git-gui: fix problem with gui.maxfilesdisplayedLibravatar Csaba Kiraly1-9/+12
gui.maxfilesdisplayed (added in dd6451f9c7c5a36d3006231b618ac6da06c7c7b4) was applied brute force on the file list in alphabetic order. As a result, files that had modifications might not be displayed by git-gui. Even worse, files that are already in the index might not be displayed, which makes git-gui hard to use in some workflows. This fix changes the meaning of gui.maxfilesdisplayed, making it a soft limit that only applies to "_O" files, i.e. files that are "Untracked, not staged". Signed-off-by: Csaba Kiraly <kiraly@disi.unitn.it> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2014-11-07git-gui: fix verbose loading when git path contains spaces.Libravatar Pat Thoyts1-3/+3
After setting GITGUI_VERBOSE to enable load tracing the source command is redefined but fails if the git installation path has spaces. Fixed quoting by using lists to handle the arguments. Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2014-11-06git-gui/gitk: Do not depend on Cygwin's "kill" command on WindowsLibravatar Sebastian Schuberth1-3/+1
Windows does not necessarily mean Cygwin, it could also be MSYS. The latter ships with a version of "kill" that does not understand "-f". In msysgit this was addressed shipping Cygwin's version of kill. Properly fix this by using the stock Windows "taskkill" command instead, which is available since Windows XP Professional. Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2014-10-06git-gui: add configurable tab size to the diff viewLibravatar Michael Lutz1-0/+1
For Tk 8.5 the "wordprocessor" mode allows us to get a bit fancy for merge diffs and intend the tabs by one to compensate for the additional diff marker at the line start. The code is heavily based on how gitk handles tabs. Signed-off-by: Michael Lutz <michi@icosahedron.de> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2014-08-10git-gui: Make git-gui lib dir configurable at runimeLibravatar David Turner1-1/+5
Introduce the GIT_GUI_LIB_DIR environment variable, to tell git-gui where to look for TCL libs. This allows a git-gui which has been built with a prefix of /foo to be run out of directory /bar. This is the equivalent of GIT_EXEC_PATH or GITPERLLIB but for git-gui's TCL libraries. Signed-off-by: David Turner <dturner@twitter.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2014-06-13git-gui: tolerate major version changes when comparing the git versionLibravatar Jens Lehmann1-2/+2
Since git 2.0.0 starting git gui in a submodule using a gitfile fails with the following error: No working directory ../../../<path> couldn't change working directory to "../../../<path>": no such file or directory This is because "git rev-parse --show-toplevel" is only run when git gui sees a git version of at least 1.7.0 (which is the version in which the --show-toplevel option was introduced). But "package vsatisfies" returns false when the major version changes, which is not what we want here. Fix that for both places where the git version is checked using vsatisfies by appending a '-' to the version number. This tells vsatisfies that a change of the major version is not considered to be a problem, as long as the new major version is larger. This is done for both the place that caused the reported bug and another spot where the git version is tested for another feature. Reported-by: Chris Packham <judge.packham@gmail.com> Reported-by: Yann Dirson <ydirson@free.fr> Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
2014-06-13git-gui: show staged submodules regardless of ignore configLibravatar Jens Lehmann1-1/+5
Currently setting submodule.<name>.ignore and/or diff.ignoreSubmodules to "all" suppresses all output of submodule changes for git-gui. This is really confusing, as even when the user chooses to record a new commit for an ignored submodule by adding it manually this change won't show up under "Staged Changes (Will Commit)". Fix that by using the '--ignore-submodules=dirty' option for both callers of "git diff-index --cached" when the underlying git version supports that option. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2014-01-18git-gui: fallback right pane to packed widgets with Tk 8.4Libravatar Max Kirillov1-11/+21
Since 918dbf58, git-gui crashes if started with Tk 8.4. The reason is that tk < 8.5 does not support -stretch option for panedwindow. Without the option it's not possible to properly expand the right half - the commit area is expanded, while desired behavior is to expand the diff area. So the whole feature should be disabled with Tk version less than 8.5. Signed-off-by: Max Kirillov <max@max630.net> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2013-09-12git-gui: add menu item to launch a bash shell on Windows.Libravatar Pat Thoyts1-0/+10
When using git-gui as the primary git application on Windows it can be awkward obtaining a suitable shell. This commit adds a menu item to the Repository menu that launches the bash shell provided with the git installation on Windows. Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2013-09-06git-gui: corrected setup of git worktree under cygwin.Libravatar John Murphy1-1/+5
Under cygwin the _gitworktree variable needs to contain the Windows style path string so the output provided by git rev-parse must be converted from cygwin path style to native. Reviewed-by: Jesse Welch <jesse.welch@baml.com> Signed-off-by: John Patrick Murphy <john.murphy@baml.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2013-08-27git-gui: right half window is panedLibravatar Max Kirillov1-5/+11
For long descriptions it would be nice to be able to resize the comment text field. Signed-off-by: Max Kirillov <max@max630.net> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2013-08-27git-gui: Add gui.displayuntracked optionLibravatar Max Kirillov1-4/+10
When git is used to track only a subset of a directory, or there is no sure way to divide files to ignore from files to track, git user have to live with large number of untracked files. These files present in file list, and should always be scrolled through to handle real changes. Situation can become even worse, then number of the untracked files grows above the maxfilesdisplayed limit. In the case, even staged can be hidden by git-gui. This change introduces new configuration variable gui.displayuntracked, which, when set to false, instructs git-gui not to show untracked files in files list. They can be staged from commandline or other tools (like IDE of file manager), then they become visible. Default value of the option is true, which is compatible with current behavior. Signed-off-by: Max Kirillov <max@max630.net> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2013-08-27git-gui: show the maxrecentrepo config option in the preferences dialogLibravatar Pat Thoyts1-0/+1
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2013-06-07git-gui: fix file name handling with non-empty prefixLibravatar John Keeping1-11/+3
Commit e3d06ca (git-gui: Detect full path when parsing arguments - 2012-10-02) fixed the handling of absolute paths passed to the browser and blame subcommands by checking whether the file exists without the prefix before prepending the prefix and checking again. Since we have chdir'd to the top level of the working tree before doing this, this does not work if a file with the same name exists in a subdirectory and at the top level (for example Makefile in git.git's t/ directory). Instead of doing this, revert that patch and fix absolute path issue by using "file join" to prepend the prefix to the supplied path. This will correctly handle absolute paths by skipping the prefix in that case. Acked-by: Andrew Wong <andrew.kw.w@gmail.com> Signed-off-by: John Keeping <john@keeping.me.uk> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2013-06-07git-gui: bring wish process to front on MacLibravatar Stefan Haller1-0/+14
On Mac OS X, any application that is started from the Terminal will open behind all running applications; as a work-around, manually bring ourselves to the front. (Stolen from gitk, commit 76bf6ff93e.) We do this as the very first thing, so that any message boxes that might pop up during the rest of the startup sequence are actually seen by the user. [PT: added catch and moved down to ensure Tk has been loaded] Signed-off-by: Stefan Haller <stefan@haller-berlin.de> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2012-11-13git-gui: Fix parsing of <rev> <path-which-not-present-in-worktree>Libravatar Kirill Smelkov1-0/+1
Commit e3d06ca9 (git-gui: Detect full path when parsing arguments) broke git gui blame rev path-not-present-in-worktree in particular this does not work anymore: # in linux.git $ git gui blame 2bb8c26242c2393b097a993ffe9b003ec9b85395 drivers/net/sky2.c This patch restores the original functionality in this case. Acked-by: Andrew Wong <andrew.kw.w@gmail.com> Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2012-10-17git-gui: Don't prepend the prefix if value looks like a full pathLibravatar Andrew Wong1-2/+7
When argument parsing fails to detect a file name, "git-gui" will try to use the previously detected "head" as the file name. We should avoid prepending the prefix if "head" looks like a full path. Signed-off-by: Andrew Wong <andrew.kw.w@gmail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2012-10-17git-gui: Detect full path when parsing argumentsLibravatar Andrew Wong1-1/+10
When running "git-gui blame" from a subfolder (which means prefix is non-empty), if we pass a full path as argument, the argument parsing will fail to recognize the argument as a file name, because prefix is prepended to the argument. This patch handles that scenario by adding an additional branch that checks the file name without using the prefix. Signed-off-by: Andrew Wong <andrew.kw.w@gmail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2012-09-17git-gui: Fix semi-working shortcuts for unstage and revertLibravatar Vitaly _Vi Shukela1-0/+4
Make Ctrl+U for unstaging and Ctrl+J for reverting selection behave more like Ctrl+T for adding. They were working only when one area was focused (diff or commit message), now they should work everywhere. Acked-by: Bert Wesarg <bert.wesarg@googlemail.com> Signed-off-by: Vitaly _Vi Shukela <vi0oss@gmail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2012-04-19git-gui: preserve commit messages in utf-8Libravatar Pat Thoyts1-3/+8
The commit message buffer is automatically preserved to a local file but this uses the system encoding which may fail to properly encode unicode text. Forcing this file to use utf-8 preserves the message correctly. Reported-by: Ángel José Riesgo <ajriesgo@gmail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2012-03-25git-gui: open console when using --trace on windowsLibravatar Heiko Voigt1-0/+1
When starting a gui program on windows stdout, stderr and stdin are not connected to the cmd console. As a workaround tk has a console window. Lets open this when the --trace commandline option has been given. This is helpful for debugging. Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2011-12-09git-gui: handle shell script text filters when loading for blame.Libravatar Pat Thoyts1-0/+29
When loading a file into the blame window git-gui does all the work and must handle the text conversion filters if defined. On Windows it is necessary to detect the need for a shell script explicitly. Such filter commands are run using non-blocking I/O but this has the unfortunate side effect of losing any error that might be reported when the pipe is closed. Switching to blocking mode just before closing enables reporting of errors in the filter scripts to the user. Tested-by: Sebastian Schuberth <sschuberth@gmail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2011-12-07git-gui: Set both 16x16 and 32x32 icons on X to pacify Xming.Libravatar Samuel Bronson1-1/+4
It would be better if the 32x32 icon was equivalent to the one used on Windows (in git-gui.ico), but I'm not sure how that would best be done, so I copied this code from gitk instead. Signed-off-by: Samuel Bronson <naesten@gmail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2011-11-30git-gui: added config gui.gcwarning to disable the gc hint messageLibravatar Pat Thoyts1-1/+1
On startup in multicommit mode git-gui checks to see if the repository has a lot of objects. If so it shows a dialog suggesting gc be run. This adds 'gui.gcwarning' as a control config variable to allow this to be disabled. The default is true (the warning is shown). Setting this false will prevent the check being done. Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2011-11-05git-gui: add config value gui.diffopts for passing additional diff optionsLibravatar Tilman Vogel1-0/+1
Signed-off-by: Tilman Vogel <tilman.vogel@web.de> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2011-11-04git-gui: support underline style when parsing diff outputLibravatar Pat Thoyts1-0/+1
Suggested-by: Bert Wesarg <bert.wesarg@googlemail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2011-10-19Merge branch 'bw/searching'Libravatar Pat Thoyts1-2/+14
2011-10-18git-gui: new config to control staging of untracked filesLibravatar Bert Wesarg1-0/+1
The default is the current "ask". Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2011-10-18git-gui: handle config booleans without valueLibravatar Bert Wesarg1-2/+14
When git interprets a config variable without a value as bool it is considered as true. But git-gui doesn't so until yet. The value for boolean configs are also case-insensitive. Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2011-10-18git-gui: fix multi selected file operationLibravatar Bert Wesarg1-0/+1
When staging a selection of files using Shift-Click to choose a range of files then using Ctrl-T or the Stage To Commit menu item will stage all the selected files. However if a non-sequential range is selected using Ctrl-Click then all but the first name selected gets staged. This commit fixes this to properly stage all selected files by explicitly adding the path to the list before showing the diff. Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2011-07-11Fix typo: existant->existentLibravatar Dmitry Ivankov1-1/+1
This typo was discovered in core git sources. Clean in it up in git-gui too. There is just one occurence in a comment line. Signed-off-by: Dmitry Ivankov <divanorama@gmail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2011-05-20git-gui: warn when trying to commit on a detached headLibravatar Heiko Voigt1-0/+1
The commandline is already warning when checking out a detached head. Since the only thing thats potentially dangerous is to create commits on a detached head lets warn in case the user is about to do that. Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2011-03-25git-gui: detect the use of MUI langauge packs on WindowsLibravatar Pat Thoyts1-0/+19
The Tcl msgcat package doesn't detect the use of a multi-lingual language pack on Windows 7. This means that a user may have their display language set to Japanese but the system installed langauge was English. This patch reads the relevent registry key to fix this before loading in the locale specific parts of git-gui. Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2011-02-13git-gui: always default to the last merged branch in remote deleteLibravatar Heiko Voigt1-0/+4
This is useful if you are directly working together with other developers pushing feature branches on a shared remote. You typically push feature branches to the remote so others can review. Once they are satisfied and the branch is merged into the main branch it needs to be deleted on the server. Since we did not yet have a preselected default branch in the remote delete dialog lets use the last merged branch if it is found on the server. Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2011-01-28git-gui: learn more type change statesLibravatar Bert Wesarg1-2/+6
Support the following states with type change in git-gui: AT, MT, TD, TM Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2011-01-28git-gui: fix typo in image dataLibravatar Bert Wesarg1-2/+2
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-12-10git-gui: use --exclude-standard to check for untracked filesLibravatar Stefan Naewe1-7/+11
This fixes git-gui failing to display untracked files that are listed if core.excludefiles is set to ~/.gitexcludes [PT: added expansion of core.excludesfile value by tcl] Signed-off-by: Stefan Naewe <stefan.naewe@googlemail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-12-06git-gui: Fix use of hunk tag for non-hunk content.Libravatar Bert Wesarg1-0/+2
The hunk tag d_@ lost its blue forground color in "apply color information from git diff output" (2010-10-22, 8f85599). But this tag was also used for non-hunk content like untracked file mime types or git submodules. Introduce a new tag for this type of content which has the blue forground again. Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-11-19git-gui: respect conflict marker sizeLibravatar Bert Wesarg1-3/+3
Respect the conflict-marker-size attribute on paths when detecting merge conflicts. [PT: fixed problem with variable substitution in the regexps] Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-10-27git-gui: apply color information from git diff outputLibravatar Pat Thoyts1-1/+9
This patch extracts the ANSI color sequences from git diff output and applies these to the diff view window. This ensures that the gui view makes use of the current git configuration for whitespace display. ANSI codes may include attributes, foreground and background in a single sequence. Handle this and support bold and reverse attributes. Ignore all other attributes. Suggested-by: Tor Arvid Lund <torarvid@gmail.com> Suggested-by: Junio C Hamano <gitster@pobox.com> Tested-by: Tor Arvid Lund <torarvid@gmail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>