Commit Graph

821 Commits

Author SHA1 Message Date
Christian Stimming
660a68cf18 Add glossary that can be converted into a po file for each language.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2007-09-02 16:56:13 +01:00
Johannes Schindelin
9f1a80877a Ignore po/*.msg
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2007-09-02 16:56:13 +01:00
Johannes Schindelin
e79bbfea9b Add po/git-gui.pot
Usually, generated files are not part of the tracked content in
a project.  However, translators may lack the tools to generate
git-gui.pot.  Besides, it is possible that a contributor does
not even check out the repository, but gets this file via gitweb.

Pointed out by Junio.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2007-09-02 16:56:00 +01:00
Junio C Hamano
2631a81b90 git-gui po/README: Guide to translators
This short note is to help a translation contributor to help us
localizing git-gui message files by covering the basics.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-02 16:55:18 +01:00
Christian Stimming
3845048064 Makefile rules for translation catalog generation and installation.
[jes: with fixes by the i18n team.]

Signed-off-by: Christian Stimming <stimming@tuhh.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2007-09-02 16:55:16 +01:00
Christian Stimming
1ac17950e9 Mark strings for translation.
The procedure [mc ...] will translate the strings through msgcat.
Strings must be enclosed in quotes, not in braces, because otherwise
xgettext cannot extract them properly, although on the Tcl side both
delimiters would work fine.

[jes: I merged the later patches to that end.]

Signed-off-by: Christian Stimming <stimming@tuhh.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2007-09-02 16:54:48 +01:00
Shawn O. Pearce
d4b0ccd931 git-gui: Initialize Tcl's msgcat library for internationalization
Tcl's msgcat library and corresponding mc procedure can locate a
translated string for any user message, provided that it is first
given a directory where the *.msg files are located containing the
translations.

During installation we will place the translations in lib/msgs/,
so we need to inform msgcat of this location once we determine it
during startup.  Our source code tree however will store all of
the translations within the po/ directory, so we need to special
case this variant.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-09-01 22:22:42 -04:00
Shawn O. Pearce
fc703c209d git-gui: Locate the library directory early during startup
To support a localized version of git-gui we need to locate the
library directory early so we can initialize Tcl's msgcat package
to load translated messages from.  This needs to occur before we
declare our git-version proc so that errors related to locating
git or assessing its version can be reported to the end-user in
their preferred language.  However we have to keep the library
loading until after git-version has been declared, otherwise we
will fail to start git-gui if we are using a fake tclIndex that
was generated by our Makefile.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-09-01 21:58:29 -04:00
Shawn O. Pearce
c80d25dbce git-gui: Correct 'git gui blame' in a subdirectory
David Kastrup pointed out that the following sequence was not
working as we had intended:

  $ cd lib
  $ git gui blame console.tcl
  fatal: cannot stat path lib/console.tcl: No such file or directory

The problem here was we disabled the chdir to the root of the
working tree when we are running with a "bare allowed" feature
such as blame or browser, but we still kept the prefix we found via
`git rev-parse --show-prefix`.  This caused us to try and look for
the file "console.tcl" within the subdirectory but also include
the subdirectory's own path from the root of the working tree.
This is unlikely to succeed, unless the user just happened to have
a "lib/lib/console.tcl" file in the repository, in which case we
would produce the wrong result.

In the case of a bare repository we shouldn't get back a value from
`rev-parse --show-prefix`, so really $_prefix should only be set
to the non-empty string if we are in a working tree and we are in a
subdirectory of that working tree.  If this is true we really want
to always be at the top level of the working tree, as all paths are
accessed as though they were relative to the top of the working tree.
Converting $_prefix to a ../ sequence is a fairly simple approach
to moving up the requisite levels.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-08-24 23:15:50 -04:00
Shawn O. Pearce
9c9f5fa97f git-gui: Do not offer to stage three-way diff hunks into the index
git-apply does not accept a patch that was generated as a three-way
combined diff format such as we see during merge conflicts.  If we
get such a diff in our diff viewer and try to send it to git-apply
it just errors out and the user is left confused wondering why they
cannot stage that hunk.

Instead of feeding a known to be unacceptable hunk to git-apply we
now just disable the stage/unstage context menu option if the hunk
came from a three way diff.  The user may still be confused about
why they cannot work with a combined diff, but at least they are
only confused as to why git-gui is not offering them the action.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-08-23 02:44:13 -04:00
Shawn O. Pearce
9f4119eb76 git-gui: Refactor diff pane popup support for future improvements
The current popup_diff_menu procedure is somewhat messy as it has a
few duplications of the same logic in each of the different legs of
the routine.  We can simplify these by setting a few state variables
in the different legs.

No functional change, just a cleanup to make it easier to implement
future functional changes within this block.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-08-23 02:39:45 -04:00
Shawn O. Pearce
875b7c9368 git-gui: Fix "unoptimized loading" to not cause git-gui to crash
If the tclsh command was not available to us at the time we were
"built" our lib/tclIndex just lists all of our library files and
we source all of them at once during startup, rather than trying
to lazily load only the procedures we need.  This is a problem as
some of our library code now depends upon the git-version proc,
and that proc is not defined until after the library was fully
loaded.

I'm moving the library loading until after we have determined the
version of git we are talking to, as this ensures that the required
git-reversion procedure is defined before any library code can be
loaded.  Since error_popup is defined in the library we instead use
tk_messageBox directly for errors found during the version detection.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-08-22 02:41:00 -04:00
Shawn O. Pearce
ce015c213f git-gui: Paper bag fix "Stage Hunk For Commit" in diff context menu
In a13ee29b97 I totally broke the
"Stage Hunk For Commit" feature by making this menu item always
appear in a disabled state, so it was never invokable.  A "teaser
feature", just sitting there taunting the poor user who has become
used to having it available.

The issue caused by a13ee was I added a test to look at the data
in $file_states, but I didn't do that test correctly as it was
always looking at a procedure local $file_states array, which is
not defined, so the test was always true and we always disabled
the menu entry.

Instead we only want to disable the menu entry if the current file
we are looking at has no file state information (git-gui is just a
very confused little process) or it is an untracked file (and we
cannot stage individual hunks).

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-08-21 02:22:53 -04:00
Shawn O. Pearce
18a01a0da4 git-gui: Allow git-merge to use branch names in conflict markers
Earlier when I rewrote the merge implementation for git-gui I broke
it such that the conflict markers for the "theirs" side of the hunk
was using a full SHA-1 ID in hex, rather than the name of the branch
the user had merged.  This was because I got paranoid and passed off
the full SHA-1 to git-merge, instead of giving it the reference name
the user saw in the merge dialog.

I'd still like to resolve the SHA-1 upfront in git-gui and always use
that value throughout the merge, but I can't do that until we have a
full implementation of git-merge written in Tcl.  Until then its more
important that the conflict markers be useful to the end-user, so we
need to pass off the ref name and not the SHA-1 ID.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-08-20 02:17:05 -04:00
Shawn O. Pearce
c6951ddb52 git-gui: Fix window manager problems on ion3
cehteh on #git noticed that secondary windows such as console
windows from push/fetch/merge or the blame browser failed on ion
when we tried to open them a second time.

The issue turned out to be the fact that on ion [winfo ismapped .]
returns false if . is not visible right now because it has been
obscured by another window in the same panel.  So we need to keep
track of whether or not the root window has been displayed for this
application, and once it has been we cannot ever assume that ismapped
is going to return true.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-08-20 00:38:13 -04:00
Väinö Järvelä
51b8c5021a git-gui: Added support for OS X right click
OS X sends Button-2 on a "real" right click, such as with a three
button mouse, or by using the two-finger trackpad click.

Signed-off-by: Väinö Järvelä <v@pp.inet.fi>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-08-04 02:47:30 -04:00
Shawn O. Pearce
a13ee29b97 git-gui: Avoid Tcl error in popup menu on diff viewer
If there is no path currently shown in the diff viewer then we
were getting Tcl errors anytime the user right-clicked on the
diff viewer to bring up its popup menu.  The bug here is caused
by trying to get the file_state for the empty string; this path
is never seen so we never have file_state for it.  In such cases
we now disable the Stage Hunk For Commit option.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-08-02 22:55:22 -04:00
Shawn O. Pearce
84f67537b1 git-gui: Minor refactoring of merge command line in merge support
This is just a small code movement to cleanup how we generate
the command line for a merge.  I'm only doing it to make the
next series of changes slightly more readable.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-29 23:44:52 -04:00
Shawn O. Pearce
dac7089263 git-gui: Use more modern looking icons in the tree browser
This is a replacement of all of the icons in our tree browser
window, as the prior icons just looked too 1980s Tk-ish.  The
icons used here are actually from a KDE themed look, so they
might actually be familiar to some users of git-gui.

Aside from using more modern looking icons we now have a special
icon for executable blobs, to make them stand out from the normal
non-executable blobs.  We also denote symlinks now with a different
icon, so they stand out from the other types of objects in the tree.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-29 23:44:52 -04:00
Shawn O. Pearce
37e2199c4c git-gui: Don't offer to stage hunks from untracked files
If the user looks at an untracked file in our diff pane we used
to offer "Stage Hunk For Commit" in the context menu when they
right-clicked in that pane.  The problem is we don't actually
have any diff hunks in untracked files, so there is nothing to
really select for staging.  So we now grey out the menu item,
so the user cannot invoke it and think its broken when it does
not perform any useful action.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-29 23:44:51 -04:00
Shawn O. Pearce
95af4d8de1 git-gui: Make sure remotes are loaded when picking revisions
If we are started for only a blame/browser/citool run we don't
usually initialize the list of remotes, or determine which refs
are tracking branches and which are local branch heads.  This is
because some of that work is relatively expensive and is usually
not going to be needed if we are started only for a blame, or to
make a single commit.

However by not loading the remote configuration we were crashing
if the user tried to open a browser for another branch through
the Repository menu, as our load_all_heads procedure was unable
to decide which refs/heads/ items were actually local heads.  We
now force all remote configuration data to be loaded if we have
not done so already and we are trying to create a revision mega
widget.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-29 23:44:51 -04:00
Shawn O. Pearce
0fe055cd24 git-gui: Use progress bar while resetting/aborting files
Resetting a large number of files on a slow filesystem can take
considerable time, just as switching branches in such a case can
take more than two seconds.  We now take advantage of the progress
meter output by read-tree and show it in the main window status
bar, just like we do during checkout (branch switch).

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-29 04:07:13 -04:00
Shawn O. Pearce
94a4dd9bfd git-gui: Honor core.excludesfile when listing extra files
Recent git versions have a git-status that honors the core.excludesfile
configuration option when it reports on untracked files.  Unfortunately
I missed the introduction of this configuration option in the core
porcelain implementation, so it was not reflected here in git-gui.

Found and reported by Lars Noschinski <lars@public.noschinski.de>.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-29 03:22:27 -04:00
Christian Stimming
360cc106e7 git-gui: Unify wording to say "to stage" instead of "to add"
Also, the warning message when clicking "Reset" is adapted to
the wording "Reset" rather than a confusion "Cancel commit?".

Signed-off-by: Christian Stimming <stimming@tuhh.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-29 03:09:07 -04:00
Shawn O. Pearce
1e0a92fdf7 git-gui: Don't kill modified commit message buffer with merge templates
If the user is in the middle of a merge and has already started to
modify their commit message we were losing the user's changes when
they pressed 'Rescan' after resolving issues or making changes in
the working directory.

The problem here was our background timer that saves the commit
message buffer.  It marks the commit message buffer as not being
modified when it writes it out to disk, so during the rescan we
assumed the buffer should be replaced with what we read from the
MERGE_MSG file.  So we now only read these files from .git if we
have a valid backup file.  Since we clear it on commit this will
only have an impact while the user is actively editing the current
commit.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-27 02:30:15 -04:00
Shawn O. Pearce
bc318ea86d git-gui: Remove usernames from absolute SSH urls during merging
If we are being asked to merge a tracking branch that comes from a
remote repository accessed by the very common SSH URL format of
"user@host:/path/to/repo" then we really don't need the username
as part of the merge message, it only clutters up the history and
makes things more confusing.  So we instead clip the username part
off if the local filesystem path is absolute, as its probably not
going to be an ambiguous URL even when it is missing the username.

On the other hand we cannot clip the username off if the URL is
not absolute, because in such cases (e.g. "user@host:myrepo") the
directory that the repository path is resolved in is relative to
the user's home directory, and the username becomes important.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-25 05:02:38 -04:00
Shawn O. Pearce
ead49f5a4f git-gui: Format tracking branch merges as though they were pulls
If we are merging a tracking branch we know exactly what remote URL
that branch is fetched from, and what its name is on that remote
repository.  In this case we can setup a merge message that looks
just like a standard `git-pull $remote $branch` operation by filling
out FETCH_HEAD before we start git-merge, and then run git-merge just
like git-pull does.

I think the result of this behavior is that merges look a lot nicer
when the came off of local tracking branches, because they no longer
say "commit 'origin/...'" to describe the commit being merged but
instead now mention the specific repository we fetched those commits
from.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-25 04:54:53 -04:00
Shawn O. Pearce
9feefbd2d2 git-gui: Cleanup bindings within merge dialog
Misc. code cleanups in the merge dialog's binding setup and action
button creation.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-25 04:32:18 -04:00
Shawn O. Pearce
350a35f0a1 git-gui: Replace merge dialog with our revision picker widget
Now that we only support merging one branch we can offer the user
a better user interface experience by allowing them to select the
revision they want to merge through our revision picking widget.

This change neatly solves the problem of locating a branch out of
a sea of 200 tracking branches, and of dealing with very long branch
names that all have a common prefix.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-25 04:23:31 -04:00
Shawn O. Pearce
becafaace6 git-gui: Show ref last update times in revision chooser tooltips
If we can we now show the last modification date of a loose ref as
part of the tooltip information shown in the revision picker.  This
gives the user an indication of when was the last time that the ref
was modified locally, and may especially be of interest when looking
at a tracking branch.

If we cannot find the loose ref file than we try to fallback on the
reflog and scan it for the date of the last record.  We don't start
with the reflog however as scanning it backwards from the end is not
an easy thing to do in Tcl.  So I'm being lazy here and just going
through the entire file, line by line.  Since that is less efficient
than a single stat system call, its our fallback strategy.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-25 04:23:20 -04:00
Shawn O. Pearce
844c3f6fe9 git-gui: Display commit/tag/remote info in tooltip of revision picker
Our revision chooser mega-widget now sets up tooltips for itself so
that it displays details about a commit (or a tag and the commit
it refers to) when the user mouses over that line in the filtered
ref list.  If the item is from a remote tracking branch then we also
show the remote url and what branch on that remote we fetch from, so
the user has a clear concept of where that revision data originated.

To help the merge dialog I've also added a new constructor that
makes the dialog only offer unmerged revisions (those not in HEAD),
as this allows users to avoid performing merges only to get "Already
up to date" messages back from core Git.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-25 04:23:20 -04:00
Shawn O. Pearce
30d1990584 git-gui: Save remote urls obtained from config/remotes setup
I'm storing the URLs of any pre-configured remote repositories
that we happen to come across so that we can later use these
URLs to show to the user in parts of the UI that might care.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-25 04:23:09 -04:00
Shawn O. Pearce
7d5266a704 git-gui: Avoid unnecessary symbolic-ref call during checkout
If we are checking out the branch we are already on then there is no
need to call symbolic-ref to update the HEAD pointer to the "new"
branch name, it is already correct.

Currently this situation does not happen very often, but it can be
seen in some workflows where the user always recreates their local
branch from a remote tracking branch and more-or-less ignores what
branch he/she is on right now.  As they say, ignorance is bliss.

This case will however become a tad more common when we overload
checkout_op to actually also perform all of our merges.  In that
case we will likely see that the branch we want to "checkout" is
the current branch, as we are actually just merging into it.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-23 01:28:35 -04:00
Shawn O. Pearce
a8139888f8 git-gui: Refactor current branch menu items to make i18n easier
The i18n team has also identified a rather ugly block of code in
git-gui that is used to make a pair of Repository menu items show
the current branch name.  This code is difficult to convert to use
[mc ...] to lookup the translation, so I'm refactoring it into a
procedure.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-23 01:11:08 -04:00
Shawn O. Pearce
83751fc109 git-gui: Refactor diff popup into a procedure to ease i18n work
The folks working on the i18n version of git-gui have had some
trouble trying to convert these English strings into [mc] calls
due to the double evaluation.  Moving this block into a standard
procedure eliminates the double evaluation, making their work
easier.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-23 00:36:39 -04:00
Shawn O. Pearce
9c5a3c7797 git-gui: Paper bag fix quitting crash after commit
My earlier introduction of the GITGUI_BCK file (which saves the user's
commit message buffer while they are typing it) broke the Quit function.
If the user makes a commit we delete the GITGUI_BCK file; if they then
immediately quit the application we fail to rename the GITGUI_BCK file
to GITGUI_MSG.  This is because the file does not exist, but our flag
still says it does.  The root cause is we did not unset the flag during
commit.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-23 00:20:04 -04:00
Shawn O. Pearce
e7d7b1a34e git-gui: Clarify meaning of add tracked menu option
Junio recently pointed out on the mailing list that our "Add Existing"
feature is a lot like `git add -u`, which is generally described as
"(Re)Add Tracked Files".  This came up during discussion of how to
translate "Add Existing" into Japanese, as the individual working on
the translation was not quite sure what the option meant and therefore
had some trouble selecting the best translation.

I'm changing the menu option to "Add Tracked Files To Commit" and the
button to "Add Tracked".  This should help new users to better understand
the actions behind those GUI widgets.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-23 00:12:30 -04:00
Shawn O. Pearce
7bd197c7ba git-gui: Fix unnecessary fast-forward during checkout
If we are trying to checkout a local branch which is matched to a
remote tracking branch, but the local branch is newer than the remote
tracking branch we actually just want to switch to the local branch.
The local branch is "Already up to date".

Unfortunately we tossed away the local branch's commit SHA-1 and kept
the remote tracking branch's SHA-1, which meant that the user lost the
local changes when we updated the working directory.  At least we did
not update the local branch ref, so the user's data was still intact.

We now toss the tracking branch's SHA-1 and replace with the local
branch's SHA-1 before the checkout, ensuring that we pass of the right
tree to git-read-tree when we update the working directory.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-22 04:09:53 -04:00
Shawn O. Pearce
854ffd3046 git-gui: Completely remove my Tools/Migrate hack
This menu option of Tools/Migrate has been living inside of git-gui
as a local hack to support some coworkers of mine.  It has no value
to anyone outside of my day-job team and never really should have
been in a release version of git-gui.  So I'm pulling it out, so
that nobody else has to deal with this garbage.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-22 03:08:34 -04:00
Shawn O. Pearce
54febd4fe6 git-gui: Internally allow fetch without storing for future pull support
This is actually just an underlying code improvement that has no user
visible component yet.  UI improvements to actually fetch and merge via
an arbitrary remote with no tracking branches must still follow to make
this change useful for the end-user.

Our tracking branch specifications are a Tcl list of three components:

  - local tracking branch name
  - remote name/url
  - remote branch name/tag name

This change just makes the first element optional.  If it is an empty
string we will run the fetch, but have the value be saved only into the
special .git/FETCH_HEAD, where we can pick it up and use it for this one
time operation.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-21 05:00:37 -04:00
Shawn O. Pearce
dba07411da git-gui: Skip unnecessary read-tree work during checkout
I totally missed this obvious optimization in the checkout code path.
If our current repository HEAD is actually at the commit we are moving
to, and we agreed to perform this switch earlier, then we have no files
to update in the working directory and any stale mtimes are simply not
of consequence right now.  We can pretend like we ran a read-tree and
skip right into the post-read-tree work, such as updating the branch
and setting the symbolic-ref.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-21 05:00:37 -04:00
Shawn O. Pearce
eea1ab6e23 git-gui: Simplify error case for unsupported merge types
If we are given a merge type we don't understand in checkout_op there
is probably a bug in git-gui somewhere that allowed this unknown merge
strategy to come into this part of the code path.  We currently only
recognize three merge types ('none', 'ff' and 'reset') but are going
to be supporting more in the future.  Rather than keep editing this
message I'm going with a very generic "Uh, we don't do that!" type of
error.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-21 05:00:37 -04:00
Shawn O. Pearce
f66b8a68f2 git-gui: Factor out common fast-forward merge case
In both the ff and reset merge_types supported by checkout_op the
result is the same if the merge base of our target commit and the
existing commit is the existing commit: its a fast-forward as the
existing commit is fully contained in the target commit.

This minor cleanup in logic will make it easier to implement a
new kind of merge_type that actually merges the two trees with a
real merge strategy, such as git-merge-recursive.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-21 05:00:37 -04:00
Shawn O. Pearce
60f7352fe1 git-gui: Save the merge base during checkout_op processing
I've decided to teach checkout_op how to perform more than just a
fast-forward and reset type of merge.  This way we can also do a full
recursive merge even when we are recreating an existing branch from
a remote.  To help with that process I'm saving the merge-base we
computed during the ff/reset/fail decision process, in case we need
it later on when we actually start a true merge operation.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-21 05:00:36 -04:00
Shawn O. Pearce
4578c5cb69 git-gui: Automatically backup the user's commit buffer
A few users have been seeing crashes in Tk when using the undo key
binding to undo the last few keystroke events in the commit buffer.
Unfortunately that means the user loses their commit message and
must start over from scratch when the user restarts the process.

git-gui now saves the user's commit message buffer every couple of
seconds to a temporary file under .git (specifically .git/GITGUI_BCK).
At exit time we rename this file to .git/GITGUI_MSG if there is a
message, the file exists, and it is currently synchronized with the
Tk buffer.  Otherwise we do our usual routine of saving the Tk buffer
to .git/GITGUI_MSG and delete .git/GITGUI_BCK, if it exists.

During startup we favor .git/GITGUI_BCK over .git/GITGUI_MSG.  This
way a crash doesn't take out the user's message buffer but instead
will cause the user to lose only a few keystrokes.  Most people do
not type more than 200 WPM, and with 30 possible saves per minute
we are unlikely to lose more than 7 words.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-21 04:57:57 -04:00
Shawn O. Pearce
5dc2cae6f4 git-gui: Completely remove support for creating octopus merges
I'm working on refactoring the UI of the merge dialog, because as it
currently stands the dialog is absolutely horrible, especially when
you have 200+ branches available from a single remote system.

In that refactoring I plan on using the choose_rev widget to allow
the user to select exactly which branch/commit they want to merge.
However since that only selects a single commit I'm first removing
the code that supports octopus merges.

A brief consultation on #git tonight seemed to indicate that the
octopus merge strategy is not as useful as originally thought when
it was invented, and that most people don't commonly use them.  So
making users fall back to the command line to create an octopus is
actually maybe a good idea here, as they might think twice before
they use it.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-19 02:24:25 -04:00
Shawn O. Pearce
a42289621e git-gui: Don't show blame tooltips that we have no data for
If we haven't yet loaded any commit information for a given line but
our tooltip timer fired and tried to draw the tooltip we shouldn't;
there is nothing to show.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-19 01:45:42 -04:00
Shawn O. Pearce
c4638f662c git-gui: Translate standard encoding names to Tcl ones
This is a essentially a copy of Paul Mackerras encoding support from
gitk.  I stole the code from gitk commit fd8ccbec4f, as Paul has
already done all of the hard work setting up this translation table.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-19 01:27:17 -04:00
Shawn O. Pearce
d36cd96837 git-gui: Avoid unnecessary global statements when possible
Running global takes slightly longer than just accessing the variable
via its package name, especially if the variable is just only once in
the procedure, or isn't even used at all in the procedure.  So this is
a minor cleanup for some of our commonly invoked procedures.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-19 00:43:16 -04:00
Shawn O. Pearce
a870ddc099 git-gui: Bind Ctrl/Cmd-M to merge action
Users who merge often may want to access the merge action quickly,
so we now bind M to the merge action.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-19 00:39:23 -04:00