Commit Graph

11222 Commits

Author SHA1 Message Date
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
Junio C Hamano
f48a203a56 GIT 1.5.3-rc3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-25 00:06:53 -07:00
Alexandre Julliard
ceefa44fe2 git.el: Pass an explicit argument to enable smerge-mode.
Without argument the mode is toggled, which would do the wrong thing
if the file was already open.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-25 00:06:38 -07:00
Jim Meyering
1c911dc86c pretty-options.txt: tiny doc fix
Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-25 00:06:38 -07:00
Junio C Hamano
c4eaed49c2 t9200: Be careful when checking CVS/Entries
CVS/Entries file can contain a line with single D to say "this
directory does not have any subdirectories".  Do not get
confused with such an entry.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-25 00:06:38 -07:00
Johannes Schindelin
ca193cf1ad git am: skip pine's internal folder data
Test if the From: line contains "Mail System Internal Data" and if
it is, skip this mail.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-24 20:48:04 -07:00
Steven Grimm
d1cc130a5e Teach git-commit about commit message templates.
These are useful in organizations that enforce particular formats
for commit messages, e.g., to specify bug IDs or test plans.
Use of the template is not enforced; it is simply used as the
initial content when the editor is invoked.

Signed-off-by: Steven Grimm <koreth@midwinter.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-24 20:46:54 -07:00
Johannes Schindelin
af66366a9f Teach approxidate() to understand "never"
If you want to keep the reflogs around for a really long time, you should be
able to say so:

	$ git config gc.reflogExpire never

Now it works, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-24 17:28:10 -07:00
Johannes Schindelin
7b69b873fa git log -g: Complain, but do not fail, when no reflogs are there
When asking "git log -g --all", clearly you want to see only those refs
that do have reflogs, but you do not want it to fail, either.

So instead of die()ing, complain about it, but move on to the other refs.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-24 17:28:10 -07:00
Kumar Gala
2d8ae400d1 send-email: Update regex parsing for pine aliases
The pine address book format is tab seperated and the first field
is the nickname/alias and the third field is the email address as
per:

http://www.washington.edu/pine/tech-notes/low-level.html

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-24 17:28:10 -07:00
Robin Rosenberg
f836f1ae9b cvsexportcommit: avoid racy CVS problem.
If git cvsexportcommit is executed fast enough in sequence, the CVS
timestamps could end up being the same. CVS tries to fix this
by sleeping until the CPU clock changes seconds. Unfortunately,
the CPU clock and the file system clock are not necessarily the same, so
the timestamps could be the same anyway. When that happens CVS may not
recognize changed files and cvs will forget to commit some files.

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-24 17:28:10 -07:00
René Scharfe
1843d8d545 cleanup unpack-trees.c: shrink struct tree_entry_list
Remove the two write-only fields executable and symlink from struct
tree_entry_list.  Also replace usage of the field directory with
S_ISDIR checks on the mode field, and then remove this now obsolete
field, too.  Noticed by David Kastrup.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-24 17:28:10 -07:00
René Scharfe
24d0063494 filter-branch: fix dash complaining about "Missing '))'"
On e.g. Ubuntu, dash is used as /bin/sh.  Unlike bash it parses
commands like

  a=$((echo stuff) | wc)

as an arithmetic expression while what we want is a subshell inside
a command substitution.  Resolve the ambiguity by placing a space
between the two opening parentheses.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-24 17:28:10 -07:00
Jakub Narebski
3473e7df5f gitweb: More detailed error messages for snapshot format
Improve error messages for snapshot format in git_snapshot:
distinguish between situation where snapshots are turned off, where
snapshot format ('sf') parameter is invalid, where given snapshot
format does not exist in %known_snapshot_formats hash, and where
gitweb was given unsupported snapshot format.

While at it, use first from all supported snapshots format as default,
if no snapshot format was provided.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-24 17:26:04 -07:00
Alexandre Julliard
93c22eeb30 git.el: Support for incremental status updates.
When we know which files have been modified, we can now run diff-index
or ls-files with a file list to refresh only the specified files
instead of the whole project.

This also allows proper refreshing of files upon add/delete/resolve,
instead of making assumptions about the new file state.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-24 03:16:26 -07:00
Junio C Hamano
1130845be8 user-manual: fix typolets.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-24 01:58:56 -07:00
Junio C Hamano
1cffddd654 Mark user-manual as UTF-8
There have been several complaints against k.org's user-manual
page.  The document is generated in ISO-8859-1 by the xsltproc
toolchain (I suspect this is because released docbook.xsl we use
has xsl:output element that says the output is ISO-8859-1) but
server delivers it with "charset=UTF-8", and all h*ll breaks
loose.

This attempts to force UTF-8 on the generating end.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-24 00:47:05 -07:00
Johannes Schindelin
8e64006eee Teach revision machinery about --no-walk
The flag "no_walk" is present in struct rev_info since a long time, but
so far has been in use exclusively by "git show".

With this flag, you can see all your refs, ordered by date of the last
commit:

$ git log --abbrev-commit --pretty=oneline --decorate --all --no-walk

which is extremely helpful if you have to juggle with a lot topic
branches, and do not remember in which one you introduced that uber
debug option, or simply want to get an overview what is cooking.

(Note that the "git log" invocation above does not output the same as

 $ git show --abbrev-commit --pretty=oneline --decorate --all --quiet

 since "git show" keeps the alphabetic order that "--all" returns the
 refs in, even if the option "--date-order" was passed.)

For good measure, this also adds the "--do-walk" option which overrides
"--no-walk".

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-23 23:57:50 -07:00
Johannes Schindelin
dfd05e38f0 filter-branch: Big syntax change; support rewriting multiple refs
We used to take the first non-option argument as the name for the new
branch.  This syntax is not extensible to support rewriting more than just
HEAD.

Instead, we now have the following syntax:

	git filter-branch [<filter options>...] [<rev-list options>]

All positive refs given in <rev-list options> are rewritten.  Yes,
in-place.  If a ref was changed, the original head is stored in
refs/original/$ref now, for your inspecting pleasure, in addition to the
reflogs (since it is easier to inspect "git show-ref | grep original" than
to inspect all the reflogs).

This commit also adds the --force option to remove .git-rewrite/ and all
refs from refs/original/ before filtering.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-23 23:15:09 -07:00
Johannes Schindelin
3b38ec16d5 rebase -i: exchange all "if [ .. ]" by "if test .."
This patch is literally

:%s/if \[ *\(.*[^ ]\) *\]/if test \1/

in vi, after making sure that the other instances of "[..]" are not
actually invocations of "test".

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-23 23:06:12 -07:00
Johannes Schindelin
dfa49f3348 Shut "git rebase -i" up when no --verbose was given
Up to now, git rebase -i was quite chatty, showing through all the
nice core programs it called.

Now it only shows a progress meter by default.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-23 23:04:15 -07:00
Johannes Schindelin
7296096c9d mailinfo: fix 'fatal: cannot convert from utf-8 to utf-8'
For some reason, I got this error message.  Maybe it does not make sense,
but then we should not really try to convert the text when it is not
necessary.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-23 22:38:50 -07:00
Paul Mackerras
0eafba1405 gitk: Wait for the window to become visible after creating it
When the git log process returned an error immediately, we were
sometimes getting no main window and no error window displayed,
with the gitk process just hanging waiting for something.  It appears
that the tkwait in show_error, which waits for the error window to
be destroyed, wasn't sufficient to allow the main window or the error
window to be mapped.

This adds a wait in the main startup code after the main window
has been created to wait until it is visible.  This seems to fix the
problem.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-07-23 21:35:03 +10: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
Jakub Narebski
a781785d8f gitweb: Fix support for legacy gitweb config for snapshots
Earlier commit which cleaned up snapshot support and introduced
support for multiple snapshot formats changed the format of
$feature{'snapshot'}{'default'} (gitweb configuration) and
gitweb.snapshot configuration variable (repository configuration).
It supported old gitweb.snapshot values of 'gzip', 'bzip2' and 'zip'
and tried to support, but failed to do that, old values of
$feature{'snapshot'}{'default'}; at least those corresponding to
old gitweb.snapshot values of 'gzip', 'bzip2' and 'zip', i.e.
  ['x-gzip', 'gz', 'gzip']
  ['x-bzip2', 'bz2', 'bzip2']
  ['x-zip', 'zip', '']

This commit moves legacy configuration support out of feature_snapshot
subroutine to separate filter_snapshot_fmts subroutine. The
filter_snapshot_fmts is used on result on result of
gitweb_check_feature('snapshot').  This way feature_snapshot deals
_only_ with repository config.

As a byproduct you can now use 'gzip' and 'bzip2' as aliases to 'tgz'
and 'tbz2' also in $feature{'snapshot'}{'default'}, not only in
gitweb.snapshot.

While at it do some whitespace cleanup: use tabs for indent, but
spaces for align.

Noticed-by: Matt McCutchen <hashproduct@gmail.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Tested-by: Matt McCutchen <hashproduct@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-22 16:35:50 -07:00
Johannes Schindelin
16a7fcfe5e fsck --lost-found: write blob's contents, not their SHA-1
When looking for a lost blob, it is much nicer to be able to grep
through .git/lost-found/other/* than to write an inefficient loop
over the file names.  So write the contents of the dangling blobs,
not their object names.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-22 15:59:27 -07:00
Shawn O. Pearce
d23d98d3ba [PATCH] gitk: Bind keyboard actions to the command key on Mac OS
git-gui already uses the command key for accelerators, but gitk has
never done so.  I'm actually finding it very hard to move back and
forth between the two applications as git-gui is following the Mac
OS X conventions and gitk is not.

This trick is the same one that git-gui uses to determine which
key to bind actions to.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-07-22 22:25:46 +10:00
Mark Levedahl
86da5b6c97 [PATCH] gitk: Ignore ctrl-z as EOF on windows
Cygwin's Tcl is configured to honor any occurence of ctrl-z as an
end-of-file marker, while some commits in the git repository and possibly
elsewhere include that character in the commit comment. This causes gitk
ignore commit history following such a comment and incorrect graphs. This
change affects only Windows as Tcl on other platforms already has
eofchar == {}. This fixes problems noted by me and by Ray Lehtiniemi, and
the fix was suggested by Shawn Pierce.

Signed-off-by: Mark Levedahl <mdl123@verizon.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-07-22 22:25:46 +10:00
Paul Mackerras
ef3192b834 gitk: Make the fake commit for the index changes green rather than magenta
The magenta was a bit close in color to the normal blue commits.  This
makes them green instead as suggested by Linus.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-07-22 22:05:30 +10:00
Marco Costalba
c4640fe8d9 Avoid to duplicate commit message when is not encoded
When a commit message doesn't have encoding information
and encoding output is utf-8 (default) then an useless
xstrdup() of commit message is done.

If we assume most of users live in an utf-8 world, this
useless copy is the common case.

Performance issue found with KCachegrind.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-22 01:40:21 -07:00
Junio C Hamano
e5633cbb85 Synonyms: -i == --regexp-ignore-case, -E == --extended-regexp
These options to log family were too long to type.  Give them
shorter synonyms.

Fix the parsing of the long options while at it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-22 01:38:26 -07: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
David Kastrup
98ec4ad7f9 Documentation/gitignore.txt: Fix the seriously misleading priority explanation
Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-21 23:04:20 -07:00
Junio C Hamano
a644ffde0a Fix VISUAL/EDITOR preference order in Documentation/config.txt.
I screwed up when amending ef0c2abf.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-21 22:37:56 -07:00
Matt McCutchen
a3c8ab30a5 gitweb: snapshot cleanups & support for offering multiple formats
- Centralize knowledge about snapshot formats (mime types, extensions,
  commands) in %known_snapshot_formats and improve how some of that
  information is specified.  In particular, zip files are no longer a
  special case.

- Add support for offering multiple snapshot formats to the user so
  that he/she can download a snapshot in the format he/she prefers.
  The site-wide or project configuration now gives a list of formats
  to offer, and if more than one format is offered, the "_snapshot_"
  link becomes something like "snapshot (_tar.bz2_ _zip_)".

- If only one format is offered, a tooltip on the "_snapshot_" link
  tells the user what it is.

- Fix out-of-date "tarball" -> "archive" in comment.

Alert for gitweb site administrators: This patch changes the format of
$feature{'snapshot'}{'default'} in gitweb_config.perl from a list of
three pieces of information about a single format to a list of one or
more formats you wish to offer from the set ('tgz', 'tbz2', 'zip').
Update your gitweb_config.perl appropriately.  There was taken care
for old-style gitweb configuration to work as it used to, but this
backward compatibility works only for the values which correspond to
gitweb.snapshot values of 'gzip', 'bzip2' and 'zip', i.e.
  ['x-gzip', 'gz', 'gzip']
  ['x-bzip2', 'bz2', 'bzip2']
  ['x-zip', 'zip', '']

The preferred names for gitweb.snapshot in repository configuration
have also changed from 'gzip' and 'bzip2' to 'tgz' and 'tbz2', but
the old names are still recognized for compatibility.

Signed-off-by: Matt McCutchen <hashproduct@gmail.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-21 22:29:28 -07:00
Carlos Rica
e317cfafd2 builtin-tag.c: Fix two memory leaks and minor notation changes.
A repeated call to read_sha1_file was not freing memory
when the buffer was allocated but returned size was zero.

Also, now the program does not allow many -F or -m options,
which was a bug too because it was not freing the memory
allocated for any previous -F or -m options.

Tests are provided for ensuring that only one option
-F or -m is given. Also, another test is shipped here,
to check that "git tag" fails when a non-existing file
is passed to the -F option, something that git-tag.sh
allowed creating the tag with an empty message.

Signed-off-by: Carlos Rica <jasampler@gmail.com>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-21 16:59:33 -07:00
Johannes Schindelin
4d87b9c5db launch_editor(): Heed GIT_EDITOR and core.editor settings
In the commit 'Add GIT_EDITOR environment and core.editor
configuration variables', this was done for the shell scripts.
Port it over to builtin-tag's version of launch_editor(), which
is just about to be refactored into editor.c.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-21 16:51:14 -07:00
Johannes Schindelin
6368f3f8e7 rebase -i: call editor just once for a multi-squash
Sometimes you want to squash more than two commits.  Before this patch,
the editor was fired up for each squash command.  Now the editor is
started only with the last squash command.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-21 16:04:13 -07: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
Linus Torvalds
e1abc69b72 Fix up duplicate parents removal
This removes duplicate parents properly, making gitk happy again.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-20 23:36:39 -07:00