Граф коммитов

1281 Коммитов

Автор SHA1 Сообщение Дата
Pratyush Yadav df4f9e28f6 Merge branch 'py/revert-commit-comments'
This commit causes breakage on macOS, or in fact any platform using
older versions of Tcl. Revert it.

* py/revert-commit-comments:
  Revert "git-gui: remove lines starting with the comment character"
2021-03-04 13:59:45 +05:30
Pratyush Yadav c0698df057 Revert "git-gui: remove lines starting with the comment character"
This reverts commit b9a43869c9.

This commit causes breakage on macOS (10.13). It causes errors on
startup and completely breaks the commit functionality. There are two
main problems. First, it uses `string cat` which is not supported on
older Tcl versions. Second, it does a half close of the bidirectional
pipe to git-stripspace which is also not supported on older Tcl
versions.

Reported-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2021-03-04 13:53:27 +05:30
Pratyush Yadav b1056f60b6 Merge branch 'py/commit-comments'
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-22 20:19:53 +05:30
Pratyush Yadav b9a43869c9 git-gui: remove lines starting with the comment character
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-18 23:35:57 +05:30
Pratyush Yadav 7da7ef6d7a Merge branch 'mk/russian-translation'
Fix typo in Russian translation.

* mk/russian-translation:
  git-gui: fix typo in russian locale
2021-02-02 23:51:30 +05:30
Mikhail Klyushin 413e96f41e git-gui: fix typo in russian locale
Fixed typo in russian locale: издекса -> индекса

Signed-off-by: Mikhail Klyushin <klyushinmisha@gmail.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2021-02-02 23:50:31 +05:30
Pratyush Yadav 7b0cfe156e Merge branch 'sh/inactive-background'
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-19 01:02:34 +05:30
Stefan Haller da4d86da97 git-gui: use gray background for inactive text widgets
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-19 01:00:17 +05:30
Pratyush Yadav 62aed982fd Merge branch 'st/selected-text-colors'
Set colors for selected text properly.

* st/selected-text-colors:
  git-gui: Fix selected text colors
2020-12-18 01:52:26 +05:30
Serg Tereshchenko 4d22c0505f git-gui: Fix selected text colors
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-18 01:49:18 +05:30
Pratyush Yadav 796f6525b1 Merge branch 'rj/clean-speedup'
Speed up 'make clean' on Cygwin.

* rj/clean-speedup:
  Makefile: conditionally include GIT-VERSION-FILE
2020-12-18 00:42:14 +05:30
Ramsay Jones 5bc8b5d5c1 Makefile: conditionally include GIT-VERSION-FILE
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-18 00:34:15 +05:30
Pratyush Yadav 7d6d21f5b9 Merge branch 'sh/macos-labels'
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-18 00:32:06 +05:30
Stefan Haller f9481b195b git-gui: fix colored label backgrounds when using themed widgets
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-18 00:30:37 +05:30
Pratyush Yadav 3e5c911288 Merge branch 'da/askpass-mask-checkbox'
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-02 01:09:01 +05:30
David Aguilar a4e1bc9971 git-gui: ssh-askpass: add a checkbox to show the input text
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-02 00:58:13 +05:30
Pratyush Yadav 8222c75899 Merge branch 'dr/russian-translation'
Update Russian translation.

* dr/russian-translation:
  git-gui: update Russian translation
2020-12-02 00:53:48 +05:30
Dimitriy Ryazantcev 3d02fb242c git-gui: update Russian translation
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-02 00:51:56 +05:30
Pratyush Yadav 1141f8325c Merge branch 'ms/commit-template'
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-12-02 00:40:06 +05:30
Martin Schön 627c87f84c git-gui: use commit message template
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-27 20:06:38 +05:30
Pratyush Yadav ce83ab2bd3 git-gui: Only touch GITGUI_MSG when needed
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-11-27 20:06:38 +05:30
Pratyush Yadav 38c2ac2e2a Merge branch 'sh/blame-tooltip'
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-17 15:05:27 +05:30
Stefan Haller b297e03c63 git-gui: blame: prevent tool tips from sticking around after Command-Tab
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-17 15:04:35 +05:30
Pratyush Yadav 01121d6132 Merge branch 'st/dark-mode' into master
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-08 18:34:54 +05:30
Serg Tereshchenko c02efc1363 git-gui: improve dark mode support
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-10-07 16:44:24 +05:30
Pratyush Yadav 95bfc6cdb6 Merge branch 'st/spaces-tabs-cleanup' into master
Clean up some whitespace.

* st/spaces-tabs-cleanup:
  git-gui: fix mixed tabs and spaces; prefer tabs
2020-09-22 15:21:19 +05:30
Serg Tereshchenko 5c1b391307 git-gui: fix mixed tabs and spaces; prefer tabs
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-09-22 15:07:39 +05:30
Pratyush Yadav 469725c1a3 Merge branch 'mt/open-worktree'
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-22 20:23:28 +05:30
Mikhail Terekhov a7473956f7 git-gui: allow opening work trees from the startup dialog
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-06-08 15:01:46 +05:30
Pratyush Yadav c195247812 Merge branch 'il/ctrl-bs-del'
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-21 18:25:32 +05:30
Ismael Luceno e5894146b0 git-gui: Handle Ctrl + BS/Del in the commit msg
- 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-12 18:23:49 +05:30
Pratyush Yadav 88db24d724 Merge branch 'ar/ui-ready-semicolon'
Fix syntax error popups because of missing semicolons.

* ar/ui-ready-semicolon:
  Subject: git-gui: fix syntax error because of missing semicolon
2020-05-05 17:31:05 +05:30
Ansgar Röber 19195fbd73 Subject: git-gui: fix syntax error because of missing semicolon
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-04-22 18:32:44 +05:30
Pratyush Yadav a5728022e0 Merge branch 'py/remove-tcloo'
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-19 21:29:19 +05:30
Pratyush Yadav 3891a84ccd git-gui: create a new namespace for chord script evaluation
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-17 18:48:54 +05:30
Pratyush Yadav 8a8efbe414 git-gui: reduce Tcl version requirement from 8.6 to 8.5
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-17 18:48:54 +05:30
Pratyush Yadav a4a2f64642 Merge branch 'js/askpass-coerce-utf8'
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-14 22:52:43 +05:30
Luke Bonanomi 850cf9ae96 git-gui--askpass: coerce answers to UTF-8 on Windows
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-14 22:46:40 +05:30
Pratyush Yadav d769dcc5cd Merge branch 'py/blame-status-error'
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-14 22:41:45 +05:30
Pratyush Yadav 5eb9397e88 git-gui: fix error popup when doing blame -> "Show History Context"
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-03-03 00:06:34 +05:30
Pratyush Yadav 63a58457e0 Merge branch 'py/missing-bracket'
Fix an error popping up because of an unmatched closed bracket.

* py/missing-bracket:
  git-gui: add missing close bracket
2020-02-18 23:01:44 +05:30
Pratyush Yadav 6b9919c0a2 git-gui: add missing close bracket
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-17 21:34:45 +05:30
Pratyush Yadav 5897e5ac96 Merge branch 'cs/german-translation'
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-17 21:14:24 +05:30
Christian Stimming cf85a32eb6 git-gui: update German translation
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-17 21:08:35 +05:30
Christian Stimming 5096e51c54 git-gui: extend translation glossary template with more terms
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-17 21:08:35 +05:30
Christian Stimming 8b85bb1b70 git-gui: update pot template and German translation to current source code
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-02-17 21:08:35 +05:30
Pratyush Yadav 0d2116c644 Merge branch 'zs/open-current-file'
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
2020-01-05 02:38:03 +05:30
Zoli Szabó 786f4d2405 git-gui: allow opening currently selected file in default app
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-31 01:07:53 +05:30
Pratyush Yadav 23cbe427c4 Merge branch 'py/console-close-esc'
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-20 01:24:05 +05:30
Pratyush Yadav 1e1ccbfdd3 git-gui: allow closing console window with Escape
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-19 01:22:53 +05:30