summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2017-01-20git gui: allow for a long recentrepo listLibravatar Philip Oakley1-1/+5
The gui.recentrepo list may be longer than the maxrecent setting. Allow extra space to show any extra entries. In an ideal world, the git gui would limit the number of entries to the maxrecent setting, however the recentrepo config list may have been extended outwith the gui, or the maxrecent setting changed to a reduced value. Further, when testing the gui's recentrepo logic it is useful to show these extra, but valid, entries. Signed-off-by: Philip Oakley <philipoakley@iee.org>
2017-01-20git gui: de-dup selected repo from recentrepo historyLibravatar Philip Oakley1-4/+3
When the gui/user selects a repo for display, that repo is brought to the end of the recentrepo config list. The logic can fail if there are duplicate old entries for the repo (you cannot unset a single config entry when duplicates are present). Similarly, the maxrecentrepo logic could fail if older duplicate entries are present. The first commit of this series ({this}~2) fixed the config unsetting issue. Rather than manipulating a local copy of the $recent list (one cannot know how many entries were removed), simply re-read it. We must also catch the error when the attempt to remove the second copy from the re-read list is performed. Signed-off-by: Philip Oakley <philipoakley@iee.org>
2017-01-20git gui: cope with duplicates in _get_recentrepoLibravatar Philip Oakley1-2/+2
_get_recentrepo will fail if duplicate invalid entries are present in the recentrepo config list. The previous commit fixed the 'git config' limitations in _unset_recentrepo by unsetting all config entries, however this code would fail on the second attempt to unset it. Refactor the code to pre-sort and de-duplicate the recentrepo list to avoid a potential second unset attempt. Signed-off-by: Philip Oakley <philipoakley@iee.org>
2017-01-20git-gui: remove duplicate entries from .gitconfig's gui.recentrepoLibravatar Philip Oakley1-1/+1
The git gui's recent repo list may become contaminated with duplicate entries. The git gui would barf when attempting to remove one entry. Remove them all - there is no option within 'git config' to selectively remove one of the entries. This issue was reported on the 'Git User' list (https://groups.google.com/forum/#!topic/git-users/msev4KsQGFc, Warning: gui.recentrepo has multiply values while executing). And also by zosrothko as a Git-for-Windows issue https://github.com/git-for-windows/git/issues/1014. On startup the gui checks that entries in the recentrepo list are still valid repos and deletes thoses that are not. If duplicate entries are present the 'git config --unset' will barf and this prevents the gui from starting. Subsequent patches fix other parts of recentrepo logic used for syncing internal lists with the external .gitconfig. Reported-by: Alexey Astakhov <asstv7@gmail.com> Signed-off-by: Philip Oakley <philipoakley@iee.org>
2016-10-20Merge branch 'as/bulgarian' into puLibravatar Pat Thoyts1-4/+4
2016-10-20git-gui: Mark 'All' in remote.tcl for translationLibravatar Alexander Shopov1-4/+4
Signed-off-by: Alexander Shopov <ash@kambanaria.org> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2016-10-20Merge branch 'os/preserve-author' into puLibravatar Pat Thoyts1-3/+33
2016-10-06git-gui: avoid persisting modified author identityLibravatar Pat Thoyts1-20/+31
Commit 7e71adc77f fixes a problem with git-gui failing to pick up the original author identity during a commit --amend operation. However, the new author details then become persistent for the remainder of the session. This commit fixes this by ensuring the environment variables are reset and the author information reset once the commit is completed. The relevant changes were reworked to reduce global variables. Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2016-10-06git-gui: unicode file name support on windowsLibravatar Karsten Blees2-4/+4
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-04git-gui: maintain backwards compatibility for merge syntaxLibravatar Pat Thoyts1-1/+10
Commit b5f325c updated to use the newer merge syntax but continue to support older versions of git. Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2016-10-03git-gui i18n: mark string in lib/error.tcl for translationLibravatar Vasco Almeida1-1/+1
Mark string "$hook hook failed:" in lib/error.tcl for translation. Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2016-10-03git-gui: fix incorrect use of Tcl append commandLibravatar Vasco Almeida15-26/+25
Fix wrong use of append command in strings marked for translation. According to Tcl/Tk Documentation [1], append varName ?value value value ...? appends all value arguments to the current value of variable varName. This means that append "[appname] ([reponame]): " [mc "File Viewer"] is setting a variable named "[appname] ([reponame]): " to the output of [mc "File Viewer"], rather than returning the concatenation of both expressions as one might expect. The format for some strings enables, for instance, a French translator to translate like "%s (%s) : Create Branch" (space before colon). Conversely, strings already translated will be marked as fuzzy and the translator must update them herself. For some cases, use alternative way for concatenation instead of using strcat procedure defined in git-gui.sh. Reference: 31bb1d1 ("git-gui: Paper bag fix missing translated strings", 2007-09-14) fixes the same issue slightly differently. [1] http://www.tcl.tk/man/tcl/TclCmd/append.htm Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2016-10-03git-gui i18n: internationalize use of colon punctuationLibravatar Vasco Almeida4-7/+7
Internationalize use of colon punctuation ':' in options window, windows titles, database statistics window. Some languages might use a different style, for instance French uses "User Name :" (space before colon). 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-1/+86
2016-10-03Merge branch 'pt/git4win-mods' into puLibravatar Pat Thoyts1-4/+7
2016-10-03Merge branch 'patches' into puLibravatar Pat Thoyts2-0/+6
2016-10-03git-gui: ensure the file in the diff pane is in the list of selected filesLibravatar Alex Riesen1-0/+3
It is very confusing that the file which diff is displayed is marked as selected, but it is not in fact selected (that means the array of selected files does not include the file in question). Fixing this also improves the use of $FILENAMES in custom defined tools: one does not have to click the file in the list to make it selected. Signed-off-by: Alex Riesen <alexander.riesen@cetitec.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2016-10-03git-gui: support for $FILENAMES in tool definitionsLibravatar Alex Riesen1-0/+3
This adds a FILENAMES environment variable, which contains the repository pathnames of all selected files the list. The variable contains the names separated by LF (\n, \x0a). If the file names contain LF characters, the tool command might be unable to unambiguously split the value of $FILENAME into the separate names. Note that the file marked and diffed immediately after starting the GUI up, is not actually selected. One must click on it once to really select it. Signed-off-by: Alex Riesen <alexander.riesen@cetitec.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2016-10-03Merge branch 'va/i18n' into puLibravatar Pat Thoyts1-3/+3
2016-10-03Merge branch 'rs/use-modern-git-merge-syntax' into puLibravatar Pat Thoyts1-6/+1
2016-10-03git-gui (Windows): use git-gui.exe in `Create Desktop Shortcut`Libravatar Pat Thoyts1-4/+7
When calling `Repository>Create Desktop Shortcut`, Git GUI assumes that it is okay to call `wish.exe` directly on Windows. However, in Git for Windows 2.x' context, that leaves several crucial environment variables uninitialized, resulting in a shortcut that does not work. To fix those environment variable woes, Git for Windows comes with a convenient `git-gui.exe`, so let's just use it when it is available. This fixes https://github.com/git-for-windows/git/issues/448 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-1/+86
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-09-26git-gui i18n: mark strings for translationLibravatar Vasco Almeida1-3/+3
Mark strings for translation in lib/index.tcl that were seemingly left behind by 700e560 ("git-gui: Mark forgotten strings for translation.", 2008-09-04) which marks string in do_revert_selection procedure. These strings are passed to unstage_help and add_helper procedures. Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-26git-gui: stop using deprecated merge syntaxLibravatar René Scharfe1-6/+1
Starting with v2.5.0 git merge can handle FETCH_HEAD internally and warns when it's called like 'git merge <message> HEAD <commit>' because that syntax is deprecated. Use this feature in git-gui and get rid of that warning. Signed-off-by: Rene Scharfe <l.s.r@web.de> Tested-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-11git-gui: respect commit.gpgsign againLibravatar Johannes Schindelin1-0/+3
As of v2.9.0, `git commit-tree` no longer heeds the `commit.gpgsign` config setting. This broke committing with GPG signature in Git GUI. This fixes https://github.com/git-for-windows/git/issues/850 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-04-14git-gui: Do not reset author details on amendLibravatar Orgad Shaneh1-0/+19
git commit --amend preserves the author details unless --reset-author is given. git-gui discards the author details on amend. Fix by reading the author details along with the commit message, and setting the appropriate environment variables required for preserving them. Reported long ago in the mailing list[1]. [1] http://article.gmane.org/gmane.comp.version-control.git/243921 Signed-off-by: Orgad Shaneh <orgad.shaneh@audiocodes.com>
2015-03-07git-gui: Makes chooser set 'gitdir' to the resolved pathLibravatar Remi Rampin1-3/+8
If _is_git follows a "gitdir: ..." file link to get to the actual repository, we want _gitdir to be set to that final path. Signed-off-by: Chris Packham <judge.packham@gmail.com> Signed-off-by: Remi Rampin <remirampin@gmail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2015-03-07git-gui: Fixes chooser not accepting gitfilesLibravatar Remi Rampin1-0/+10
Support the case where .git is a platform independent symbolic link and not a directory. This occurs when --separate-git-dir is used when creating the local repository to store the .git directory elsewhere. git-gui does not support such repositories when using the repository chooser as the test to determine that the chosen directory is a git repository fails for such repositories. This commit enables _is_git to read the real location from the symbolic link file. Signed-off-by: Chris Packham <judge.packham@gmail.com> Signed-off-by: Remi Rampin <remirampin@gmail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2014-10-06git-gui: add configurable tab size to the diff viewLibravatar Michael Lutz2-1/+20
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-06-13git-gui: align the new recursive checkbox with the radiobuttons.Libravatar Pat Thoyts1-1/+1
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2014-06-13git-gui: Add a 'recursive' checkbox in the clone menu.Libravatar Henri GEIST1-2/+32
Permit to do a 'git clone --recursive' through git-gui. Add a 'recursive' checkbox in the clone menu which allows users to clone a repository and all its submodules in one go (unless the 'update' flag is set to "none" in the .gitmodules file for a submodule, in that case that specific submodule is not cloned automatically). Enable this new option per default, as most users want to clone all submodules too when cloning the superproject (This is currently not possible without leaving git gui or adding a custom tool entry for that). Signed-off-by: Henri GEIST <geist.henri@laposte.net> Thanks-to: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2014-06-13git-gui: show staged submodules regardless of ignore configLibravatar Jens Lehmann1-0/+3
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>
2013-11-15git-gui: correct spelling errors in commentsLibravatar Masanari Iida3-4/+4
Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2013-08-27git-gui: Add gui.displayuntracked optionLibravatar Max Kirillov1-0/+1
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-08-27git-gui: added gui.maxrecentrepo to extend the number of remembered reposLibravatar Pat Thoyts1-2/+10
The list of recently opened repositories shown when launching git-gui from outside a repository was hard coded to only show a maximum of 10 items. This config variable allows the user to override this default. Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2013-06-15git-gui: avoid an error message when removing the last remoteLibravatar Pat Thoyts1-2/+4
When the last remote is removed on a system that has tearoff menu items the code that adjusts the fetch and prune menus may raise an error when probing the menu entry for a non-existing -label option. Check the entry type to avoid this fault. Reported-by: Vedran Miletić <rivanvx@gmail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2013-05-17git-gui: change dialog button positions for Windows to suit platform.Libravatar Pat Thoyts1-1/+3
On windows it is more common to have cancel furthest on the right. Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2013-05-16git-gui: allow "\ No newline at end of file" for linewise stagingLibravatar Heiko Voigt1-2/+9
Counting of lines did not skip this line when generating the hunk header. Acked-by: Tobias Preuss <tobias.preuss@googlemail.com> Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2013-02-22git-gui: fix the mergetool launcher for the Beyond Compare tool.Libravatar Pat Thoyts1-2/+2
When using Beyond Compare as the mergetool it fails to save the merged result correctly due to a quoting problem when executing the tool. This patch solves the quoting problem. Signed-off-by: Warren Falk <warren@warrenfalk.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2012-09-17git-gui: remove .git/CHERRY_PICK_HEAD after committingLibravatar Beat Bolli1-0/+1
Adding _git_ps1() to one's bash prompt displays various repo status info after each command. After committing a git cherry-pick -n using git-gui, the prompt still contains the "|CHERRY-PICKING" flag. Delete the file causing this flag when cleaning up. Signed-off-by: Beat Bolli <bbolli@ewanet.ch> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2012-09-17git-gui: Fix a loose/lose mistakeLibravatar Beat Bolli1-1/+1
Acked-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Beat Bolli <bbolli@ewanet.ch> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2012-01-22git-gui: fix git-gui crash due to uninitialized variableLibravatar Clemens Buchacher1-0/+1
Recently, a clone initiated via git gui on Windows crashed on me due to an "unknown variable cdone". It turns out that there is a code path where this variable is used uninitialized. Signed-off-by: Clemens Buchacher <drizzd@aon.at> 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-11/+8
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-11-05git-gui: don't warn for detached head when rebasingLibravatar Bert Wesarg1-1/+3
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2011-11-05git-gui: make config gui.warndetachedcommit a booleanLibravatar Bert Wesarg2-1/+2
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2011-11-05git-gui: add config value gui.diffopts for passing additional diff optionsLibravatar Tilman Vogel2-0/+2
Signed-off-by: Tilman Vogel <tilman.vogel@web.de> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2011-11-04git-gui: sort the numeric ansi codesLibravatar Pat Thoyts1-1/+1
This ensures that underline does not conflict with inverse colors. Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2011-11-04git-gui: support underline style when parsing diff outputLibravatar Pat Thoyts1-1/+1
Suggested-by: Bert Wesarg <bert.wesarg@googlemail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2011-10-31git-gui: fix spelling error in sshkey.tclLibravatar Dejan Ribič1-1/+1
Spelling error originally reported to Ubuntu as launchpad bug #879427. Acked-by: Erik Faye-Lund <kusmabite@gmail.com> Signed-off-by: Dejan Ribič <dejan.ribic@gmail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>