Code

git.git
14 years agogit-gui: handle non-standard worktree locations
Giuseppe Bilotta [Sat, 23 Jan 2010 10:03:34 +0000 (11:03 +0100)]
git-gui: handle non-standard worktree locations

Don't rely on the git worktree being the updir of the gitdir, since it
might not be. Instead, define (and use) a new _gitworktree global
variable, setting it to $GIT_WORK_TREE if present, falling back to
core.worktree if defined, and finally to whatever we guess the correct
worktree is. Getting core.worktree requires the config from the alleged
git dir _gitdir to be loaded early.

Supporting non-standard worktree locations also breaks the git-gui
assumption (made when calling gitk) that the worktree was the dirname of
$_gitdir and that, by consequence, the git dir could be set to the tail
of $_gitdir once we changed to the worktree root directory. Therefore,
we need to export a GIT_DIR environment variable set to the full,
normalized path of $_gitdir instead. We also skip changing to the worktree
directory if it's empty (i.e. if we're working on a bare repository).

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agogit-gui: Support applying a range of changes at once
Jeff Epler [Tue, 8 Dec 2009 00:22:43 +0000 (18:22 -0600)]
git-gui: Support applying a range of changes at once

Multiple lines can be selected in the diff viewer and applied all
at once, rather than selecting "Stage Line For Commit" on each
individual line.

Signed-off-by: Jeff Epler <jepler@unpythonic.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agogit-gui: Add a special diff popup menu for submodules
Jens Lehmann [Sat, 2 Jan 2010 16:58:49 +0000 (17:58 +0100)]
git-gui: Add a special diff popup menu for submodules

To make it easier for users to deal with submodules, a special diff
popup menu has been added for submodules. The "Show Less Context"
and "Show More Context" entries have been removed, as they don't make
any sense for a submodule summary. Four new entries are added to the
top of the popup menu to gain access to more detailed information
about the changes in a submodule than the plain summary does offer.

These are:
- "Visualize These Changes In The Submodule"
  starts gitk showing the selected commit range

- "Visualize These Changes In The Submodule"
  starts gitk showing the whole submodule history of the current branch

- "Visualize All Branch History In The Submodule"
  starts gitk --all in the submodule

- "Start git gui In The Submodule"
  guess what :-)

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agogit-gui: Use git diff --submodule when available
Jens Lehmann [Sat, 23 Jan 2010 22:04:12 +0000 (23:04 +0100)]
git-gui: Use git diff --submodule when available

Doing so is much faster and gives the same output.
Here are some numbers:

  $ time git submodule summary
  real 0m0.219s
  user 0m0.050s
  sys 0m0.111s

  $ time git diff --submodule
  real 0m0.012s
  user 0m0.003s
  sys 0m0.009s

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agogit-gui: work from the .git dir
Giuseppe Bilotta [Sat, 23 Jan 2010 10:03:36 +0000 (11:03 +0100)]
git-gui: work from the .git dir

When git-gui is run from a .git dir, _gitdir would be set to "." by
rev-parse, something that confuses the worktree detection.

Fix by expanding the value of _gitdir to pwd in this special case.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agogit-gui: Fix applying a line when all following lines are deletions
Jeff Epler [Tue, 8 Dec 2009 00:22:42 +0000 (18:22 -0600)]
git-gui: Fix applying a line when all following lines are deletions

If a diff looked like:

 @@
  context
 -del1
 -del2

and you wanted to stage the deletion 'del1', the generated patch
wouldn't apply because it was missing the line 'del2' converted to
context, but this line was counted in the @@-line

Signed-off-by: Jeff Epler <jepler@unpythonic.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agogit-gui: Correct file_states when unstaging partly staged entry
Jens Lehmann [Mon, 7 Dec 2009 20:35:59 +0000 (21:35 +0100)]
git-gui: Correct file_states when unstaging partly staged entry

When unstaging a partly staged file or submodule, the file_states
list was not updated properly (unless unstaged linewise). Its
index_info part did not contain the former head_info as it should
have but kept its old value.

This seems not to have had any bad effects but diminishes the value
of the file_states list for future enhancements.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agogit-gui: Fix gitk for branch whose name matches local file
Peter Krefting [Thu, 21 Jan 2010 12:15:17 +0000 (13:15 +0100)]
git-gui: Fix gitk for branch whose name matches local file

When trying to run gitk on a branch name whose name matches a local
file, it will toss an error saying that the name is ambiguous. Adding
a pair of dashes will make gitk parse the options to the left of
it as branch names. Since wish eats the first pair of dashes we
throw at it, we need to add a second one to ensure they get through.

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agogit-gui: Keep repo_config(gui.recentrepos) and .gitconfig in sync
Christopher Beelby [Sat, 23 Jan 2010 22:37:17 +0000 (14:37 -0800)]
git-gui: Keep repo_config(gui.recentrepos) and .gitconfig in sync

When the number of recent repo's gets to ten there can be a
situation where an item is removed from the .gitconfig file via
a call to git config --unset, but the internal representation of
that file (repo_config(gui.recentrepo)) is not updated.  Then a
subsequent attempt to remove an item from the list fails because
git-gui attempts to call --unset on a value that has already
been removed.  This leads to duplicates in the .gitconfig file,
which then also cause errors if the git-gui tries to --unset them
(rather than using --unset-all. --unset-all is not used because it
is not expected that duplicates should ever be allowed to exist.)

When loading the list of recent repositories (proc _get_recentrepos)
if a repo in the list is not considered a valid git reposoitory
then we should go ahead and remove it so it doesn't take up a slot
in the list (since we limit to 10 items). This will prevent a bunch
of invalid entries in the list (which are not shown) from making
valid entries dissapear off the list even when there are less than
ten valid entries.

See: http://code.google.com/p/msysgit/issues/detail?id=362
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agogit-gui: handle really long error messages in updateindex.
Pat Thoyts [Sun, 20 Dec 2009 02:02:03 +0000 (02:02 +0000)]
git-gui: handle really long error messages in updateindex.

As reported to msysGit (bug #340) it is possible to get some very
long error messages when updating the index. The use of a label to
display this prevents scrolling the output. This patch replaces the
label with a scrollable text widget configured to look like a label.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agogit-gui: Add hotkeys for "Unstage from commit" and "Revert changes"
Vitaly _Vi Shukela [Thu, 31 Dec 2009 13:32:53 +0000 (15:32 +0200)]
git-gui: Add hotkeys for "Unstage from commit" and "Revert changes"

Signed-off-by: Vitaly _Vi Shukela <public_vi@tut.by>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agogit-gui: Makefile: consolidate .FORCE-* targets
Jonathan Nieder [Wed, 6 Jan 2010 08:16:38 +0000 (02:16 -0600)]
git-gui: Makefile: consolidate .FORCE-* targets

Providing multiple targets to force a rebuild is unnecessary
complication.

Avoid using a name that could conflict with future special
targets in GNU make (a leading period followed by uppercase
letters).

Cc: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agogit-gui: suppress RenderBadPicture X error caused by Tk bug
Jindrich Makovicka [Fri, 4 Dec 2009 09:28:44 +0000 (10:28 +0100)]
git-gui: suppress RenderBadPicture X error caused by Tk bug

Due to a bug in Tk, git-gui almost always (unless git-gui is closed
right after starting) produces an X window error message on exit,
something like:

X Error of failed request:  RenderBadPicture (invalid Picture parameter)
  Major opcode of failed request:  150 (RENDER)
  Minor opcode of failed request:  7 (RenderFreePicture)
  Picture id in failed request: 0x3a000dc
  Serial number of failed request:  1965
  Current serial number in output stream:  1980

Respective Tk bug report is here:

http://sourceforge.net/tracker/?func=detail&atid=112997&aid=1821174&group_id=12997

This bug is triggered only when the send command is blocked via
rename send {} . The following patch re-enables send just before
quiting git-gui to suppress the error.

Signed-off-by: Jindrich Makovicka <makovick@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agogit-gui: Increase blame viewer usability on MacOS.
Alexander Gavrilov [Thu, 13 Nov 2008 19:02:09 +0000 (22:02 +0300)]
git-gui: Increase blame viewer usability on MacOS.

On MacOS raising a window causes the focus to be transferred
to it -- although it may actually be a bug in the Tcl/Tk port.
When this happens with the blame viewer tooltips, it makes
the interface less usable, because Entry and Leave handlers
on the text view cause the tip to disappear once the mouse
is moved even 1 pixel.

This commit makes the code raise the main window on MacOS
when Tk 8.5 is used. This version seems to properly support
wm transient by making the tip stay on top of the master,
so reraising the master does not cause it to disappear. Thus
the only remaining sign of problems is slight UI flicker
when focus is momentarily transferred to the tip and back.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agogit-gui: search 4 directories to improve statistic of gc hint
Clemens Buchacher [Sun, 13 Sep 2009 22:20:44 +0000 (00:20 +0200)]
git-gui: search 4 directories to improve statistic of gc hint

On Windows, git-gui suggests running the garbage collector if it finds
1 or more files in .git/objects/42 (as opposed to 8 files on other
platforms). The probability of that happening if the repo contains
about 100 loose objects is 32%. The probability for the same to happen
when searching 4 directories is only 8%, which is bit more reasonable.

Also remove $objects_limit from the message, because we already know
that we are above (or close to) that limit. Telling the user about
that number does not really give him any useful information.

The following octave script shows the probability for at least m*q
objects to be found in q subdirectories of .git/objects if n is the
total number of objects.

q = 4;
m = [1 2 8];
n = 0:10:2000;

P = zeros(length(n), length(m));
for k = 1:length(n)
        P(k, :) = 1-binocdf(q*m-1, n(k), q/(256-q));
end
plot(n, P);

n \ q   1       4
50      18%     1%
100     32%     8%
200     54%     39%
500     86%     96%

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
14 years agogit gui: make current branch default in "remote delete branch" merge check
Heiko Voigt [Fri, 4 Dec 2009 21:26:48 +0000 (22:26 +0100)]
git gui: make current branch default in "remote delete branch" merge check

We already do the same when locally deleting a branch.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: adjust the minimum height of diff pane for shorter screen height
Vietor Liu [Fri, 16 Oct 2009 09:41:26 +0000 (17:41 +0800)]
git-gui: adjust the minimum height of diff pane for shorter screen height

When the main window is maximized, if the screen height is shorter (e.g.
Netbook screen 1024x600), both the partial commit pane and the status bar
are hidden. The diff pane is resizable, so that it can use less vertical
height, allowing the overall window to be shorter and still display both
the entire commit pane and status bar.

Signed-off-by: Vietor Liu <vietor@vxwo.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: fix use of uninitialized variable
Jens Lehmann [Thu, 24 Sep 2009 16:56:28 +0000 (18:56 +0200)]
git-gui: fix use of uninitialized variable

This fixes a bug introduced by the "display summary when showing diff of a
submodule" patch. It lead to a "no such variable" error when opening the
diff context menu while no diff was shown.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: store wm state and fix wm geometry
Alexey Borzenkov [Tue, 8 Sep 2009 18:39:33 +0000 (22:39 +0400)]
git-gui: store wm state and fix wm geometry

I often close git gui window when it is maximized, and when I reopen
it next time the it would usually become out of place (e.g. a huge
window with a top-left corner somewhere close to the center of the
screen). Fix it by storing and restoring wm state in config, as well
as setting wm state to normal before retrieving wm geometry info.

Signed-off-by: Alexey Borzenkov <snaury@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Ensure submodule path is quoted properly
Shawn O. Pearce [Thu, 27 Aug 2009 00:39:45 +0000 (17:39 -0700)]
git-gui: Ensure submodule path is quoted properly

When quoting an arbitrary user string in Tcl, its better to use
[list ...] than to use {...}, in case the user string has spaces
or { embedded within it.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: fix diff for partially staged submodule changes
Jens Lehmann [Wed, 26 Aug 2009 20:25:15 +0000 (22:25 +0200)]
git-gui: fix diff for partially staged submodule changes

When a submodule commit had already been staged and another commit had
been checked out inside the submodule, the diff always displayed the
submodule commit log messages between the last supermodule commit and
the working tree, totally ignoring the commit in the index.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Update russian translation
Alex Riesen [Wed, 12 Aug 2009 15:24:10 +0000 (17:24 +0200)]
git-gui: Update russian translation

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Limit display to a maximum number of files
Dan Zwell [Tue, 11 Aug 2009 18:50:00 +0000 (13:50 -0500)]
git-gui: Limit display to a maximum number of files

When there is a large number of new or modified files,
"display_all_files" takes a long time, and git-gui appears to hang.

This change limits the number of files that are displayed.  This
limit can be set as gui.maxfilesdisplayed, and is 5000 by default.

A warning is shown the first time the list of files is truncated
in this GUI session.  Subsequent truncations are not mentioned to
the user.

Signed-off-by: Dan Zwell <dzwell@zwell.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: remove warning when deleting correctly merged remote branch
Heiko Voigt [Mon, 15 Jun 2009 21:19:56 +0000 (23:19 +0200)]
git-gui: remove warning when deleting correctly merged remote branch

If the user wants to delete a remote branch and selects the correct
"merged into" we should not warn that "Recovering deleted branches is
difficult". For local branches we do the same already.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Added Greek translation & glossary
Jimmy Angelakos [Tue, 23 Jun 2009 18:35:35 +0000 (21:35 +0300)]
git-gui: Added Greek translation & glossary

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: display summary when showing diff of a submodule
Jens Lehmann [Tue, 21 Jul 2009 17:32:31 +0000 (19:32 +0200)]
git-gui: display summary when showing diff of a submodule

As it is hard to say what changed in a submodule by looking at the hashes,
let's show the colored submodule summary instead.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Fixes for Mac OS X TkAqua
Daniel A. Steffen [Sat, 16 Aug 2008 01:20:09 +0000 (03:20 +0200)]
git-gui: Fixes for Mac OS X TkAqua

- detect more Tk.framework variants
- fix apple menu setup, use native preferences menu item
- don't set menu font

Signed-off-by: Daniel A. Steffen <das@users.sourceforge.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Update Russian translation
Alex Riesen [Wed, 29 Apr 2009 05:56:06 +0000 (07:56 +0200)]
git-gui: Update Russian translation

Also, the previous translations of the words 'tag' and 'merge' were
changed. Added translation of the 'Tool' submenu.

Thanks go to Alexander Gavrilov and Dmitry Potapov for proofreading
and suggestions.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: run post-checkout hook after clone
Jens Lehmann [Mon, 6 Apr 2009 19:05:55 +0000 (21:05 +0200)]
git-gui: run post-checkout hook after clone

git-gui is using "git-read-tree -u" when cloning which doesn't
invoke the post-checkout hook as a plain git-clone would.
So git-gui must call the hook itself.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agoMerge branch 'maint'
Shawn O. Pearce [Wed, 8 Apr 2009 14:41:13 +0000 (07:41 -0700)]
Merge branch 'maint'

* maint:
  git-gui: Ensure consistent usage of mergetool.keepBackup
  git-gui: fix use of undeclared variable diff_empty_count

15 years agogit-gui: Ensure consistent usage of mergetool.keepBackup
Ferry Huberts [Tue, 7 Apr 2009 15:33:35 +0000 (17:33 +0200)]
git-gui: Ensure consistent usage of mergetool.keepBackup

In several places merge.keepBackup is used i.s.o.
mergetool.keepBackup. This patch makes it all
consistent.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: fix use of undeclared variable diff_empty_count
Joerg Bornemann [Mon, 6 Apr 2009 19:59:28 +0000 (21:59 +0200)]
git-gui: fix use of undeclared variable diff_empty_count

Commit 584fa9cc introduced the global variable diff_empty_count, which
is used in diff.tcl. This variable wasn't declared anywhere which
resulted in an ugly error message box instead of the intended
informative message.

Signed-off-by: Joerg Bornemann <joerg.bornemann@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui (Win): make starting via "Git GUI Here" on .git/ possible
Markus Heidelberg [Tue, 31 Mar 2009 23:55:39 +0000 (01:55 +0200)]
git-gui (Win): make starting via "Git GUI Here" on .git/ possible

This works around git-gui's error message

    Cannot use funny .git directory: .

when started from the .git/ directory, which is useful in repositories
without any directories for the right click.

Now git-gui can be started via Windows Explorer shell extension (Git GUI
Here) from the .git/ directory.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui (Win): make "Explore Working Copy" more robust
Markus Heidelberg [Tue, 31 Mar 2009 23:55:36 +0000 (01:55 +0200)]
git-gui (Win): make "Explore Working Copy" more robust

Starting the Explorer from the git-gui menu "Explore Working Copy"
didn't work, when git-gui was started via Windows Explorer shell
extension (Git GUI Here) from a directory within the project.
The Explorer raised an error message like this:

    Path "C:/somedir/worktree" is not available or not a directory

It worked when started from the project directory itself, because then
the path argument for the Explorer was just '.' (current directory)
without any problematic forward slashes.

To make it work, convert the path given as argument to explorer.exe to
its native format with backslashes.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: run post-checkout hook on checkout
Jens Lehmann [Mon, 30 Mar 2009 19:46:17 +0000 (21:46 +0200)]
git-gui: run post-checkout hook on checkout

git-gui is using "git-read-tree -u" for checkout which doesn't
invoke the post-checkout hook as a plain git-checkout would.
So git-gui must call the hook itself.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: When calling post-commit hook wrong variable was cleared.
Jens Lehmann [Mon, 30 Mar 2009 18:35:57 +0000 (20:35 +0200)]
git-gui: When calling post-commit hook wrong variable was cleared.

Before calling the post-commit hook, the variable "pc_err" is cleared
while later only "pch_error" is used. "pch_error$cmt_id" only appeared in
"upvar"-Statements (which were changed to "global") and was removed.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: use `git --html-path` to get the location of installed HTML docs
Markus Heidelberg [Sun, 5 Apr 2009 01:48:21 +0000 (03:48 +0200)]
git-gui: use `git --html-path` to get the location of installed HTML docs

Previously a hardcoded path $GIT_EXEC_PATH/../Documentation/ was used to
search for the documentation, when the user has asked for it via menu
"Help -> Online Documentation".
This didn't work for the default directory structure.

To find the path reliably, use the new git command line option, which
returns the correct path.

If the output of `git --html-path` is empty because git is not found or
the option is not yet supported in the installed git, the documentation
from kernel.org is launched. There is no additional guessing of the
right location of the installed docs.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agoMerge branch 'maint'
Shawn O. Pearce [Mon, 30 Mar 2009 14:09:28 +0000 (07:09 -0700)]
Merge branch 'maint'

* maint:
  git-gui: fix deleting from the context menu with empty selection

15 years agogit-gui: fix deleting from the context menu with empty selection
Markus Heidelberg [Sun, 29 Mar 2009 14:29:23 +0000 (15:29 +0100)]
git-gui: fix deleting from the context menu with empty selection

An "Application Error" was raised when trying to delete text from the
commit message field when no text was selected.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: minor spelling fix and string factorisation.
Sam Hocevar [Mon, 23 Mar 2009 23:42:24 +0000 (00:42 +0100)]
git-gui: minor spelling fix and string factorisation.

Properly spell "successful" and slightly rewrite a couple of strings
that actually say the same thing in order to reduce translation work.

Update .pot and .po files accordingly since no new translation is
required.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: various French translation fixes
Sam Hocevar [Tue, 24 Mar 2009 23:15:38 +0000 (00:15 +0100)]
git-gui: various French translation fixes

Mostly grammar, spelling and typography fixes, but also a few wording
enhancements here and there.

Signed-off-by: Sam Hocevar <sam@zoy.org>
Acked-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agoMerge branch 'maint'
Shawn O. Pearce [Fri, 20 Mar 2009 21:44:48 +0000 (14:44 -0700)]
Merge branch 'maint'

15 years agogit-gui: Fix merge conflict display error when filename contains spaces
Jens Lehmann [Fri, 20 Mar 2009 07:48:55 +0000 (08:48 +0100)]
git-gui: Fix merge conflict display error when filename contains spaces

When a merge conflict occurs in a file with spaces in the filename,
git-gui showed wrongly "LOCAL: deleted".

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agoMerge branch 'maint'
Shawn O. Pearce [Tue, 17 Mar 2009 03:01:27 +0000 (20:01 -0700)]
Merge branch 'maint'

* maint:
  git-gui: don't hide the Browse button when resizing the repo chooser

15 years agogit-gui: don't hide the Browse button when resizing the repo chooser
Markus Heidelberg [Fri, 13 Mar 2009 23:42:37 +0000 (00:42 +0100)]
git-gui: don't hide the Browse button when resizing the repo chooser

Rather shrink the input field for "Create New Repository" and "Open
Existing Repository" as it's already done for "Clone Existing
Repository".

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agoAppend ampersand to "Target" of lnk files created by do_cygwin_shortcut
Phil Lawrence [Mon, 9 Mar 2009 22:09:49 +0000 (17:09 -0500)]
Append ampersand to "Target" of lnk files created by do_cygwin_shortcut

The git-gui menu item "Repository | Create Desktop Icon" creates a
shortcut (.lnk file) on the Windows desktop.  The purpose of the
created shortcut is to make it easy for a user to launch git-gui
for a particular repo in the future.

A Windows user would expect to see git gui launch when they click
the shortcut; they would not expect (nor want) to see a cmd window
open and remain open in the background.

msysGit avoids opening a command window altogether when it's Git GUI
shortcut is used.  Ideally, git on cygwin would also have shortcuts
that simply open the GUI, but as a first step, this change allows
the shell window to politely disappear after starting git gui as a
background process.

Signed-off-by: Phil Lawrence <prlawrence@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Support more git version notations.
Alexander Gavrilov [Sat, 7 Feb 2009 16:43:57 +0000 (19:43 +0300)]
git-gui: Support more git version notations.

Recently the msysgit repository has got a '1.6.1-msysgit1'
tag, which, when used to build the git version, is not
handled gracefully by the git-gui version code.

This patch changes the regular expressions to fix it, and
removes the hardcoded 'rc' string. Now git-gui can accept
a version tail like '.foo123.GIT.bar.456.7.g89ab'

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Avoid an infinite rescan loop in handle_empty_diff.
Alexander Gavrilov [Sat, 7 Feb 2009 16:24:01 +0000 (19:24 +0300)]
git-gui: Avoid an infinite rescan loop in handle_empty_diff.

If the index update machinery and git diff happen to disagree
on whether a particular file is modified, it may cause git-gui
to enter an infinite index rescan loop, where an empty diff
starts a rescan, which finds the same set of files modified,
and tries to display the diff for the first one, which happens
to be the empty one. A current example of a possible disagreement
point is the autocrlf filter.

This patch breaks the loop by using a global counter to track
the auto-rescans. The variable is reset whenever a non-empty
diff is displayed.

Another suggested approach, which is based on giving the
--exit-code argument to git diff, cannot be used, because
diff-files seems to trust the timestamps in the index, and
returns a non-zero code even if the file is actually
unchanged, which essentially defeats the purpose of the
auto-rescan logic.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Fix post-commit status with subject in non-locale encoding
Alexander Gavrilov [Fri, 23 Jan 2009 21:18:13 +0000 (00:18 +0300)]
git-gui: Fix post-commit status with subject in non-locale encoding

As pointed out in msysgit bug #181, when a non-locale encoding is
used for commits, post-commit status messages display the subject
incorrectly.  It happens because the file handle is not properly
configured before the subject is read back.

This patch fixes it by factoring out the code that is used to setup
the output handle into a separate function, and calling it from
the reading code.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Acked-by: Robin Rosenberg <robin.rosenberg@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui 0.12 gitgui-0.12.0
Shawn O. Pearce [Thu, 18 Dec 2008 04:15:17 +0000 (20:15 -0800)]
git-gui 0.12

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Get rid of the last remnants of GIT_CONFIG_LOCAL
Johannes Schindelin [Sun, 14 Dec 2008 22:12:49 +0000 (23:12 +0100)]
git-gui: Get rid of the last remnants of GIT_CONFIG_LOCAL

In dc871831(Only use GIT_CONFIG in "git config", not other programs),
GIT_CONFIG_LOCAL was rested in peace, in favor of not reading
/etc/gitconfig and $HOME/.gitconfig at all when GIT_CONFIG is set.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Update Hungarian translation for 0.12
Miklos Vajna [Wed, 10 Dec 2008 14:03:13 +0000 (15:03 +0100)]
git-gui: Update Hungarian translation for 0.12

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Fixed typos in Swedish translation.
Peter Krefting [Wed, 10 Dec 2008 08:51:27 +0000 (09:51 +0100)]
git-gui: Fixed typos in Swedish translation.

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Updated Swedish translation (515t0f0u).
Peter Krefting [Tue, 9 Dec 2008 15:26:46 +0000 (16:26 +0100)]
git-gui: Updated Swedish translation (515t0f0u).

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit gui: update Italian translation
Michele Ballabio [Thu, 4 Dec 2008 17:28:21 +0000 (18:28 +0100)]
git gui: update Italian translation

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Update Japanese translation for 0.12
Nanako Shiraishi [Tue, 9 Dec 2008 03:42:17 +0000 (12:42 +0900)]
git-gui: Update Japanese translation for 0.12

Adds translation for one new message string.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Starting translation for Norwegian
Fredrik Skolmli [Mon, 8 Dec 2008 16:36:57 +0000 (17:36 +0100)]
git-gui: Starting translation for Norwegian

This file have been used locally for some time, and is near
completion. Will put an effort into completing it later on,
or just leave it as an excercise for other Norwegians.

Signed-off-by: Fredrik Skolmli <fredrik@frsk.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Update German (completed) translation.
Christian Stimming [Sat, 6 Dec 2008 20:22:16 +0000 (21:22 +0100)]
git-gui: Update German (completed) translation.

Signed-off-by: Christian Stimming <stimming@tuhh.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Update po template to include 'Mirroring %s' message
Shawn O. Pearce [Mon, 8 Dec 2008 16:32:28 +0000 (08:32 -0800)]
git-gui: Update po template to include 'Mirroring %s' message

A late addition to the message library.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Fix commit encoding handling.
Alexander Gavrilov [Sat, 6 Dec 2008 17:24:35 +0000 (20:24 +0300)]
git-gui: Fix commit encoding handling.

Commits without an encoding header are supposed to
be encoded in utf8. While this apparently hasn't always
been the case, currently it is the active convention, so
it is better to follow it; otherwise people who have to
use commitEncoding on their machines are unable to read
utf-8 commits made by others.

I also think that it is preferrable to display the warning
about an unsupported value of commitEncoding more prominently,
because this condition may lead to surprising behavior and,
eventually, to loss of data.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Fix handling of relative paths in blame.
Alexander Gavrilov [Sat, 6 Dec 2008 17:21:54 +0000 (20:21 +0300)]
git-gui: Fix handling of relative paths in blame.

Currently using '..' or '.' in the file path for gui blame
causes it to break, because the path is passed inside the
SHA:PATH spec to cat-file, which apparently does not understand
such items. As a result, cat-file returns nothing, and the
viewer crashes because of an "index out of range" error.

This commit adds a simple function that normalizes such paths.
I choose not to use [file normalize], because it uses some data
from the file system, e.g. dereferences symlinks, and creates
an absolute path, while blame may be used to inspect historical
information that bears no relation to the current filesystem state.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Teach start_push_anywhere_action{} to notice when remote is a mirror.
Mark Burton [Tue, 2 Dec 2008 15:15:02 +0000 (15:15 +0000)]
git-gui: Teach start_push_anywhere_action{} to notice when remote is a mirror.

When the destination repository is a mirror, this function goofed by still
passing a refspec to git-push. Now it notices that the remote is a mirror
and holds the refspec.

Signed-off-by: Mark Burton <markb@ordern.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: update Japanese translation
Nanako Shiraishi [Wed, 26 Nov 2008 10:21:44 +0000 (19:21 +0900)]
git-gui: update Japanese translation

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: french translation update
Christian Couder [Sun, 23 Nov 2008 19:52:20 +0000 (20:52 +0100)]
git-gui: french translation update

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agoUpdated Swedish translation (514t0f0u).
Peter Krefting [Fri, 21 Nov 2008 07:35:53 +0000 (08:35 +0100)]
Updated Swedish translation (514t0f0u).

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit gui: update Italian translation
Michele Ballabio [Tue, 26 Aug 2008 22:49:54 +0000 (00:49 +0200)]
git gui: update Italian translation

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agoUpdate Hungarian translation. 100% completed.
Miklos Vajna [Mon, 17 Nov 2008 22:11:43 +0000 (23:11 +0100)]
Update Hungarian translation. 100% completed.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Fix the search bar destruction handler.
Alexander Gavrilov [Thu, 13 Nov 2008 18:52:52 +0000 (21:52 +0300)]
git-gui: Fix the search bar destruction handler.

Since delete_this is an ordinary function, it
should not be passed to cb; otherwise it produces
errors when blame windows are closed. Unfortunately,
it is not noticeable when blame is shown in the
master window, so I missed this bug.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agoUpdate the po template
Shawn O. Pearce [Sun, 16 Nov 2008 21:56:55 +0000 (13:56 -0800)]
Update the po template

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Implement automatic rescan after Tool execution.
Alexander Gavrilov [Sun, 16 Nov 2008 18:46:51 +0000 (21:46 +0300)]
git-gui: Implement automatic rescan after Tool execution.

The Tools menu is generally intended for commands that
affect the working directory or repository state. Thus,
the user would usually want to initiate rescan after
execution of a tool. This commit implements it.

In case somebody would want to avoid rescanning after
certain tools, it also adds an option that controls it,
although it is not made available through the Add dialog.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Allow Tools request arguments from the user.
Alexander Gavrilov [Sun, 16 Nov 2008 18:46:50 +0000 (21:46 +0300)]
git-gui: Allow Tools request arguments from the user.

While static commands are already useful, some tools need
additional parameters to reach maximum usability. This
commit adds support for passing them one revision name
parameter, and one arbitrary string. With this addition,
the tools menu becomes flexible enough to implement basic
rebase support:

[core]
        editor = kwrite
[guitool "Rebase/Abort"]
        cmd = git rebase --abort
        confirm = yes
[guitool "Rebase/Continue"]
        cmd = git rebase --continue
[guitool "Rebase/Skip Commit"]
        cmd = git rebase --skip
        confirm = yes
[guitool "Rebase/Start..."]
        cmd = git rebase $ARGS $REVISION $CUR_BRANCH
        title = Start Rebase
        prompt = Rebase Current Branch
        argprompt = Flags
        revprompt = New Base
        revunmerged = yes

Some of the options, like title or prompt, are intentionally
not included in the Add dialog to avoid clutter. Also, the
dialog handles argprompt and revprompt as boolean vars.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Add a Tools menu for arbitrary commands.
Alexander Gavrilov [Sun, 16 Nov 2008 18:46:49 +0000 (21:46 +0300)]
git-gui: Add a Tools menu for arbitrary commands.

Due to the emphasis on scriptability in the git
design, it is impossible to provide 100% complete
GUI. Currently unaccounted areas include git-svn
and other source control system interfaces, TopGit,
all custom scripts.

This problem can be mitigated by providing basic
customization capabilities in Git Gui. This commit
adds a new Tools menu, which can be configured
to contain items invoking arbitrary shell commands.

The interface is powerful enough to allow calling
both batch text programs like git-svn, and GUI editors.
To support the latter use, the commands have access
to the name of the currently selected file through
the environment.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Fix the after callback execution in rescan.
Alexander Gavrilov [Sun, 16 Nov 2008 18:46:48 +0000 (21:46 +0300)]
git-gui: Fix the after callback execution in rescan.

The rescan function receives a callback command
as its parameter, which is supposed to be executed
after the scan finishes. It is generally used to
update status. However, rescan may initiate a
loading of a diff, which always calls ui_ready after
completion. If the after handler is called before
that, ui_ready will override the new status.

This commit ensures that the after callback is
properly threaded through the diff machinery.

Since it uncovered the fact that force_first_diff
actually didn't work due to an undeclared global
variable, and the desired effects appeared only
because of the race condition between the diff
system and the rescan callback, I also reimplement
this function to make it behave as originally
intended.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Implement system-wide configuration handling.
Alexander Gavrilov [Sun, 16 Nov 2008 18:46:47 +0000 (21:46 +0300)]
git-gui: Implement system-wide configuration handling.

With the old implementation any system-wide options appear
to be set locally in the current repository. This commit
adds explicit handling of system options, essentially
interpreting them as customized default_config.

The difficulty in interpreting system options stems from
the fact that simple 'git config' lists all values, while
'git config --global' only values set in ~/.gitconfig,
excluding both local and system options.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: try to provide a window icon under X
Giuseppe Bilotta [Sun, 16 Nov 2008 02:42:32 +0000 (03:42 +0100)]
git-gui: try to provide a window icon under X

When running under X, we try to set up a window icon by providing a
hand-crafted 16x16 Tk photo image equivalent to the .ico. Wrap in a
catch because the earlier Tcl/Tk 8.4 releases didn't provide the 'wm
iconphoto' command.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Request blame metadata in utf-8.
Alexander Gavrilov [Sun, 9 Nov 2008 15:53:09 +0000 (18:53 +0300)]
git-gui: Request blame metadata in utf-8.

The blame builtin now supports automatic conversion of
metadata encoding. By default it is converted to the
character set specified by i18n.logoutputencoding.

Since gui blame expects the data in utf-8, it is
necessary to specify the desired encoding directly.
An old version of the blame command will simply
ignore the option.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Add the Show SSH Key item to the clone dialog.
Alexander Gavrilov [Sun, 9 Nov 2008 15:51:16 +0000 (18:51 +0300)]
git-gui: Add the Show SSH Key item to the clone dialog.

The user might need to see the key before cloning a repository.
This patch makes the relevant menu item available in the Select
Repository/Clone dialog.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Fix focus transition in the blame viewer.
Alexander Gavrilov [Sun, 9 Nov 2008 15:36:50 +0000 (18:36 +0300)]
git-gui: Fix focus transition in the blame viewer.

Now that the blame viewer has a search panel, it should be
taken into account by the focus transition code. Otherwise
showing a commit tip (by accidentally moving the mouse to
the text frame) causes the focus to transfer away from the
search field.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Update German translation.
Christian Stimming [Sat, 25 Oct 2008 20:51:05 +0000 (22:51 +0200)]
git-gui: Update German translation.

Not yet completed, though.

Signed-off-by: Christian Stimming <stimming@tuhh.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Do not munge conflict marker lines in a normal diff
Johannes Sixt [Tue, 14 Oct 2008 11:48:37 +0000 (13:48 +0200)]
git-gui: Do not munge conflict marker lines in a normal diff

Previously, conflict markers were highlighted in two ways: (1) They
received a distinguishing color; and (2) they had the '+' removed at the
beginning of the line. However, by doing (2), a hunk that contained
conflict markers could not be staged or unstaged because the resulting
patch was corrupted. With this change we no longer modify the diff text
of a 2-way diff, so that "Stage Hunk" and friends work.

Note that 3-way diff of a conflicted file is unaffected by this change,
and '++' before conflict markers is still removed. But this has no negative
impact because in this mode staging hunks or lines is disabled anyway.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Add a simple implementation of SSH_ASKPASS.
Alexander Gavrilov [Wed, 15 Oct 2008 09:28:21 +0000 (13:28 +0400)]
git-gui: Add a simple implementation of SSH_ASKPASS.

OpenSSH allows specifying an external program to use
for direct user interaction. While most Linux systems
already have such programs, some environments, for
instance, msysgit, lack it. This patch adds a simple
fallback Tcl implementation of the tool.

In msysgit it is also necessary to set a fake value of
the DISPLAY variable, because otherwise ssh won't even
try to use SSH_ASKPASS handlers.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Acked-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Add a dialog that shows the OpenSSH public key.
Alexander Gavrilov [Wed, 15 Oct 2008 09:28:20 +0000 (13:28 +0400)]
git-gui: Add a dialog that shows the OpenSSH public key.

Generating a new SSH key or finding an existing one may
be a difficult task for non-technical users, especially
on Windows.

This commit adds a new dialog that shows the public key,
or allows the user to generate a new one if none were found.
Since this is a convenience/informational feature for new
users, and the dialog is mostly read-only, it is located
in the Help menu.

The command line used to invoke ssh-keygen is designed to
force it to use SSH_ASKPASS if available, or accept empty
passphrases, but _never_ wait for user response on the tty.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Acked-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Mark-up strings in show_{other,unmerged}_diff() for localization
Johannes Sixt [Fri, 3 Oct 2008 11:13:42 +0000 (13:13 +0200)]
git-gui: Mark-up strings in show_{other,unmerged}_diff() for localization

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Show a round number of bytes of large untracked text files
Johannes Sixt [Fri, 3 Oct 2008 08:28:49 +0000 (10:28 +0200)]
git-gui: Show a round number of bytes of large untracked text files

If an untracked text file is selected, then its contents are displayed
instead of a diff. If the file is large, then the following hint is
inserted at the top:

  * Untracked file is 14774881 bytes.
  * Showing only first 131072 bytes.

Why exactly 131072 bytes? With this patch it is 100000 bytes.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Fix the blame viewer destroy handler.
Alexander Gavrilov [Fri, 3 Oct 2008 07:36:54 +0000 (11:36 +0400)]
git-gui: Fix the blame viewer destroy handler.

It did not delete the object, which is not very good.
Also, destroy may be fired up for subwindows, so we
should check %W.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Add a search command to the blame viewer.
Alexander Gavrilov [Fri, 3 Oct 2008 07:36:53 +0000 (11:36 +0400)]
git-gui: Add a search command to the blame viewer.

One of the largest deficiencies in the blame viewer at
the moment is the impossibility to search for a text
string. This commit fixes it by adding a Firefox-like
search panel to the viewer.

The panel can be shown by pressing F7 or clicking a
menu entry, and is hidden by pressing Esc. Find Next
is available through the F3 key.

Implementation is based on the gitk code, but heavily
refactored. It now also supports case-insensitive
searches, and uses the text box background color to
signal success or failure of the search.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Fix the blame window shape.
Alexander Gavrilov [Fri, 3 Oct 2008 07:36:52 +0000 (11:36 +0400)]
git-gui: Fix the blame window shape.

On modern high-resolution monitors the blame viewer
window is very high, yet too narrow. This patch
makes it gravitate to a more sane resolution, which
takes the font size into account.

It also changes the default text view size to 80% of
the window, and slightly modifies the border decorations
for better appearance.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Fix switch statement in lib/merge.tcl
Johannes Sixt [Wed, 8 Oct 2008 08:03:54 +0000 (10:03 +0200)]
git-gui: Fix switch statement in lib/merge.tcl

0aea2842 (Make Ctrl-T safe to use for conflicting files) introduced a new
case, but forgot the '-' to indicate that it shares the body with the
subsequent case label.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Fix fetching from remotes when adding them
Petr Baudis [Wed, 24 Sep 2008 23:39:13 +0000 (01:39 +0200)]
git-gui: Fix fetching from remotes when adding them

As you can see, this particular code branch did not see a lot
of testing for some time now. Apologies for that.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Fix removing non-pushable remotes
Petr Baudis [Wed, 24 Sep 2008 23:32:47 +0000 (01:32 +0200)]
git-gui: Fix removing non-pushable remotes

Git-gui does not add most of the remotes to the 'push' menu
since they are missing the "Push" line in their remotespec.
In that case, removing the remote would end up with an error.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Make input boxes in init/clone/open dialogs consistent
Petr Baudis [Wed, 24 Sep 2008 22:12:51 +0000 (00:12 +0200)]
git-gui: Make input boxes in init/clone/open dialogs consistent

Before, the input boxes would not be sunken and would have larger border,
which is inconsistent with the rest of the inputboxes for repository
locations in the git-gui UI.

Signed-off-by: Petr Baudis <petr.baudis@novartis.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Avoid using the term URL when specifying repositories
Petr Baudis [Wed, 24 Sep 2008 22:12:50 +0000 (00:12 +0200)]
git-gui: Avoid using the term URL when specifying repositories

Instead, 'Location' is used to label such inputs; in the Clone dialog,
'Source' and 'Target' are also introduced to further clarify the situation.
The intent is to increase GUI consistency in the case location templates
(upcoming) are used - then, other locators than URL may be used.

Signed-off-by: Petr Baudis <petr.baudis@novartis.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: gui.autoexplore makes explorer to pop up automatically after picking
Petr Baudis [Wed, 24 Sep 2008 22:07:02 +0000 (00:07 +0200)]
git-gui: gui.autoexplore makes explorer to pop up automatically after picking

Especially for Windows users used to work with the Windows Explorer,
it is very useful when after picking a repository (either opening
a local one or initializing/cloning a new one) in the "intro" window,
the explorer view of the working copy pops up along the standard
Git GUI window, so that the users can, well, actually work with
the repository.

Signed-off-by: Petr Baudis <petr.baudis@novartis.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Add Explore Working Copy to the Repository menu
Petr Baudis [Wed, 24 Sep 2008 22:05:53 +0000 (00:05 +0200)]
git-gui: Add Explore Working Copy to the Repository menu

Especially when cloning is finished, the Git GUI window pops up,
but there is not really much one can do within it - there needs to be
a way to easily start exploring and working with the new working copy
using the standard system interface: explorer.exe on Windows, open on
MacOS/X and xdg-open as a fallback (all modern Linux desktops).

This might be also a post-clone option instead (possibly opening the window
automagically) but I believe that this might be useful also in other
situations, e.g. you don't have to keep the working copy window around
if you work in multiple repositories.

This operation will not make sense on bare repositories.

Signed-off-by: Petr Baudis <petr.baudis@novartis.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Use git web--browser for web browsing
Petr Baudis [Wed, 24 Sep 2008 21:57:16 +0000 (23:57 +0200)]
git-gui: Use git web--browser for web browsing

This patch removes git-gui specific webbrowser guessing and instead
relies on git web--browser to do the right thing, removing unnecessary
code duplication. New function start_browser encapsulates the browser
execution, for usage from other parts of code. This will also make
git-gui show the documentation menu item even in cases it might not
be able to start up a browser, these cases should be however only
very rare.

Signed-off-by: Petr Baudis <petr.baudis@novartis.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: mkdir -p when initializing new remote repository
Petr Baudis [Wed, 24 Sep 2008 20:44:03 +0000 (22:44 +0200)]
git-gui: mkdir -p when initializing new remote repository

This allows the user to create repositories with arbitrary paths
on the server. The downside is that errorneously typed paths are
not caught but instead created remotely; YMMV.

Signed-off-by: Petr Baudis <petr.baudis@novartis.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Add support for removing remotes
Petr Baudis [Wed, 24 Sep 2008 20:44:02 +0000 (22:44 +0200)]
git-gui: Add support for removing remotes

We introduce new submenu Remote -> Remove Remote, allowing to remove
remotes. In the future, we might consider a confirmation popup to avoid
misclicks, but removing a remote is not very lossy operation.

Signed-off-by: Petr Baudis <petr.baudis@novartis.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Add support for adding remotes
Petr Baudis [Wed, 24 Sep 2008 20:44:01 +0000 (22:44 +0200)]
git-gui: Add support for adding remotes

When a remote is being added, it can also be automatically either fetched
or initialized and pushed; this patch adds capability for initializing
of local and ssh repositories. This also of course leaves a lot of space
for further customization features, like individually turning the
initialization phase on/off or tuning attributes of the remote
repository; I consider that out of scope of this patch, however.

Signed-off-by: Petr Baudis <petr.baudis@novartis.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Squash populate_{push,fetch}_menu to populate_remotes_menu
Petr Baudis [Wed, 24 Sep 2008 20:44:00 +0000 (22:44 +0200)]
git-gui: Squash populate_{push,fetch}_menu to populate_remotes_menu

The meat of the routines is now separated to add_fetch_entry() and
add_push_entry(). This refactoring will allow easy implementation of adding
individual remotes later.

Signed-off-by: Petr Baudis <petr.baudis@novartis.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Clarify the Remote -> Delete... action
Petr Baudis [Wed, 24 Sep 2008 20:43:59 +0000 (22:43 +0200)]
git-gui: Clarify the Remote -> Delete... action

Currently, it was not really clear what all does this perform. We rename
"Delete..." to "Delete Branch..." (since this does not delete the remote
as a whole) and relabel the window from "Delete Remote Branch" to "Delete
Branch Remotely" (since the action also involves pushing the delete out).

Signed-off-by: Petr Baudis <petr.baudis@novartis.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>