Commit Graph

1238 Commits

Author SHA1 Message Date
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
Pratyush Yadav
d32e065a91 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
2019-12-11 21:32:29 +05:30
Kazuhiro Kato
39acfa3d22 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>
2019-12-10 02:43:55 +05:30
Pratyush Yadav
2763530048 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
2019-12-06 00:40:55 +05:30
Jonathan Gilbert
fa38ab68b0 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>
2019-12-06 00:12:15 +05:30
Jonathan Gilbert
d9c6469f38 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>
2019-12-06 00:12:15 +05:30
Jonathan Gilbert
29a9366052 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>
2019-12-06 00:12:15 +05:30
Pratyush Yadav
b524f6b399 Merge branch 'ka/japanese-translation'
Improve Japanese translation.

* ka/japanese-translation:
  git-gui: improve Japanese translation
2019-10-14 23:22:50 +05:30
kdnakt
f6f3824b4e git-gui: improve Japanese translation
Signed-off-by: kdnakt <a.kid.1985@gmail.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2019-10-14 23:19:49 +05:30
Pratyush Yadav
61f4b407d3 Merge branch 'py/readme'
Add a readme to introduce people finding the repo to the project.

* py/readme:
  git-gui: add a readme
2019-10-12 21:40:25 +05:30
Pratyush Yadav
1e6880fd06 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>
2019-10-12 21:29:30 +05:30
Pratyush Yadav
69fdb922ad 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
2019-10-04 03:27:53 +05:30
Bert Wesarg
b436825b9b 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>
2019-10-04 03:26:15 +05:30
Bert Wesarg
c3b57dc2a0 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>
2019-10-03 05:00:04 +05:30
Pratyush Yadav
45ab460d4a 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
2019-10-03 04:41:58 +05:30
Thomas Klaeger
6a72d44fc2 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>
2019-10-01 19:10:34 +05:30
Pratyush Yadav
60c60b627e 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
2019-09-24 20:00:36 +05:30
Martin Ågren
faf420e05a 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>
2019-09-24 19:48:27 +05:30
Johannes Schindelin
b71c6c3b64 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>
2019-09-24 19:48:27 +05:30
Pratyush Yadav
16d7601e17 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 2019-09-24 19:47:43 +05:30
Pratyush Yadav
f7a8834ba4 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"
2019-09-14 23:23:12 +05:30
Birger Skogeng Pedersen
ec7424e1a6 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>
2019-09-14 23:22:00 +05:30
Pratyush Yadav
6c8ec8c30a 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
2019-09-14 02:19:38 +05:30
Pratyush Yadav
acfa495519 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
2019-09-14 02:18:27 +05:30
Bert Wesarg
da08d559b7 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>
2019-09-14 02:13:25 +05:30
Bert Wesarg
ba41b5b335 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>
2019-09-14 00:37:47 +05:30
Pratyush Yadav
c77abf0460 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
2019-09-12 02:41:12 +05:30
Pratyush Yadav
5a2bb62180 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
2019-09-12 02:40:24 +05:30
Birger Skogeng Pedersen
e07446ed5f 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>
2019-09-11 00:46:21 +05:30
Pratyush Yadav
a4fa2f0a4c 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>
2019-08-29 03:19:03 +05:30
Pratyush Yadav
2ccdfb1c78 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>
2019-08-26 04:23:13 +05:30
Pratyush Yadav
62bd99934b 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>
2019-08-26 03:53:15 +05:30
Pratyush Yadav
5f0a516de9 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>
2019-08-26 01:35:27 +05:30
Pratyush Yadav
5440eb0ea2 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>
2019-08-07 13:22:51 -07:00
Clemens Buchacher
f50d5055bf 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>
2018-03-05 23:46:45 -08:00
Birger Skogeng Pedersen
146a6f1097 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>
2018-03-02 15:13:30 -08:00
Beat Bolli
6a47fa0efa 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>
2018-03-02 15:13:10 -08:00
Johannes Schindelin
76756d6706 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>
2018-01-09 11:02:40 -08:00
Johannes Schindelin
2cd9179c14 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>
2018-01-09 11:02:40 -08:00
Johannes Schindelin
2365e5b174 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>
2018-01-09 11:02:40 -08:00
Johannes Schindelin
6d02c1e204 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>
2018-01-09 11:02:40 -08:00
Łukasz Stelmach
331450f18a 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>
2017-12-05 09:14:45 -08:00
Anders Kaseorg
474642b4a4 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>
2017-11-22 13:46:57 +09:00
Todd Zullinger
63100874c1 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>
2017-11-09 13:24:13 +09:00