]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
3 years agoMerge branch 'il/ctrl-bs-del'
Pratyush Yadav [Thu, 21 May 2020 12:55:32 +0000 (18:25 +0530)] 
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

3 years agogit-gui: Handle Ctrl + BS/Del in the commit msg
Ismael Luceno [Tue, 12 May 2020 10:28:06 +0000 (12:28 +0200)] 
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>
3 years agoMerge branch 'ar/ui-ready-semicolon'
Pratyush Yadav [Tue, 5 May 2020 12:01:05 +0000 (17:31 +0530)] 
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

4 years agoSubject: git-gui: fix syntax error because of missing semicolon
Ansgar Röber [Thu, 9 Apr 2020 18:03:25 +0000 (18:03 +0000)] 
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>
4 years agoMerge branch 'py/remove-tcloo'
Pratyush Yadav [Thu, 19 Mar 2020 15:59:19 +0000 (21:29 +0530)] 
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

4 years agogit-gui: create a new namespace for chord script evaluation
Pratyush Yadav [Sat, 14 Mar 2020 21:38:36 +0000 (03:08 +0530)] 
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>
4 years agogit-gui: reduce Tcl version requirement from 8.6 to 8.5
Pratyush Yadav [Mon, 17 Feb 2020 15:39:29 +0000 (21:09 +0530)] 
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>
4 years agoMerge branch 'js/askpass-coerce-utf8'
Pratyush Yadav [Sat, 14 Mar 2020 17:22:43 +0000 (22:52 +0530)] 
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

4 years agogit-gui--askpass: coerce answers to UTF-8 on Windows
Luke Bonanomi [Thu, 12 Mar 2020 21:31:50 +0000 (21:31 +0000)] 
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>
4 years agoMerge branch 'py/blame-status-error'
Pratyush Yadav [Sat, 14 Mar 2020 17:11:45 +0000 (22:41 +0530)] 
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"

4 years agogit-gui: fix error popup when doing blame -> "Show History Context"
Pratyush Yadav [Mon, 2 Mar 2020 18:15:54 +0000 (23:45 +0530)] 
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>
4 years agoMerge branch 'py/missing-bracket'
Pratyush Yadav [Tue, 18 Feb 2020 17:31:44 +0000 (23:01 +0530)] 
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

4 years agogit-gui: add missing close bracket
Pratyush Yadav [Mon, 17 Feb 2020 16:04:45 +0000 (21:34 +0530)] 
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>
4 years agoMerge branch 'cs/german-translation'
Pratyush Yadav [Mon, 17 Feb 2020 15:44:24 +0000 (21:14 +0530)] 
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

4 years agogit-gui: update German translation
Christian Stimming [Sun, 9 Feb 2020 22:00:58 +0000 (22:00 +0000)] 
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>
4 years agogit-gui: extend translation glossary template with more terms
Christian Stimming [Sun, 9 Feb 2020 22:00:57 +0000 (22:00 +0000)] 
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>
4 years agogit-gui: update pot template and German translation to current source code
Christian Stimming [Sun, 9 Feb 2020 22:00:56 +0000 (22:00 +0000)] 
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>
4 years agoMerge branch 'zs/open-current-file'
Pratyush Yadav [Sat, 4 Jan 2020 21:08:03 +0000 (02:38 +0530)] 
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

4 years agogit-gui: allow opening currently selected file in default app
Zoli Szabó [Mon, 30 Dec 2019 15:56:59 +0000 (15:56 +0000)] 
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>
4 years agoMerge branch 'py/console-close-esc'
Pratyush Yadav [Thu, 19 Dec 2019 19:54:05 +0000 (01:24 +0530)] 
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

4 years agogit-gui: allow closing console window with Escape
Pratyush Yadav [Fri, 6 Dec 2019 21:46:31 +0000 (03:16 +0530)] 
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>
4 years agoMerge branch 'kk/branch-name-encoding'
Pratyush Yadav [Wed, 11 Dec 2019 16:02:29 +0000 (21:32 +0530)] 
Merge branch 'kk/branch-name-encoding'

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

4 years agogit gui: fix branch name encoding error
Kazuhiro Kato [Sat, 7 Dec 2019 00:29:09 +0000 (00:29 +0000)] 
git gui: fix branch name encoding error

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>
4 years agoMerge branch 'jg/revert-untracked'
Pratyush Yadav [Thu, 5 Dec 2019 18:55:27 +0000 (00:25 +0530)] 
Merge branch 'jg/revert-untracked'

git-gui learned to delete untracked files when the "Revert Changes"
option is selected. Since there are two types of revert operations (one
for tracked files and one for untracked ones), the "checkout" and
"deletion" operations are done in parallel. The status bar is updated
to allow both to use it in parallel.

* jg/revert-untracked:
  git-gui: revert untracked files by deleting them
  git-gui: update status bar to track operations
  git-gui: consolidate naming conventions

4 years agogit-gui: revert untracked files by deleting them
Jonathan Gilbert [Sun, 1 Dec 2019 02:28:33 +0000 (02:28 +0000)] 
git-gui: revert untracked files by deleting them

Update the revert_helper proc to check for untracked files as well as
changes, and then handle changes to be reverted and untracked files with
independent blocks of code. Prompt the user independently for untracked
files, since the underlying action is fundamentally different (rm -f).
If after deleting untracked files, the directory containing them becomes
empty, then remove the directory as well. Migrate unlocking of the index
out of _close_updateindex to a responsibility of the caller, to permit
paths that don't directly unlock the index, and refactor the error
handling added in d4e890e5 so that callers can make flow control
decisions in the event of errors. Update Tcl/Tk dependency from 8.4 to
8.6 in git-gui.sh.

A new proc delete_files takes care of actually deleting the files in
batches, using the Tcler's Wiki recommended approach for keeping the UI
responsive.

Since the checkout_index and delete_files calls are both asynchronous
and could potentially complete in any order, a "chord" is used to
coordinate unlocking the index and returning the UI to a usable state
only after both operations are complete. The `SimpleChord` class,
based on TclOO (Tcl/Tk 8.6), is added in this commit.

Signed-off-by: Jonathan Gilbert <JonathanG@iQmetrix.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
4 years agogit-gui: update status bar to track operations
Jonathan Gilbert [Sun, 1 Dec 2019 02:28:32 +0000 (02:28 +0000)] 
git-gui: update status bar to track operations

Update the status bar to track updates as individual "operations" that
can overlap. Update all call sites to interact with the new status bar
mechanism. Update initialization to explicitly clear status text,
since otherwise it may persist across future operations.

Signed-off-by: Jonathan Gilbert <JonathanG@iQmetrix.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
4 years agogit-gui: consolidate naming conventions
Jonathan Gilbert [Sun, 1 Dec 2019 02:28:31 +0000 (02:28 +0000)] 
git-gui: consolidate naming conventions

A few variables in this file use camelCase, while the overall standard
is snake_case. A consistent naming scheme will improve readability of
future changes. To avoid mixing naming changes with semantic changes,
this commit contains only naming changes.

Signed-off-by: Jonathan Gilbert <JonathanG@iQmetrix.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
4 years agoMerge branch 'ka/japanese-translation'
Pratyush Yadav [Mon, 14 Oct 2019 17:52:50 +0000 (23:22 +0530)] 
Merge branch 'ka/japanese-translation'

Improve Japanese translation.

* ka/japanese-translation:
  git-gui: improve Japanese translation

4 years agogit-gui: improve Japanese translation
kdnakt [Mon, 14 Oct 2019 01:31:38 +0000 (01:31 +0000)] 
git-gui: improve Japanese translation

Signed-off-by: kdnakt <a.kid.1985@gmail.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
4 years agoMerge branch 'py/readme'
Pratyush Yadav [Sat, 12 Oct 2019 16:10:25 +0000 (21:40 +0530)] 
Merge branch 'py/readme'

Add a readme to introduce people finding the repo to the project.

* py/readme:
  git-gui: add a readme

4 years agogit-gui: add a readme
Pratyush Yadav [Fri, 4 Oct 2019 19:53:08 +0000 (01:23 +0530)] 
git-gui: add a readme

It is a good idea to have a readme so people finding the project can
know more about it, and know how they can get involved.

Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
Acked-by: Bert Wesarg <bert.wesarg@googlemail.com>
4 years agoMerge branch 'bw/diff3-conflict-style'
Pratyush Yadav [Thu, 3 Oct 2019 21:57:53 +0000 (03:27 +0530)] 
Merge branch 'bw/diff3-conflict-style'

git-gui now highlights diff3 style conflicts properly. As an auxiliary
change, querying a path's attribute is done via the existing interface
instead of hand-rolling the code.

* bw/diff3-conflict-style:
  git-gui: support for diff3 conflict style
  git-gui: use existing interface to query a path's attribute

4 years agogit-gui: support for diff3 conflict style
Bert Wesarg [Wed, 2 Oct 2019 07:36:02 +0000 (09:36 +0200)] 
git-gui: support for diff3 conflict style

This adds highlight support for the diff3 conflict style.

The common pre-image will be reversed to --, because it has been removed
and replaced with ours or theirs side respectively.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
4 years agogit-gui: use existing interface to query a path's attribute
Bert Wesarg [Mon, 30 Sep 2019 19:54:52 +0000 (21:54 +0200)] 
git-gui: use existing interface to query a path's attribute

Replace the hand-coded call to git check-attr with the already provided one.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
4 years agoMerge branch 'js/git-bash-if-available'
Pratyush Yadav [Wed, 2 Oct 2019 23:11:58 +0000 (04:41 +0530)] 
Merge branch 'js/git-bash-if-available'

git-gui will now use git-bash instead of bash on Windows, if it is
available.

* js/git-bash-if-available:
  git-gui (Windows): use git-bash.exe if it is available

4 years agogit-gui (Windows): use git-bash.exe if it is available
Thomas Klaeger [Thu, 26 Sep 2019 17:46:19 +0000 (10:46 -0700)] 
git-gui (Windows): use git-bash.exe if it is available

Git for Windows 2.x ships with an executable that starts the Git Bash
with all the environment variables and what not properly set up. It is
also adjusted according to the Terminal emulator option chosen when
installing Git for Windows (while `bash.exe --login -i` would always
launch with Windows' default console).

So let's use that executable (usually C:\Program Files\Git\git-bash.exe)
instead of `bash.exe --login -i` if its presence was detected.

This fixes https://github.com/git-for-windows/git/issues/490

Signed-off-by: Thomas Kläger <thomas.klaeger@10a.ch>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
4 years agoMerge branch 'py/git-git-extra-stuff'
Pratyush Yadav [Tue, 24 Sep 2019 14:20:33 +0000 (19:50 +0530)] 
Merge branch 'py/git-git-extra-stuff'

Some changes were added directly to git.git's git-gui subtree, instead
of being added to the separate git-gui repo and then being pulled back
into git.git. This means those changes are now not in the git-gui tree.
So pull them back into git-gui so we match with what git.git has (after
they pull in the recently added commits).

Most of the changes could be added back in via an octopus merge of all
the missing branches. But there were two commits (faf420e05a and
b71c6c3b64) which touched other parts of git.git along with git-gui, so
they had to be added back in via a cherry-pick because directly pulling
them in would also pull in all the ancestors of those commits,
needlessly bloating git-gui with git.git's history.

Thanks to Denton Liu <liu.denton@gmail.com> for providing me with a
script to generate and merge all the branches that were missing, which
made this task much easier.

* py/git-git-extra-stuff:
  treewide: correct several "up-to-date" to "up to date"
  Fix build with core.autocrlf=true
  git-gui: call do_quit before destroying the main window
  git-gui: workaround ttk:style theme use
  git-gui: bind CTRL/CMD+numpad ENTER to do_commit
  git-gui: search for all current SSH key types
  git-gui: allow Ctrl+T to toggle multiple paths
  git-gui: fix exception when trying to stage with empty file list
  git-gui: avoid exception upon Ctrl+T in an empty list
  git gui: fix staging a second line to a 1-line file
  git-gui: prevent double UTF-8 conversion
  git-gui: sort entries in optimized tclIndex
  Replace Free Software Foundation address in license notices
  git-gui (MinGW): make use of MSys2's msgfmt

4 years agotreewide: correct several "up-to-date" to "up to date"
Martin Ågren [Wed, 23 Aug 2017 17:49:35 +0000 (19:49 +0200)] 
treewide: correct several "up-to-date" to "up to date"

Follow the Oxford style, which says to use "up-to-date" before the noun,
but "up to date" after it. Don't change plumbing (specifically
send-pack.c, but transport.c (git push) also has the same string).

This was produced by grepping for "up-to-date" and "up to date". It
turned out we only had to edit in one direction, removing the hyphens.

Fix a typo in Documentation/git-diff-index.txt while we're there.

Reported-by: Jeffrey Manian <jeffrey.manian@gmail.com>
Reported-by: STEVEN WHITE <stevencharleswhitevoices@gmail.com>
Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
4 years agoFix build with core.autocrlf=true
Johannes Schindelin [Tue, 9 May 2017 12:53:21 +0000 (14:53 +0200)] 
Fix build with core.autocrlf=true

On Windows, the default line endings are denoted by a Carriage Return
byte followed by a Line Feed byte, while Linux and MacOSX use a single
Line Feed byte to denote a line ending.

To help with this situation, Git introduced several mechanisms over the
last decade, most prominently the `core.autocrlf` setting.

Sometimes, however, a single setting is incorrect, e.g. when certain
files in the source code are to be consumed by software that can handle
only LF line endings, while other files can use whatever is appropriate
for the current platform.

To allow for that, Git added the `eol` option to its .gitattributes
handling, expecting every user of Git to mark their source code
appropriately.

Bash assumes that line-endings of scripts are denoted by a single Line
Feed byte. Therefore, shell scripts in Git's source code are one example
where that `eol=lf` option is *required*.

When generating common-cmds.h, the Unix tools we use generally operate on
the assumption that input and output deliminate their lines using LF-only
line endings. Consequently, they would happily copy the CR byte verbatim
into the strings in common-cmds.h, which in turn makes the C preprocessor
barf (that interprets them as MacOS-style line endings). Therefore, we
have to mark the input files as LF-only: command-list.txt and
Documentation/git-*.txt.

Quite a bit belatedly, this patch brings Git's own source code in line
with those expectations by setting those attributes to allow for a
correct build even when core.autocrlf=true.

This patch can be validated even on Linux, by using this cadence:

git config core.autocrlf true
rm .git/index && git stash
make -j15 DEVELOPER=1

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
4 years agoMerge branches 'js/msgfmt-on-windows', 'tz/fsf-address-update', 'jn/reproducible...
Pratyush Yadav [Thu, 19 Sep 2019 17:52:03 +0000 (23:22 +0530)] 
Merge branches 'js/msgfmt-on-windows', 'tz/fsf-address-update', 'jn/reproducible-build', 'ls/no-double-utf8-author-name', 'js/misc-git-gui-stuff', 'bb/ssh-key-files', 'bp/bind-kp-enter', 'cb/ttk-style' and 'py/call-do-quit-before-exit' of ../git into py/git-git-extra-stuff

4 years agoMerge branch 'bp/amend-toggle-bind'
Pratyush Yadav [Sat, 14 Sep 2019 17:53:12 +0000 (23:23 +0530)] 
Merge branch 'bp/amend-toggle-bind'

Toggle amend on and off with the keyboard shortcut "Ctrl+e".

* bp/amend-toggle-bind:
  git-gui: add hotkey to toggle "Amend Last Commit"

4 years agogit-gui: add hotkey to toggle "Amend Last Commit"
Birger Skogeng Pedersen [Sat, 14 Sep 2019 09:18:35 +0000 (11:18 +0200)] 
git-gui: add hotkey to toggle "Amend Last Commit"

Selecting whether to "Amend Last Commit" or not does not have a hotkey.

With this patch, the user may toggle between the two options with
CTRL/CMD+e.

Signed-off-by: Birger Skogeng Pedersen <birger.sp@gmail.com>
Rebased-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
4 years agoMerge branch 'bw/commit-scrollbuffer'
Pratyush Yadav [Fri, 13 Sep 2019 20:49:38 +0000 (02:19 +0530)] 
Merge branch 'bw/commit-scrollbuffer'

Add a scrollbar at the bottom of the commit message buffer.

* bw/commit-scrollbuffer:
  git-gui: add horizontal scrollbar to commit buffer

4 years agoMerge branch 'bw/amend-checkbutton'
Pratyush Yadav [Fri, 13 Sep 2019 20:48:27 +0000 (02:18 +0530)] 
Merge branch 'bw/amend-checkbutton'

Change the amend setting from two radio buttons ("New commit" and "Amend
commit") to a single checkbutton. The two radio buttons can never be
selected together because they are exactly the opposite of each other,
so it makes sense to change it to a single checkbutton.

* bw/amend-checkbutton:
  git-gui: convert new/amend commit radiobutton to checkbutton

4 years agogit-gui: add horizontal scrollbar to commit buffer
Bert Wesarg [Fri, 13 Sep 2019 20:16:28 +0000 (22:16 +0200)] 
git-gui: add horizontal scrollbar to commit buffer

While the commit message widget has a configurable fixed width, it
nevertheless allowed to write commit messages which exceeded this limit.
Though there is no visual clue, that there is scrolling going on. Now
there is a horizontal scrollbar.

There seems to be a bug in at least Tcl/Tk up to version 8.6.8, which
does not update the horizontal scrollbar if one removes the whole
content at once.

Suggested-by: Birger Skogeng Pedersen <birger.sp@gmail.com>
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
4 years agogit-gui: convert new/amend commit radiobutton to checkbutton
Bert Wesarg [Fri, 13 Sep 2019 06:02:30 +0000 (08:02 +0200)] 
git-gui: convert new/amend commit radiobutton to checkbutton

Its a bi-state anyway and also saves one line in the menu.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
4 years agoMerge branch 'py/revert-hunks-lines'
Pratyush Yadav [Wed, 11 Sep 2019 21:11:12 +0000 (02:41 +0530)] 
Merge branch 'py/revert-hunks-lines'

git-gui learned to revert selected lines and hunks, just like it can
stage selected lines and hunks. To provide a safety net for accidental
revert, the most recent revert can be undone.

* py/revert-hunks-lines:
  git-gui: allow undoing last revert
  git-gui: return early when patch fails to apply
  git-gui: allow reverting selected hunk
  git-gui: allow reverting selected lines

4 years agoMerge branch 'bp/widget-focus-hotkeys'
Pratyush Yadav [Wed, 11 Sep 2019 21:10:24 +0000 (02:40 +0530)] 
Merge branch 'bp/widget-focus-hotkeys'

git-gui learned to switch focus between widgets "unstaged commits",
"staged commits", "diff", and "commit message" using the keyboard
shortcuts Alt+1, Alt+2, Alt+3, and Alt+4 respectively.

* bp/widget-focus-hotkeys:
  git-gui: add hotkeys to set widget focus

4 years agogit-gui: add hotkeys to set widget focus
Birger Skogeng Pedersen [Wed, 4 Sep 2019 14:30:55 +0000 (16:30 +0200)] 
git-gui: add hotkeys to set widget focus

The user cannot change focus between the list of files, the diff view and
the commit message widgets without using the mouse (clicking either of
the four widgets).

With this patch, the user may set ui focus to the previously selected path
in either the "Unstaged Changes" or "Staged Changes" widgets, using
ALT+1 or ALT+2.

The user may also set the ui focus to the diff view widget with
ALT+3, or to the commit message widget with ALT+4.

This enables the user to select/unselect files, view the diff and create a
commit in git-gui using keyboard-only.

Signed-off-by: Birger Skogeng Pedersen <birger.sp@gmail.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
4 years agogit-gui: allow undoing last revert
Pratyush Yadav [Sun, 25 Aug 2019 20:13:23 +0000 (01:43 +0530)] 
git-gui: allow undoing last revert

Accidental clicks on the revert hunk/lines buttons can cause loss of
work, and can be frustrating. So, allow undoing the last revert.

Right now, a stack or deque are not being used for the sake of
simplicity, so only one undo is possible. Any reverts before the
previous one are lost.

Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
4 years agogit-gui: return early when patch fails to apply
Pratyush Yadav [Sun, 25 Aug 2019 22:53:13 +0000 (04:23 +0530)] 
git-gui: return early when patch fails to apply

In the procedure apply_or_revert_range_or_line, if the patch does not
apply successfully, a dialog is shown, but execution proceeds after
that. Instead, return early on error so the parts that come after this
don't work on top of an error state.

Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
4 years agogit-gui: allow reverting selected hunk
Pratyush Yadav [Sat, 17 Aug 2019 18:31:43 +0000 (00:01 +0530)] 
git-gui: allow reverting selected hunk

Just like the user can select a hunk to stage or unstage, add the
ability to revert hunks.

Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
4 years agogit-gui: allow reverting selected lines
Pratyush Yadav [Sun, 25 Aug 2019 20:05:27 +0000 (01:35 +0530)] 
git-gui: allow reverting selected lines

Just like the user can select lines to stage or unstage, add the
ability to revert selected lines.

Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
4 years agogit-gui: call do_quit before destroying the main window
Pratyush Yadav [Sun, 4 Aug 2019 14:39:19 +0000 (20:09 +0530)] 
git-gui: call do_quit before destroying the main window

If the toplevel window for the window being destroyed is the main window
(aka "."), then simply destroying it means the cleanup tasks are not
executed (like saving the commit message buffer, saving window state,
etc.)

All this is handled by do_quit.  Call it instead of directly
destroying the main window. For other toplevel windows, the old
behavior remains.

Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agogit-gui: workaround ttk:style theme use
Clemens Buchacher [Sat, 3 Mar 2018 22:39:19 +0000 (23:39 +0100)] 
git-gui: workaround ttk:style theme use

Tk 8.5.7, which is the latest version on Centos 6, does not support
getting the current theme with [ttk::style theme use]. Use the existing
workaround for this in all places.

Signed-off-by: Clemens Buchacher <drizzd@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agogit-gui: bind CTRL/CMD+numpad ENTER to do_commit
Birger Skogeng Pedersen [Fri, 2 Mar 2018 10:01:48 +0000 (11:01 +0100)] 
git-gui: bind CTRL/CMD+numpad ENTER to do_commit

CTRL/CMD+ENTER is bound to do_commit, but this did not apply for the
(numpad ENTER) key. To enable CTRL/CMD+ENTER and CTRL/CMD+(numpad ENTER)
to yield the same behaviour, CTRL/CMD+(numpad enter) has also been bound
to do_commit.

Signed-off-by: Birger Skogeng Pedersen <birgersp@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agogit-gui: search for all current SSH key types
Beat Bolli [Sat, 24 Feb 2018 18:39:13 +0000 (19:39 +0100)] 
git-gui: search for all current SSH key types

OpenSSH has supported Ed25519 keys since version 6.4 (2014-01-30), and
ECDSA keys since version 5.7 (2011-01-24). git-gui fails to find these
key types in its Help/Show SSH Key dialog.

Teach git-gui to show Ed25519 and ECDSA keys as well.

This was originally reported in
https://github.com/git-for-windows/git/issues/1487 and subseqently in
https://public-inbox.org/git/F65780F29E48994380E2BCE87C6F071101146AB1@DEERLM99EX2MSX.ww931.my-it-solutions.net/

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agogit-gui: allow Ctrl+T to toggle multiple paths
Johannes Schindelin [Tue, 9 Jan 2018 14:33:04 +0000 (15:33 +0100)] 
git-gui: allow Ctrl+T to toggle multiple paths

It is possible to select multiple files in the "Unstaged Changes" and
the "Staged Changes" lists. But when hitting Ctrl+T, surprisingly only
one entry is handled, not all selected ones.

Let's just use the same code path as for the "Stage To Commit" and the
"Unstage From Commit" menu items.

This fixes https://github.com/git-for-windows/git/issues/1012

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agogit-gui: fix exception when trying to stage with empty file list
Johannes Schindelin [Tue, 9 Jan 2018 14:33:01 +0000 (15:33 +0100)] 
git-gui: fix exception when trying to stage with empty file list

If there is nothing to stage, there is nothing to stage. Let's not try
to, even if the file list contains nothing at all.

This fixes https://github.com/git-for-windows/git/issues/1075

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agogit-gui: avoid exception upon Ctrl+T in an empty list
Johannes Schindelin [Tue, 9 Jan 2018 14:32:58 +0000 (15:32 +0100)] 
git-gui: avoid exception upon Ctrl+T in an empty list

Previously unstaged files can be staged by clicking on them and then
pressing Ctrl+T. Conveniently, the next unstaged file is selected
automatically so that the unstaged files can be staged by repeatedly
pressing Ctrl+T.

When a user hits Ctrl+T one time too many, though, Git GUI used to throw
this exception:

expected number but got ""
expected number but got ""
    while executing
"expr {int([lindex [$w tag ranges in_diff] 0])}"
    (procedure "toggle_or_diff" line 13)
    invoked from within
"toggle_or_diff toggle .vpane.files.workdir.list "
    (command bound to event)

Let's just avoid that by skipping the operation when there are no more
files to stage.

This fixes https://github.com/git-for-windows/git/issues/1060

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agogit gui: fix staging a second line to a 1-line file
Johannes Schindelin [Tue, 9 Jan 2018 14:32:54 +0000 (15:32 +0100)] 
git gui: fix staging a second line to a 1-line file

When a 1-line file is augmented by a second line, and the user tries to
stage that single line via the "Stage Line" context menu item, we do not
want to see "apply: corrupt patch at line 5".

The reason for this error was that the hunk header looks like this:

@@ -1 +1,2 @@

but the existing code expects the original range always to contain a
comma. This problem is easily fixed by cutting the string "1 +1,2"
(that Git GUI formerly mistook for the starting line) at the space.

This fixes https://github.com/git-for-windows/git/issues/515

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agogit-gui: prevent double UTF-8 conversion
Łukasz Stelmach [Tue, 5 Dec 2017 14:23:26 +0000 (15:23 +0100)] 
git-gui: prevent double UTF-8 conversion

Convert author's name and e-mail address from the UTF-8 (or any other)
encoding in load_last_commit function the same way commit message is
converted.

Amending commits in git-gui without such conversion breaks UTF-8
strings. For example, "\305\201ukasz" (as written by git cat-file) becomes
"\303\205\302\201ukasz" in an amended commit.

Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agogit-gui: sort entries in optimized tclIndex
Anders Kaseorg [Wed, 16 Nov 2016 21:37:17 +0000 (16:37 -0500)] 
git-gui: sort entries in optimized tclIndex

auto_mkindex expands wildcards in directory order, which depends on
the underlying filesystem.  To improve build reproducibility, sort the
list of *.tcl files in the Makefile.

The unoptimized loading case was previously fixed in gitgui-0.21.0~14
(git-gui: sort entries in tclIndex, 2015-01-26).

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agoReplace Free Software Foundation address in license notices
Todd Zullinger [Tue, 7 Nov 2017 05:39:33 +0000 (00:39 -0500)] 
Replace Free Software Foundation address in license notices

The mailing address for the FSF has changed over the years.  Rather than
updating the address across all files, refer readers to gnu.org, as the
GNU GPL documentation now suggests for license notices.  The mailing
address is retained in the full license files (COPYING and LGPL-2.1).

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 years agogit-gui (MinGW): make use of MSys2's msgfmt
Johannes Schindelin [Tue, 25 Jul 2017 08:35:57 +0000 (10:35 +0200)] 
git-gui (MinGW): make use of MSys2's msgfmt

When Git for Windows was still based on MSys1, we had no gettext, ergo
no msgfmt, either. Therefore, we introduced a small and simple Tcl
script to perform the same task.

However, with MSys2, we no longer need that because we have a proper
msgfmt executable. Plus, the po2msg.sh script somehow manages to hang
when run in parallel in Git for Windows' SDK (symptom: the Continuous
Testing tasks timing out).

Two reasons to use real msgfmt.exe instead.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoMerge remote-tracking branch 'philoakley/dup-gui'
Pat Thoyts [Sat, 18 Mar 2017 15:35:09 +0000 (15:35 +0000)] 
Merge remote-tracking branch 'philoakley/dup-gui'

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
7 years agogit gui: allow for a long recentrepo list
Philip Oakley [Mon, 14 Dec 2015 12:56:40 +0000 (12:56 +0000)] 
git gui: allow for a long recentrepo list

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>
7 years agogit gui: de-dup selected repo from recentrepo history
Philip Oakley [Mon, 14 Dec 2015 10:42:04 +0000 (10:42 +0000)] 
git gui: de-dup selected repo from recentrepo history

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>
7 years agogit gui: cope with duplicates in _get_recentrepo
Philip Oakley [Mon, 14 Dec 2015 11:19:32 +0000 (11:19 +0000)] 
git gui: cope with duplicates in _get_recentrepo

_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>
7 years agogit-gui: remove duplicate entries from .gitconfig's gui.recentrepo
Philip Oakley [Mon, 14 Dec 2015 10:37:02 +0000 (10:37 +0000)] 
git-gui: remove duplicate entries from .gitconfig's gui.recentrepo

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>
7 years agogit-gui: set version 0.21 gitgui-0.21.0
Pat Thoyts [Thu, 20 Oct 2016 10:19:43 +0000 (11:19 +0100)] 
git-gui: set version 0.21

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
7 years agoMerge branch 'as/bulgarian' into pu
Pat Thoyts [Thu, 20 Oct 2016 10:13:42 +0000 (11:13 +0100)] 
Merge branch 'as/bulgarian' into pu

7 years agogit-gui: Mark 'All' in remote.tcl for translation
Alexander Shopov [Thu, 13 Oct 2016 18:43:48 +0000 (21:43 +0300)] 
git-gui: Mark 'All' in remote.tcl for translation

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
7 years agogit-gui i18n: Updated Bulgarian translation (565,0f,0u)
Alexander Shopov [Thu, 13 Oct 2016 18:43:49 +0000 (21:43 +0300)] 
git-gui i18n: Updated Bulgarian translation (565,0f,0u)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
7 years agoMerge branch 'os/preserve-author' into pu
Pat Thoyts [Thu, 20 Oct 2016 10:07:24 +0000 (11:07 +0100)] 
Merge branch 'os/preserve-author' into pu

7 years agoMerge branch 'kb/unicode' into pu
Pat Thoyts [Thu, 20 Oct 2016 10:06:28 +0000 (11:06 +0100)] 
Merge branch 'kb/unicode' into pu

7 years agogit-gui: avoid persisting modified author identity
Pat Thoyts [Thu, 6 Oct 2016 13:04:42 +0000 (14:04 +0100)] 
git-gui: avoid persisting modified author identity

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>
7 years agogit-gui: handle the encoding of Git's output correctly
Karsten Blees [Thu, 26 Feb 2015 09:19:45 +0000 (17:19 +0800)] 
git-gui: handle the encoding of Git's output correctly

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>
7 years agogit-gui: unicode file name support on windows
Karsten Blees [Sat, 4 Feb 2012 20:54:36 +0000 (21:54 +0100)] 
git-gui: unicode file name support on windows

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>
7 years agoMerge branch 'dr/ru' into pu
Pat Thoyts [Tue, 4 Oct 2016 22:29:40 +0000 (23:29 +0100)] 
Merge branch 'dr/ru' into pu

7 years agogit-gui: Update Russian translation
Dimitriy Ryazantcev [Tue, 4 Oct 2016 15:15:16 +0000 (18:15 +0300)] 
git-gui: Update Russian translation

Signed-off-by: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
7 years agogit-gui: maintain backwards compatibility for merge syntax
Pat Thoyts [Tue, 4 Oct 2016 11:49:05 +0000 (12:49 +0100)] 
git-gui: maintain backwards compatibility for merge syntax

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>
7 years agoMerge branch 'va/i18n_2' into pu
Pat Thoyts [Mon, 3 Oct 2016 22:40:50 +0000 (23:40 +0100)] 
Merge branch 'va/i18n_2' into pu

7 years agogit-gui i18n: mark string in lib/error.tcl for translation
Vasco Almeida [Sun, 8 May 2016 10:52:58 +0000 (10:52 +0000)] 
git-gui i18n: mark string in lib/error.tcl for translation

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>
7 years agogit-gui: fix incorrect use of Tcl append command
Vasco Almeida [Sun, 8 May 2016 10:52:57 +0000 (10:52 +0000)] 
git-gui: fix incorrect use of Tcl append command

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>
7 years agogit-gui i18n: mark "usage:" strings for translation
Vasco Almeida [Sun, 8 May 2016 10:52:56 +0000 (10:52 +0000)] 
git-gui i18n: mark "usage:" strings for translation

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>
7 years agogit-gui i18n: internationalize use of colon punctuation
Vasco Almeida [Sun, 8 May 2016 10:52:55 +0000 (10:52 +0000)] 
git-gui i18n: internationalize use of colon punctuation

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>
7 years agoMerge branch 'pt/non-mouse-usage' into pu
Pat Thoyts [Mon, 3 Oct 2016 22:30:44 +0000 (23:30 +0100)] 
Merge branch 'pt/non-mouse-usage' into pu

7 years agoMerge branch 'pt/git4win-mods' into pu
Pat Thoyts [Mon, 3 Oct 2016 22:30:32 +0000 (23:30 +0100)] 
Merge branch 'pt/git4win-mods' into pu

7 years agoMerge branch 'patches' into pu
Pat Thoyts [Mon, 3 Oct 2016 22:28:57 +0000 (23:28 +0100)] 
Merge branch 'patches' into pu

7 years agogit-gui: ensure the file in the diff pane is in the list of selected files
Alex Riesen [Tue, 28 Jun 2016 08:59:25 +0000 (10:59 +0200)] 
git-gui: ensure the file in the diff pane is in the list of selected files

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>
7 years agogit-gui: support for $FILENAMES in tool definitions
Alex Riesen [Tue, 28 Jun 2016 08:57:42 +0000 (10:57 +0200)] 
git-gui: support for $FILENAMES in tool definitions

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>
7 years agogit-gui: fix initial git gui message encoding
yaras [Tue, 23 Feb 2016 11:55:46 +0000 (11:55 +0000)] 
git-gui: fix initial git gui message encoding

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>
7 years agogit-gui/po/glossary/txt-to-pot.sh: use the $( ... ) construct for command substitution
Elia Pinto [Tue, 22 Dec 2015 14:10:29 +0000 (15:10 +0100)] 
git-gui/po/glossary/txt-to-pot.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
7 years agoMerge branch 'va/i18n' into pu
Pat Thoyts [Mon, 3 Oct 2016 22:23:27 +0000 (23:23 +0100)] 
Merge branch 'va/i18n' into pu

7 years agoMerge branch 'rs/use-modern-git-merge-syntax' into pu
Pat Thoyts [Mon, 3 Oct 2016 22:23:19 +0000 (23:23 +0100)] 
Merge branch 'rs/use-modern-git-merge-syntax' into pu

7 years agoMerge branch 'js/commit-gpgsign' into pu
Pat Thoyts [Mon, 3 Oct 2016 22:23:05 +0000 (23:23 +0100)] 
Merge branch 'js/commit-gpgsign' into pu

7 years agoMerge branch 'sy/i18n' into pu
Pat Thoyts [Mon, 3 Oct 2016 22:22:46 +0000 (23:22 +0100)] 
Merge branch 'sy/i18n' into pu

7 years agogit-gui (Windows): use git-gui.exe in `Create Desktop Shortcut`
Pat Thoyts [Sun, 2 Oct 2016 21:19:47 +0000 (22:19 +0100)] 
git-gui (Windows): use git-gui.exe in `Create Desktop Shortcut`

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>
7 years agogit-gui: fix detection of Cygwin
Pat Thoyts [Sun, 2 Oct 2016 10:51:29 +0000 (11:51 +0100)] 
git-gui: fix detection of Cygwin

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>