summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-02-22Merge branch 'py/commit-comments'Libravatar Pratyush Yadav2-2/+21
Use git-stripspace to remove comment lines from the commit message. Also use it to clean up whitespace instead of rolling our own logic. * py/commit-comments: git-gui: remove lines starting with the comment character
2021-02-18git-gui: remove lines starting with the comment characterLibravatar Pratyush Yadav2-2/+21
The comment character is specified by the config variable 'core.commentchar'. Any lines starting with this character is considered a comment and should not be included in the final commit message. Teach git-gui to filter out lines in the commit message that start with the comment character using git-stripspace. If the config is not set, '#' is taken as the default. Also add a message educating users about the comment character. Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2021-02-02Merge branch 'mk/russian-translation'Libravatar Pratyush Yadav1-1/+1
Fix typo in Russian translation. * mk/russian-translation: git-gui: fix typo in russian locale
2021-02-02git-gui: fix typo in russian localeLibravatar Mikhail Klyushin1-1/+1
Fixed typo in russian locale: издекса -> индекса Signed-off-by: Mikhail Klyushin <klyushinmisha@gmail.com> Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2020-12-19Merge branch 'sh/inactive-background'Libravatar Pratyush Yadav2-16/+37
Set a different background color for selections in inactive widgets. This inactive color is calculated from the current theme colors to make sure it works for all themes. * sh/inactive-background: git-gui: use gray background for inactive text widgets
2020-12-19git-gui: use gray background for inactive text widgetsLibravatar Stefan Haller2-16/+37
This makes it easier to see at a glance which of the four main views has the keyboard focus. Signed-off-by: Stefan Haller <stefan@haller-berlin.de> Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2020-12-18Merge branch 'st/selected-text-colors'Libravatar Pratyush Yadav1-2/+4
Set colors for selected text properly. * st/selected-text-colors: git-gui: Fix selected text colors
2020-12-18git-gui: Fix selected text colorsLibravatar Serg Tereshchenko1-2/+4
Added selected state colors for text widget. Same colors for active and inactive selection, to match previous behaviour. Signed-off-by: Serg Tereshchenko <serg.partizan@gmail.com> Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2020-12-18Merge branch 'rj/clean-speedup'Libravatar Pratyush Yadav1-0/+2
Speed up 'make clean' on Cygwin. * rj/clean-speedup: Makefile: conditionally include GIT-VERSION-FILE
2020-12-18Makefile: conditionally include GIT-VERSION-FILELibravatar Ramsay Jones1-0/+2
The 'clean' target is noticeably slow on cygwin, even for a 'do-nothing' invocation of 'make clean'. For example, the second 'make clean' given below: $ make clean >/dev/null 2>&1 $ make clean GITGUI_VERSION = 0.21.0.85.g3e5c rm -rf git-gui lib/tclIndex po/*.msg rm -rf GIT-VERSION-FILE GIT-GUI-VARS $ has been timed at 1.934s on my laptop (an old core i5-4200M @ 2.50GHz, 8GB RAM, 1TB HDD). Notice that the Makefile, as part of processing the 'clean' target, is updating the 'GIT-VERSION-FILE' file. This is to ensure that the $(GITGUI_VERSION) make variable is set, once that file had been included. However, the 'clean' target does not use the $(GITGUI_VERSION) variable, so this is wasted effort. In order to eliminate such wasted effort, use the value of the internal $(MAKECMDGOALS) variable to only '-include GIT-VERSION-FILE' when the target is not 'clean'. (This drops the time down to 0.676s, on my laptop, giving an improvement of 65.05%). Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com> Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2020-12-18Merge branch 'sh/macos-labels'Libravatar Pratyush Yadav1-2/+2
Fix label background colors on MacOS when ttk is enabled. * sh/macos-labels: git-gui: fix colored label backgrounds when using themed widgets
2020-12-18git-gui: fix colored label backgrounds when using themed widgetsLibravatar Stefan Haller1-2/+2
The aqua theme on Mac doesn't support changing the background color for labels and frames [1]. Since the red, green, and yellow backgrounds of the labels for unstaged and staged files and the diff pane are so important design elements of git gui's main window, it's not acceptable for them to have grey backgrounds on Mac. To work around this, simply use non-themed widgets for all labels on Mac. This is not a big problem because labels don't look extremely different between the themed and non-themed versions. There are subtle differences, but they are not as bad as having the wrong background color. [1] https://stackoverflow.com/a/6723911 Signed-off-by: Stefan Haller <stefan@haller-berlin.de> Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2020-12-02Merge branch 'da/askpass-mask-checkbox'Libravatar Pratyush Yadav1-1/+14
Add a checkbox in the SSH askpass helper to optionally show the input text which is often a password. * da/askpass-mask-checkbox: git-gui: ssh-askpass: add a checkbox to show the input text
2020-12-02git-gui: ssh-askpass: add a checkbox to show the input textLibravatar David Aguilar1-1/+14
Hide the input text by default since the field is commonly used for sensative informations such as passwords. Add a "Show input" checkbox to conditionally show the input. Helped-by: Miguel Boekhold <miguel.boekhold@osudio.com> Signed-off-by: Efimov Vasily <laer.18@gmail.com> Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2020-12-02Merge branch 'dr/russian-translation'Libravatar Pratyush Yadav1-1375/+1644
Update Russian translation. * dr/russian-translation: git-gui: update Russian translation
2020-12-02git-gui: update Russian translationLibravatar Dimitriy Ryazantcev1-1375/+1644
Translation is done on Transifex: https://www.transifex.com/djm00n/git-po-ru/git-gui/ If you have any corrections please report them there. Signed-off-by: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com> Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2020-12-02Merge branch 'ms/commit-template'Libravatar Pratyush Yadav2-3/+10
Teach git-gui to read the commit message template and pre-populate it in the commit message buffer. * ms/commit-template: git-gui: use commit message template git-gui: Only touch GITGUI_MSG when needed
2020-11-27git-gui: use commit message templateLibravatar Martin Schön2-0/+8
Use the file described by commit.template (if set) to show the commit message template, just like other GUIs. Signed-off-by: Martin Schön <Martin.Schoen@loewensteinmedical.de> Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2020-11-27git-gui: Only touch GITGUI_MSG when neededLibravatar Pratyush Yadav1-3/+2
In 4e55d19 (git-gui: Cleanup end-of-line whitespace in commit messages., 2007-01-25), the logic to decide if GITGUI_MSG should be saved or deleted was updated to not require the commit message buffer to be modified. This fixes a situation where if the user quits and restarts git-gui multiple times the commit message buffer was lost. Unfortunately, the fix was not quite correct. The check for whether the commit message buffer has been modified is useless. If the commit is _not_ amend, then the check is never performed. If the commit is amend, then saving the message does not matter anyway. Amend state is destroyed on exit and the next time git-gui is opened it starts from scratch, but with the older message retained in the buffer. If amend is selected, the current message is over-written by the amend commit's message. The correct fix would be to not touch GITGUI_MSG at all if the commit message buffer is not modified. This way, the file is not deleted even on multiple restarts. It has the added benefit of not writing the file unnecessarily on every exit. Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2020-10-17Merge branch 'sh/blame-tooltip'Libravatar Pratyush Yadav1-0/+1
Make sure `git gui blame` tooltips are destroyed once the window loses focus on MacOS. * sh/blame-tooltip: git-gui: blame: prevent tool tips from sticking around after Command-Tab
2020-10-17git-gui: blame: prevent tool tips from sticking around after Command-TabLibravatar Stefan Haller1-0/+1
On Mac, tooltips are not automatically removed when a window loses focus. Furthermore, mouse-move events are only dispatched to the active window, which means that if we Command-tab to another application while a tool tip is showing, the tool tip will stay there forever (in front of other applications). So we must hide it manually when we lose focus. Do this unconditionally here (i.e. without if {[is_MacOSX]}); it shouldn't hurt on other platforms, even though they don't seem to have this problem. Signed-off-by: Stefan Haller <stefan@haller-berlin.de> Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2020-10-08Merge branch 'st/dark-mode' into masterLibravatar Pratyush Yadav2-6/+49
Improve dark mode support. Do not hard-code widget colors and instead pull them from the current theme and update them in the options database. * st/dark-mode: git-gui: improve dark mode support
2020-10-07git-gui: improve dark mode supportLibravatar Serg Tereshchenko2-6/+49
The colors of some ttext widgets are hard-coded. These hard-coded colors are okay with a light theme but with a dark theme some widgets are dark colored and the hard-coded ones are still light. This defeats the purpose of applying the theme and makes the UI look very awkward. Remove the hard-coded colors in ttext calls and use colors from the theme for those widgets via Text.Background and Text.Foreground from the option database. Similarly, the highlighting for the currently selected file(s) in the "Staged Files" and "Unstaged Files" sections is also hard-coded. Pull the colors for that from the current theme to make sure it is in line Signed-off-by: Serg Tereshchenko <serg.partizan@gmail.com> Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2020-09-22Merge branch 'st/spaces-tabs-cleanup' into masterLibravatar Pratyush Yadav1-43/+43
Clean up some whitespace. * st/spaces-tabs-cleanup: git-gui: fix mixed tabs and spaces; prefer tabs
2020-09-22git-gui: fix mixed tabs and spaces; prefer tabsLibravatar Serg Tereshchenko1-43/+43
Spaces are replaced with tabs when possible. In some cases just replacing spaces with tabs would break readability, so it was left as it is. Signed-off-by: Serg Tereshchenko <serg.partizan@gmail.com> Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2020-06-22Merge branch 'mt/open-worktree'Libravatar Pratyush Yadav1-24/+3
Clean up the code that checks if a directory is a Git repo. Use git rev-parse instead of rolling our own logic to find that out. A side effect (which also happens to be the main motivation behind it) of this change is that git-gui can now open worktrees other than the main worktree. * mt/open-worktree: git-gui: allow opening work trees from the startup dialog
2020-06-08git-gui: allow opening work trees from the startup dialogLibravatar Mikhail Terekhov1-24/+3
In proc _is_git check that supplied path is a valid work tree path. This allows the choose_repository::pick dialog to accept path to a work tree directory. Signed-off-by: Mikhail Terekhov <termim@gmail.com> Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2020-05-21Merge branch 'il/ctrl-bs-del'Libravatar Pratyush Yadav1-0/+2
Allow deleting words backwards and forwards using Ctrl + Backspace and Delete in the commit message buffer. * il/ctrl-bs-del: git-gui: Handle Ctrl + BS/Del in the commit msg
2020-05-12git-gui: Handle Ctrl + BS/Del in the commit msgLibravatar Ismael Luceno1-0/+2
- Control+BackSpace: Delete word to the left of the cursor. - Control+Delete : Delete word to the right of the cursor. Originally introduced by BRIEF and Turbo Vision between 1985 and 1992, they were adopted by most CUA-Compliant UIs, including those of: OS/2, Windows, Mac OS, Qt, GTK, Open/Libre Office, Gecko, and GNU Emacs. In both cases Tk already implements the functionality bound to other key combination, so we use that. Graphical examples: Deleting to the left: v------ pointer X_WORD____X ^-----^------ selection Deleting to the right: v--------- pointer X_WORD_X ^--^------ selection Signed-off-by: Ismael Luceno <ismael.luceno@tttech-auto.com> Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2020-05-05Merge branch 'ar/ui-ready-semicolon'Libravatar Pratyush Yadav3-6/+6
Fix syntax error popups because of missing semicolons. * ar/ui-ready-semicolon: Subject: git-gui: fix syntax error because of missing semicolon
2020-04-22Subject: git-gui: fix syntax error because of missing semicolonLibravatar Ansgar Röber3-6/+6
For some asynchronous operations, we build a chain of callbacks to execute when the operation is done. These callbacks are held in $after, and a new callback can be added by appending to $after. Once the operation is done, $after is executed as a script. But if we don't append a semi-colon after the procedure calls, they will appear to Tcl as arguments to the previous procedure's arguments. So, for example, if $after is "foo", and we just append "bar", then $after becomes "foo bar", and bar will be treated as an argument to foo. If foo does not accept any optional arguments, it would result in Tcl throwing an error. If instead we do append a semi-colon, $after will look like "foo;bar;", and these will be treated as two separate procedure calls. Before d9c6469 (git-gui: update status bar to track operations, 2019-12-01), this problem was masked because ui_ready/ui_status did accept an optional argument. In d9c6469, ui_ready stopped accepting an optional argument, and this error started showing up. Another instance of this problem is when a call to ui_status without a trailing semicolon. ui_status never accepted an optional argument to begin with, but the issue never managed to surface. So, fix these errors by making sure we always append a semi-colon after procedure calls when multiple callbacks are involved in $after. Helped-by: Pratyush Yadav <me@yadavpratyush.com> Signed-off-by: Ansgar Röber <ansgar.roeber@rwth-aachen.de>
2020-03-19Merge branch 'py/remove-tcloo'Libravatar Pratyush Yadav3-35/+35
Reduce the Tcl version requirement to 8.5 to allow git-gui to run on MacOS distributions like High Sierra. While here, fix a potential variable name collision. * py/remove-tcloo: git-gui: create a new namespace for chord script evaluation git-gui: reduce Tcl version requirement from 8.6 to 8.5
2020-03-17git-gui: create a new namespace for chord script evaluationLibravatar Pratyush Yadav1-2/+4
Evaluating the script in the same namespace as the chord itself creates potential for variable name collision. And in that case the script would unknowingly use the chord's variables. For example, say the script has a variable called 'is_completed', which also exists in the chord's namespace. The script then calls 'eval' and sets 'is_completed' to 1 thinking it is setting its own variable, completely unaware of how the chord works behind the scenes. This leads to the chord never actually executing because it sees 'is_completed' as true and thinks it has already completed. Avoid the potential collision by creating a separate namespace for the script that is a child of the chord's namespace. Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2020-03-17git-gui: reduce Tcl version requirement from 8.6 to 8.5Libravatar Pratyush Yadav3-35/+33
On some MacOS distributions like High Sierra, Tcl 8.5 is shipped by default. This makes git-gui error out at startup because of the version mismatch. The only part that requires Tcl 8.6 is SimpleChord, which depends on TclOO. So, don't use it and use our homegrown class.tcl instead. This means some slight syntax changes. Since class.tcl doesn't have an "unknown" method like TclOO does, we can't just call '$note', but have to use '$note activate' instead. The constructor now needs a proper namespace qualifier. Update the documentation to reflect the new syntax. As of now, the only part of git-gui that needs Tcl 8.5 is a call to 'apply' in lib/index.tcl::lambda. Keep using it until someone shows up shouting that their OS ships with 8.4 only. Then we would have to look into implementing it in pure Tcl. Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2020-03-14Merge branch 'js/askpass-coerce-utf8'Libravatar Pratyush Yadav1-0/+5
Askpass can now send non-ASCII to Git on Windows. * js/askpass-coerce-utf8: git-gui--askpass: coerce answers to UTF-8 on Windows
2020-03-14git-gui--askpass: coerce answers to UTF-8 on WindowsLibravatar Luke Bonanomi1-0/+5
This addresses the issue where Git for Windows asks the user for a password, no credential helper is available, and then Git fails to pick up non-ASCII characters from the Git GUI helper. This can be verified e.g. via echo host=http://abc.com | git -c credential.helper= credential fill and then pasting some umlauts. The underlying reason is that Git for Windows tries to communicate using the UTF-8 encoding no matter what the actual current code page is. So let's indulge Git for Windows and do use that encoding. This fixes https://github.com/git-for-windows/git/issues/2215 Signed-off-by: Luke Bonanomi <lbonanomi@gmail.com> Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2020-03-14Merge branch 'py/blame-status-error'Libravatar Pratyush Yadav1-4/+6
Fixes an error popup in blame because of a missing closing bracket. * py/blame-status-error: git-gui: fix error popup when doing blame -> "Show History Context"
2020-03-03git-gui: fix error popup when doing blame -> "Show History Context"Libravatar Pratyush Yadav1-4/+6
In d9c6469 (git-gui: update status bar to track operations, 2019-12-01) the call to 'ui_status' in 'do_gitk' was updated to create the newly introduced "status bar operation". This allowed this status text to show along with other operations happening in parallel, and removed a race between all these operations. But in that refactor, the fact that 'ui_status' checks for the existence of 'main_status' was overlooked. This leads to an error message popping up when the user selects "Show History Context" from the blame window context menu on a source line. The error occurs because when running "blame" 'main_status' is not initialized. So, add a check for the existence of 'main_status' in 'do_gitk'. This fix reverts to the original behaviour. In the future, we might want to look into a better way of telling 'do_gitk' which status bar to use. Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2020-02-18Merge branch 'py/missing-bracket'Libravatar Pratyush Yadav1-1/+1
Fix an error popping up because of an unmatched closed bracket. * py/missing-bracket: git-gui: add missing close bracket
2020-02-17git-gui: add missing close bracketLibravatar Pratyush Yadav1-1/+1
In d9c6469 (git-gui: update status bar to track operations, 2019-12-01), the status bar was refactored to allow multiple overlapping operations. Since the refactor changed the status bar interface, all callsites had to be refactored to use the new interface. During that refactoring, this closing bracket was missed. This leads to an error message popping up when doing 'Branch->Reset...'. Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2020-02-17Merge branch 'cs/german-translation'Libravatar Pratyush Yadav5-2753/+3807
Update the German translation and extend glossary. * cs/german-translation: git-gui: update German translation git-gui: extend translation glossary template with more terms git-gui: update pot template and German translation to current source code
2020-02-17git-gui: update German translationLibravatar Christian Stimming2-385/+602
Update German translation (glossary and final translation) with recent additions, but also switch several terms from uncommon translations back to English vocabulary. This most prominently concerns "commit" (noun, verb), "repository", "branch", and some more. These uncommon translations have been introduced long ago and never been changed since. In fact, the whole German translation here hasn't been touched for a long time. However, in German literature and magazines, git-gui is regularly noted for its uncommon choice of translated vocabulary. This somewhat distracts from the actual benefits of this tool. So it is probably better to abandon the uncommon translations and rather stick to the common English vocabulary in git version control. Signed-off-by: Christian Stimming <christian@cstimming.de> Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2020-02-17git-gui: extend translation glossary template with more termsLibravatar Christian Stimming2-46/+305
The English glossary template was missing some terms, some of them not only for git-gui, but also gitk and/or git core. Many such terms have been added. Also, the list has been sorted alphabetically so that comparison to other glossary lists are easier. Signed-off-by: Christian Stimming <christian@cstimming.de> Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2020-02-17git-gui: update pot template and German translation to current source codeLibravatar Christian Stimming2-2533/+3111
No content changes so far, only the preparation for subsequent edits. Signed-off-by: Christian Stimming <christian@cstimming.de> Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2020-01-05Merge branch 'zs/open-current-file'Libravatar Pratyush Yadav1-5/+24
Allow opening the currently selected file in its default app by clicking on its name. * zs/open-current-file: git-gui: allow opening currently selected file in default app
2019-12-31git-gui: allow opening currently selected file in default appLibravatar Zoli Szabó1-5/+24
Many times there's the need to quickly open a source file (the one you're looking at in Git GUI) in the predefined text editor / IDE. Of course, the file can be searched for in your preferred file manager or directly in the text editor, but having the option to directly open the current file from Git GUI would be just faster. This change enables just that by: - clicking the diff header path (which is now highlighted as a hyperlink) - or diff header path context menu -> Open Note: executable files will be run and not opened for editing. Signed-off-by: Zoli Szabó <zoli.szabo@gmail.com> Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2019-12-20Merge branch 'py/console-close-esc'Libravatar Pratyush Yadav1-0/+2
Allow closing console window with Escape once the command is completed. * py/console-close-esc: git-gui: allow closing console window with Escape
2019-12-19git-gui: allow closing console window with EscapeLibravatar Pratyush Yadav1-0/+2
This gives users a quick shortcut to close the window. But since the window can also show commands in progress, closing the window on Escape can give the perception that the command has been cancelled even though it hasn't been. So, only enable this binding when the command is done. Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2019-12-11Merge branch 'kk/branch-name-encoding'Libravatar Pratyush Yadav2-0/+3
Fix UTF-8 refnames not displaying properly because the encoding was not set to UTF-8. * kk/branch-name-encoding: git gui: fix branch name encoding error
2019-12-10git gui: fix branch name encoding errorLibravatar Kazuhiro Kato2-0/+3
After "git checkout -b '漢字'" to create a branch with UTF-8 character in it, "git gui" shows the branch name incorrectly, as it forgets to turn the bytes read from the "git for-each-ref" and read from "HEAD" file into Unicode characters. Signed-off-by: Kazuhiro Kato <kato-k@ksysllc.co.jp> Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>