Code

git.git
15 years agoMerge branch 'mv/clone-strbuf'
Junio C Hamano [Fri, 28 Nov 2008 03:24:25 +0000 (19:24 -0800)]
Merge branch 'mv/clone-strbuf'

* mv/clone-strbuf:
  builtin_clone: use strbuf in cmd_clone()
  builtin-clone: use strbuf in clone_local() and copy_or_link_directory()
  builtin-clone: use strbuf in guess_dir_name()

15 years agoMerge branch 'lt/preload-lstat'
Junio C Hamano [Fri, 28 Nov 2008 03:24:13 +0000 (19:24 -0800)]
Merge branch 'lt/preload-lstat'

* lt/preload-lstat:
  Fix index preloading for racy dirty case
  Add cache preload facility

15 years agoMerge branch 'ta/quiet-pull'
Junio C Hamano [Fri, 28 Nov 2008 03:24:11 +0000 (19:24 -0800)]
Merge branch 'ta/quiet-pull'

* ta/quiet-pull:
  Retain multiple -q/-v occurrences in git pull
  Teach/Fix pull/fetch -q/-v options

15 years agoMerge branch 'ph/send-email'
Junio C Hamano [Fri, 28 Nov 2008 03:24:00 +0000 (19:24 -0800)]
Merge branch 'ph/send-email'

* ph/send-email:
  git send-email: ask less questions when --compose is used.
  git send-email: add --annotate option
  git send-email: interpret unknown files as revision lists
  git send-email: make the message file name more specific.

15 years agoMerge branch 'maint'
Junio C Hamano [Fri, 28 Nov 2008 03:23:51 +0000 (19:23 -0800)]
Merge branch 'maint'

* maint:
  sha1_file.c: resolve confusion EACCES vs EPERM
  sha1_file: avoid bogus "file exists" error message
  git checkout: don't warn about unborn branch if -f is already passed
  bash: offer refs instead of filenames for 'git revert'
  bash: remove dashed command leftovers
  git-p4: fix keyword-expansion regex
  fast-export: use an unsorted string list for extra_refs
  Add new testcase to show fast-export does not always exports all tags

15 years agoMerge branch 'mv/fast-export' into maint
Junio C Hamano [Fri, 28 Nov 2008 03:23:27 +0000 (19:23 -0800)]
Merge branch 'mv/fast-export' into maint

* mv/fast-export:
  fast-export: use an unsorted string list for extra_refs
  Add new testcase to show fast-export does not always exports all tags

15 years agosha1_file.c: resolve confusion EACCES vs EPERM
Sam Vilain [Fri, 14 Nov 2008 07:19:34 +0000 (20:19 +1300)]
sha1_file.c: resolve confusion EACCES vs EPERM

An earlier commit 916d081 (Nicer error messages in case saving an object
to db goes wrong, 2006-11-09) confused EACCES with EPERM, the latter of
which is an unlikely error from mkstemp().

Signed-off-by: Sam Vilain <sam@vilain.net>
15 years agosha1_file: avoid bogus "file exists" error message
Joey Hess [Thu, 20 Nov 2008 18:56:28 +0000 (13:56 -0500)]
sha1_file: avoid bogus "file exists" error message

This avoids the following misleading error message:

error: unable to create temporary sha1 filename ./objects/15: File exists

mkstemp can fail for many reasons, one of which, ENOENT, can occur if
the directory for the temp file doesn't exist. create_tmpfile tried to
handle this case by always trying to mkdir the directory, even if it
already existed. This caused errno to be clobbered, so one cannot tell
why mkstemp really failed, and it truncated the buffer to just the
directory name, resulting in the strange error message shown above.

Note that in both occasions that I've seen this failure, it has not been
due to a missing directory, or bad permissions, but some other, unknown
mkstemp failure mode that did not occur when I ran git again. This code
could perhaps be made more robust by retrying mkstemp, in case it was a
transient failure.

Signed-off-by: Joey Hess <joey@kitenet.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit checkout: don't warn about unborn branch if -f is already passed
Matt McCutchen [Mon, 24 Nov 2008 06:55:22 +0000 (01:55 -0500)]
git checkout: don't warn about unborn branch if -f is already passed

I think it's unnecessary to warn that the checkout has been forced due to an
unborn current branch if -f has been explicitly passed.  For one project, I am
using git-new-workdir to create workdirs from a bare repository whose HEAD is
set to an unborn branch, and this warning started to irritate me.

Signed-off-by: Matt McCutchen <matt@mattmccutchen.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobash: offer refs instead of filenames for 'git revert'
SZEDER Gábor [Thu, 27 Nov 2008 13:35:53 +0000 (14:35 +0100)]
bash: offer refs instead of filenames for 'git revert'

The completion script for 'git revert' currently offers options and
filenames.  However, 'git revert' doesn't take any filenames from the
command line, but a single commit.  Therefore, it's more sane to offer
refs instead.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobash: complete full refs
SZEDER Gábor [Fri, 28 Nov 2008 00:46:38 +0000 (01:46 +0100)]
bash: complete full refs

Sometimes it's handy to complete full refs, e.g. the user has some
refs outside of refs/{heads,remotes,tags} or the user wants to
complete some git command's special refs (like 'git show
refs/bisect/bad').

To do that, we check whether the ref to be completed starts with
'refs/' or is 'refs' (to reduce the risk of matching 'refs-').  If it
does, then we offer full refs for completion; otherwise everything
works as usual.

This way the impact on the common case is fairly small (hopefully not
many users have branches or tags starting with 'refs'), and in the
special case the cost of typing out 'refs' is bearable.

While at it, also remove the unused 'cmd' variable from '__git_refs'.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobash: remove dashed command leftovers
SZEDER Gábor [Thu, 27 Nov 2008 13:35:38 +0000 (14:35 +0100)]
bash: remove dashed command leftovers

Commit 5a625b07 (bash: remove fetch, push, pull dashed form leftovers,
2008-10-03) did that already, but there were still some git-cmd left
here and there.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'pw/maint-p4' into maint
Junio C Hamano [Thu, 27 Nov 2008 21:18:25 +0000 (13:18 -0800)]
Merge branch 'pw/maint-p4' into maint

* pw/maint-p4:
  git-p4: fix keyword-expansion regex

15 years agogit-p4: fix keyword-expansion regex
Pete Wyckoff [Wed, 26 Nov 2008 18:52:15 +0000 (13:52 -0500)]
git-p4: fix keyword-expansion regex

This text:

     my $dir = $File::Find::dir;
     return if ($dir !~ m,$options->{dirpat}$,);

was improperly converted to:

     my $dir = $File$dir !~ m,$options->{dirpat}$,);

by the keyword identifier expansion code.  Add a \n
to make sure the regex doesn't go across end-of-line
boundaries.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Acked-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoFix typos in the documentation.
Ralf Wildenhues [Thu, 27 Nov 2008 07:32:01 +0000 (08:32 +0100)]
Fix typos in the documentation.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'rw/maint-typofix' into rw/typofix
Junio C Hamano [Thu, 27 Nov 2008 09:17:09 +0000 (01:17 -0800)]
Merge branch 'rw/maint-typofix' into rw/typofix

* rw/maint-typofix:
  Fix typos in the documentation.

15 years agoFix typos in the documentation.
Ralf Wildenhues [Thu, 27 Nov 2008 07:32:01 +0000 (08:32 +0100)]
Fix typos in the documentation.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Wed, 26 Nov 2008 19:57:31 +0000 (11:57 -0800)]
Merge branch 'maint'

* maint:
  Teach "git diff" to honour --[no-]ext-diff

15 years agoMerge branch 'mm/sort-config-doc'
Junio C Hamano [Wed, 26 Nov 2008 19:57:28 +0000 (11:57 -0800)]
Merge branch 'mm/sort-config-doc'

* mm/sort-config-doc:
  config.txt: alphabetize configuration sections

15 years agoMerge branch 'mm/maint-sort-config-doc' into maint
Junio C Hamano [Wed, 26 Nov 2008 19:57:15 +0000 (11:57 -0800)]
Merge branch 'mm/maint-sort-config-doc' into maint

* mm/maint-sort-config-doc:
  config.txt: alphabetize configuration sections

15 years agoMerge branch 'mm/maint-sort-config-doc' into mm/sort-config-doc
Junio C Hamano [Wed, 26 Nov 2008 19:11:18 +0000 (11:11 -0800)]
Merge branch 'mm/maint-sort-config-doc' into mm/sort-config-doc

* mm/maint-sort-config-doc:
  config.txt: alphabetize configuration sections

Conflicts:
Documentation/config.txt

15 years agoconfig.txt: alphabetize configuration sections
Matt McCutchen [Wed, 26 Nov 2008 08:26:50 +0000 (03:26 -0500)]
config.txt: alphabetize configuration sections

I figured the sections might as well be in some order, so I chose alphabetical
but with "core" at the beginning.  This should help people add new variables
in the right places.

Signed-off-by: Matt McCutchen <matt@mattmccutchen.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoxdiff-interface.c: remove 10 duplicated lines
Jim Meyering [Wed, 26 Nov 2008 13:27:10 +0000 (14:27 +0100)]
xdiff-interface.c: remove 10 duplicated lines

Remove an accidentally duplicated sequence of 10 lines.
This happens to plug a leak, too.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot9129-git-svn-i18n-commitencoding: Make compare_svn_head_with() compatible with OSX sed
Marcel Koeppen [Wed, 26 Nov 2008 16:51:01 +0000 (17:51 +0100)]
t9129-git-svn-i18n-commitencoding: Make compare_svn_head_with() compatible with OSX sed

The sed call used in compare_svn_head_with() uses the + quantifier, which
is not supported in the OSX version of sed. It is replaced by the
equivalent \{1,\}.

Signed-off-by: Marcel Koeppen <git-dev@marzelpan.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoTeach "git diff" to honour --[no-]ext-diff
Junio C Hamano [Wed, 26 Nov 2008 17:58:41 +0000 (09:58 -0800)]
Teach "git diff" to honour --[no-]ext-diff

The original intention of 72909be (Add diff-option --ext-diff, 2007-06-30)
was to optionally allow the use of external diff viewer in "git log"
family (while keeping them disabled by default).  It exposed the "allow
external diff" bit to the UI, but forgot to adjust the "git diff" codepath
that was set up to always allow use of the external diff viewer.

Noticed by Nazri Ramliy; tests by René Scharfe squashed in.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agosend-email: Fix Pine address book parsing
Trent Piepho [Wed, 26 Nov 2008 02:55:00 +0000 (18:55 -0800)]
send-email: Fix Pine address book parsing

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

Entries with a fcc or comment field after the address weren't parsed
correctly.

Continuation lines, identified by leading spaces, were also not handled.

Distribution lists which had ( ) around a list of addresses did not have
the parenthesis removed.

Signed-off-by: Trent Piepho <tpiepho@freescale.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'for-junio' of git://source.winehq.org/~julliard/git/git
Junio C Hamano [Wed, 26 Nov 2008 05:52:28 +0000 (21:52 -0800)]
Merge branch 'for-junio' of git://source.winehq.org/~julliard/git/git

* 'for-junio' of git://source.winehq.org/~julliard/git/git:
  git.el: Allow to commit even if there are no marked files.
  git.el: Add possibility to mark files directly in git-update-status-files.
  git.el: Add an insert file command.
  git.el: Never clear the status buffer, only update the files.
  git.el: Fix git-amend-commit to support amending an initial commit.
  git.el: Properly handle merge commits in git-amend-commit.
  git.el: Simplify handling of merge heads in the commit log-edit buffer.
  git.el: Remove the env parameter in git-call-process and git-call-process-string.
  git.el: Improve error handling for commits.

15 years agobuiltin_clone: use strbuf in cmd_clone()
Miklos Vajna [Fri, 21 Nov 2008 00:45:01 +0000 (01:45 +0100)]
builtin_clone: use strbuf in cmd_clone()

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobuiltin-clone: use strbuf in clone_local() and copy_or_link_directory()
Miklos Vajna [Fri, 21 Nov 2008 00:45:00 +0000 (01:45 +0100)]
builtin-clone: use strbuf in clone_local() and copy_or_link_directory()

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobuiltin-clone: use strbuf in guess_dir_name()
Miklos Vajna [Fri, 21 Nov 2008 00:44:59 +0000 (01:44 +0100)]
builtin-clone: use strbuf in guess_dir_name()

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint'
Junio C Hamano [Mon, 24 Nov 2008 04:36:54 +0000 (20:36 -0800)]
Merge branch 'maint'

* maint:
  Fix misleading wording for git-cherry-pick

16 years agofast-export: use an unsorted string list for extra_refs
Johannes Schindelin [Sun, 23 Nov 2008 11:55:54 +0000 (12:55 +0100)]
fast-export: use an unsorted string list for extra_refs

The list extra_refs contains tags and the objects referenced by them,
so that they can be handled at the end.  When a tag references a
commit, that commit is added to the list using the same name.

Also, the function handle_tags_and_duplicates() relies on the order
the items were added to extra_refs, so clearly we do not want to
use a sorted list here.

Noticed by Miklos Vajna.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Tested-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd new testcase to show fast-export does not always exports all tags
Miklos Vajna [Sat, 22 Nov 2008 18:22:48 +0000 (19:22 +0100)]
Add new testcase to show fast-export does not always exports all tags

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agosha1_file: avoid bogus "file exists" error message
Joey Hess [Thu, 20 Nov 2008 18:56:28 +0000 (13:56 -0500)]
sha1_file: avoid bogus "file exists" error message

This avoids the following misleading error message:

error: unable to create temporary sha1 filename ./objects/15: File exists

mkstemp can fail for many reasons, one of which, ENOENT, can occur if
the directory for the temp file doesn't exist. create_tmpfile tried to
handle this case by always trying to mkdir the directory, even if it
already existed. This caused errno to be clobbered, so one cannot tell
why mkstemp really failed, and it truncated the buffer to just the
directory name, resulting in the strange error message shown above.

Note that in both occasions that I've seen this failure, it has not been
due to a missing directory, or bad permissions, but some other, unknown
mkstemp failure mode that did not occur when I ran git again. This code
could perhaps be made more robust by retrying mkstemp, in case it was a
transient failure.

Signed-off-by: Joey Hess <joey@kitenet.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix misleading wording for git-cherry-pick
Bryan Drewery [Thu, 20 Nov 2008 05:11:42 +0000 (23:11 -0600)]
Fix misleading wording for git-cherry-pick

Documentation for -n implies that -x is normally
used, however this is no longer true.

Signed-off-by: Bryan Drewery <bryan@shatow.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix t4030-diff-textconv.sh
Alex Riesen [Wed, 19 Nov 2008 11:14:50 +0000 (12:14 +0100)]
Fix t4030-diff-textconv.sh

Avoid passing cygwin pathnames to Perl. Some Perls have problems using them

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix handle leak in sha1_file/unpack_objects if there were damaged object data
Alex Riesen [Wed, 19 Nov 2008 11:14:05 +0000 (12:14 +0100)]
Fix handle leak in sha1_file/unpack_objects if there were damaged object data

In the case of bad packed object CRC, unuse_pack wasn't called after
check_pack_crc which calls use_pack.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Acked-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit.el: Allow to commit even if there are no marked files.
Alexandre Julliard [Fri, 7 Nov 2008 13:28:09 +0000 (14:28 +0100)]
git.el: Allow to commit even if there are no marked files.

This can be useful to commit a merge that didn't result in any
changes.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
16 years agogit.el: Add possibility to mark files directly in git-update-status-files.
Alexandre Julliard [Sat, 1 Nov 2008 19:14:10 +0000 (20:14 +0100)]
git.el: Add possibility to mark files directly in git-update-status-files.

This avoids the need to go through the list twice, which helps
performance on large file lists.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
16 years agogit.el: Add an insert file command.
Alexandre Julliard [Mon, 4 Aug 2008 07:30:42 +0000 (09:30 +0200)]
git.el: Add an insert file command.

This allows to insert a file in the buffer no matter what its state
is, making it possible for instance to remove an up-to-date file.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
16 years agogit.el: Never clear the status buffer, only update the files.
Alexandre Julliard [Sat, 2 Aug 2008 18:35:52 +0000 (20:35 +0200)]
git.el: Never clear the status buffer, only update the files.

This makes it unnecessary to save/restore the file marks.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
16 years agogit.el: Fix git-amend-commit to support amending an initial commit.
Alexandre Julliard [Sat, 2 Aug 2008 18:35:20 +0000 (20:35 +0200)]
git.el: Fix git-amend-commit to support amending an initial commit.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
16 years agogit.el: Properly handle merge commits in git-amend-commit.
Alexandre Julliard [Sat, 2 Aug 2008 16:05:58 +0000 (18:05 +0200)]
git.el: Properly handle merge commits in git-amend-commit.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
16 years agogit.el: Simplify handling of merge heads in the commit log-edit buffer.
Alexandre Julliard [Sat, 2 Aug 2008 16:04:31 +0000 (18:04 +0200)]
git.el: Simplify handling of merge heads in the commit log-edit buffer.

Use a single Merge: header instead of one Parent: header for each
parent, and don't list the current HEAD as a merged head. Support
symbolic references too.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
16 years agogit.el: Remove the env parameter in git-call-process and git-call-process-string.
Alexandre Julliard [Sat, 1 Nov 2008 19:42:39 +0000 (20:42 +0100)]
git.el: Remove the env parameter in git-call-process and git-call-process-string.

All callers that need to change the environment now set
process-environment themselves.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
16 years agogit.el: Improve error handling for commits.
Alexandre Julliard [Sat, 1 Nov 2008 19:34:33 +0000 (20:34 +0100)]
git.el: Improve error handling for commits.

Display all errors happening in the various subcommands of the commit
sequence, and abort on any error.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
16 years agogit-commit.txt - mention that files listed on the command line must be known to git.
Mark Burton [Tue, 18 Nov 2008 22:33:44 +0000 (22:33 +0000)]
git-commit.txt - mention that files listed on the command line must be known to git.

Signed-off-by: Mark Burton <markb@ordern.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoRetain multiple -q/-v occurrences in git pull
Tuncer Ayaz [Mon, 17 Nov 2008 22:09:30 +0000 (23:09 +0100)]
Retain multiple -q/-v occurrences in git pull

To support counting -q/-v options in git pull retain
them by concatenating.

Signed-off-by: Tuncer Ayaz <tuncer.ayaz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation: rev-list-options.txt: added --branches, --tags & --remotes.
Mark Burton [Mon, 17 Nov 2008 21:03:59 +0000 (21:03 +0000)]
Documentation: rev-list-options.txt: added --branches, --tags & --remotes.

Added simple descriptions of these options (based on description of --all).

Signed-off-by: Mark Burton <markb@ordern.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-branch: use strbuf in rename_branch()
Miklos Vajna [Mon, 17 Nov 2008 20:48:37 +0000 (21:48 +0100)]
builtin-branch: use strbuf in rename_branch()

In case the length of branch name is greather then PATH_MAX-11, we write
to unallocated memory otherwise.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-branch: use strbuf in fill_tracking_info()
Miklos Vajna [Mon, 17 Nov 2008 20:48:36 +0000 (21:48 +0100)]
builtin-branch: use strbuf in fill_tracking_info()

This is just about using the API, though in case of ~ 10^100 commits,
this would fix the problem of writing to unallocated memory as well. ;-)

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-branch: use strbuf in delete_branches()
Miklos Vajna [Mon, 17 Nov 2008 20:48:35 +0000 (21:48 +0100)]
builtin-branch: use strbuf in delete_branches()

In case the length of branch name is greather then PATH_MAX-7, we write
to unallocated memory otherwise.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix index preloading for racy dirty case
Linus Torvalds [Mon, 17 Nov 2008 17:01:20 +0000 (09:01 -0800)]
Fix index preloading for racy dirty case

In the threaded index preloading case, we must be sure to always use the
CE_MATCH_RACY_IS_DIRTY flag when calling ie_match_stat(), in order to make
sure that we only ever look at the stat() data, and don't try to do
anything fancy.

Because most of git internals are not thread-safe, and must not be called
in parallel.

Otherwise, what happens is that if the timestamps indicate that an entry
_might_ be dirty, we might start actually comparing filesystem data with
the object database. And we mustn't do that, because that would involve
looking up and creating the object structure, and that whole code sequence
with read_sha1_file() where we look up and add objects to the hashes is
definitely not thread-safe.

Nor do we want to add locking, because the whole point of the preload was
to be simple and not affect anything else. With CE_MATCH_RACY_IS_DIRTY, we
get what we wanted, and we'll just leave the hard cases well alone, to be
done later in the much simpler serial case.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint'
Junio C Hamano [Mon, 17 Nov 2008 16:30:14 +0000 (08:30 -0800)]
Merge branch 'maint'

* maint:
  request-pull: make usage string match manpage

16 years agoDocumentation: tutorial: add information about "git help" at the beginning
Christian Couder [Mon, 17 Nov 2008 15:43:04 +0000 (16:43 +0100)]
Documentation: tutorial: add information about "git help" at the beginning

Talking about "git help" is useful because it has a few more
features (like when using it without arguments or with "-a") and
it may work on non unix like platforms.

Also add a few links to git-help(1) in "See also" sections.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation: user-manual: add information about "git help" at the beginning
Christian Couder [Mon, 17 Nov 2008 15:42:47 +0000 (16:42 +0100)]
Documentation: user-manual: add information about "git help" at the beginning

Talking about "git help" is useful because it has a few more
features (like when using it without arguments or with "-a") and
it may work on non unix like platforms.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-remote.c: plug a small memory leak in get_one_remote_for_updates()
Junio C Hamano [Mon, 17 Nov 2008 15:54:07 +0000 (07:54 -0800)]
builtin-remote.c: plug a small memory leak in get_one_remote_for_updates()

We know that the string pointed at by remote->name won't change.  It can
be borrowed as the key in the string_list without copying.  Other parts of
existing code such as get_one_entry() already rely on this fact.

Noticed by Cheng Renquan.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-remote: match usage string with the manual pages
Cheng Renquan [Mon, 17 Nov 2008 11:15:49 +0000 (19:15 +0800)]
git-remote: match usage string with the manual pages

Signed-off-by: Cheng Renquan <crquan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agorequest-pull: make usage string match manpage
Stefan Naewe [Mon, 17 Nov 2008 08:57:19 +0000 (09:57 +0100)]
request-pull: make usage string match manpage

The usage string of 'git request-pull' differs from he manpage
which gives the correct 'synopsis'.

Signed-off-by: Stefan Naewe <stefan.naewe@atlas-elektronik.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge git://repo.or.cz/git-gui
Junio C Hamano [Sun, 16 Nov 2008 23:51:11 +0000 (15:51 -0800)]
Merge git://repo.or.cz/git-gui

* git://repo.or.cz/git-gui:
  git-gui: Fix the search bar destruction handler.
  Update the po template
  git-gui: Implement automatic rescan after Tool execution.
  git-gui: Allow Tools request arguments from the user.
  git-gui: Add a Tools menu for arbitrary commands.
  git-gui: Fix the after callback execution in rescan.
  git-gui: Implement system-wide configuration handling.
  git-gui: try to provide a window icon under X

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 agoMerge branch 'maint'
Junio C Hamano [Sun, 16 Nov 2008 08:49:20 +0000 (00:49 -0800)]
Merge branch 'maint'

* maint:
  Teach ls-files --with-tree=<tree> to work with options other than -c
  builtin-ls-files.c: coding style fix.

16 years agoMerge branch 'bc/maint-keep-pack'
Junio C Hamano [Sun, 16 Nov 2008 08:49:02 +0000 (00:49 -0800)]
Merge branch 'bc/maint-keep-pack'

* bc/maint-keep-pack:
  repack: only unpack-unreachable if we are deleting redundant packs

16 years agoMerge branch 'jk/commit-v-strip'
Junio C Hamano [Sun, 16 Nov 2008 08:48:59 +0000 (00:48 -0800)]
Merge branch 'jk/commit-v-strip'

* jk/commit-v-strip:
  status: show "-v" diff even for initial commit
  wt-status: refactor initial commit printing
  define empty tree sha1 as a macro

16 years agoFix machine-parseability of 'git log --source'
Linus Torvalds [Sat, 15 Nov 2008 18:02:01 +0000 (10:02 -0800)]
Fix machine-parseability of 'git log --source'

The space between the commit and the source attribute is not easily
machine-parseable: if we combine --source with --parents and give a SHA1
as a starting point, it's unnecessarily hard to see where the list of
parents ends and the source decoration begins.

Example:
git show --parents --source $(git rev-list HEAD)

which is admittedly contrived, but can easily happen in scripting.

So use a <tab> instead of a space as the source separator.

The other decorations didn't have this issue, because they were surrounded
by parenthesis, so it's obvious that they aren't parent SHA1's.

It so happens that _visually_ this makes no difference for "git log
--source", since "commit <40-char SHA1>" is 47 characters, so both a space
and a <tab> will end up showing as a single commit. Of course, with
'--pretty=oneline' or '--parents' or '--abbrev-commit' you'll see the
difference.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoTeach ls-files --with-tree=<tree> to work with options other than -c
Junio C Hamano [Sun, 16 Nov 2008 08:10:25 +0000 (00:10 -0800)]
Teach ls-files --with-tree=<tree> to work with options other than -c

Originally --with-tree=<tree> was designed for the sole purpose of
checking if a given pathspec makes sense as a parameter to git-commit
using it in conjunction with --error-unmatch.  It had logic to avoid
showing the same entry (one came from the original index, another from the
overlayed tree) twice so that it works with -c (i.e. "show-cached"), but
otherwise it was not designed to work with the flags such as -m, -d, etc.

This teaches the same logic to cover the codepath for -m and -d.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-ls-files.c: coding style fix.
Junio C Hamano [Sun, 16 Nov 2008 08:15:43 +0000 (00:15 -0800)]
builtin-ls-files.c: coding style fix.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint'
Junio C Hamano [Sat, 15 Nov 2008 06:12:38 +0000 (22:12 -0800)]
Merge branch 'maint'

* maint:
  Documentation: git-svn: fix example for centralized SVN clone
  Documentation: fix links to "everyday.html"
  revision.c: use proper data type in call to sizeof() within xrealloc

16 years agoDocumentation: git-svn: fix example for centralized SVN clone
Jan Krüger [Fri, 14 Nov 2008 17:45:14 +0000 (18:45 +0100)]
Documentation: git-svn: fix example for centralized SVN clone

The example that tells users how to centralize the effort of the initial
git svn clone operation doesn't work properly. It uses rebase but that
only works if HEAD exists. This adds one extra command to create a
somewhat sensible HEAD that should work in all cases.

Signed-off-by: Jan Krüger <jk@jk.gs>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation: fix links to "everyday.html"
Christian Couder [Fri, 14 Nov 2008 12:26:47 +0000 (13:26 +0100)]
Documentation: fix links to "everyday.html"

In some places the links are wrong. They should be:
"link:everyday.html", instead of: "linkgit:everyday[7]".
This patch fixes that.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agorevision.c: use proper data type in call to sizeof() within xrealloc
Brandon Casey [Thu, 13 Nov 2008 20:20:37 +0000 (14:20 -0600)]
revision.c: use proper data type in call to sizeof() within xrealloc

A type char** was being used instead of char*.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agorepack: only unpack-unreachable if we are deleting redundant packs
Brandon Casey [Thu, 13 Nov 2008 20:11:46 +0000 (14:11 -0600)]
repack: only unpack-unreachable if we are deleting redundant packs

The -A option calls pack-objects with the --unpack-unreachable option so
that the unreachable objects in local packs are left in the local object
store loose. But if the -d option to repack was _not_ used, then these
unpacked loose objects are redundant and unnecessary.

Update tests in t7701.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation: New GUI configuration and command-line options.
Alexander Gavrilov [Thu, 13 Nov 2008 17:28:49 +0000 (20:28 +0300)]
Documentation: New GUI configuration and command-line options.

Add information on new git-gui and gitk command-line options,
configuration variables, and the encoding attribute.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd cache preload facility
Linus Torvalds [Fri, 14 Nov 2008 00:36:30 +0000 (16:36 -0800)]
Add cache preload facility

This can do the lstat() storm in parallel, giving potentially much
improved performance for cold-cache cases or things like NFS that have
weak metadata caching.

Just use "read_cache_preload()" instead of "read_cache()" to force an
optimistic preload of the index stat data.  The function takes a
pathspec as its argument, allowing us to preload only the relevant
portion of the index.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoTeach/Fix pull/fetch -q/-v options
Tuncer Ayaz [Sat, 15 Nov 2008 00:14:24 +0000 (01:14 +0100)]
Teach/Fix pull/fetch -q/-v options

Implement git-pull --quiet and git-pull --verbose by
adding the options to git-pull and fixing verbosity
handling in git-fetch.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge git://git.bogomips.org/git-svn
Junio C Hamano [Fri, 14 Nov 2008 17:21:08 +0000 (09:21 -0800)]
Merge git://git.bogomips.org/git-svn

* git://git.bogomips.org/git-svn:
  git-svn: Update git-svn to use the ability to place temporary files within repository directory
  Git.pm: Make _temp_cache use the repository directory
  git-svn: proper detection of bare repositories
  git-svn: respect i18n.commitencoding config
  git-svn: don't escape tilde ('~') for http(s) URLs

16 years agogit-svn: Update git-svn to use the ability to place temporary files within repository...
Marten Svanfeldt (dev) [Wed, 12 Nov 2008 16:38:06 +0000 (00:38 +0800)]
git-svn: Update git-svn to use the ability to place temporary files within repository directory

This fixes git-svn within msys where Perl will provide temporary files with path
such as /tmp while the git suit expects native Windows paths.

Signed-off-by: Marten Svanfeldt <developer@svanfeldt.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
16 years agoGit.pm: Make _temp_cache use the repository directory
Marten Svanfeldt (dev) [Thu, 13 Nov 2008 12:04:09 +0000 (20:04 +0800)]
Git.pm: Make _temp_cache use the repository directory

Update the usage of File::Temp->tempfile to place the temporary files
within the repository directory instead of just letting Perl decide what
directory to use, given there is a repository specified when requesting
the temporary file.

This is needed to be able to fix git-svn on msys as msysperl generates
paths with UNIX-style paths (/tmp/xxx) while the git tools expect natvie
path format (c:/..). The repository dir is stored in native format so by
using it as the base directory for temporary files we always get a
usable native full path.

Signed-off-by: Marten Svanfeldt <developer@svanfeldt.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
16 years agogit-svn: proper detection of bare repositories
Deskin Miller [Thu, 6 Nov 2008 05:07:39 +0000 (00:07 -0500)]
git-svn: proper detection of bare repositories

When in a bare repository (or .git, for that matter), git-svn would fail
to initialise properly, since git rev-parse --show-cdup would not output
anything.  However, git rev-parse --show-cdup actually returns an error
code if it's really not in a git directory.

Fix the issue by checking for an explicit error from git rev-parse, and
setting $git_dir appropriately if instead it just does not output.

Signed-off-by: Deskin Miller <deskinm@umich.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
16 years agogit-svn: respect i18n.commitencoding config
Eric Wong [Thu, 30 Oct 2008 06:49:26 +0000 (23:49 -0700)]
git-svn: respect i18n.commitencoding config

SVN itself always stores log messages in the repository as
UTF-8.  git always stores/retrieves everything as raw binary
data with no transformations whatsoever.

To interact with SVN, we need to encode log messages as UTF-8
before sending them to SVN, as SVN cannot do it for us.  When
retrieving log messages from SVN, we also need to (attempt to)
reencode the UTF-8 log message back to the user-specified commit
encoding.

Note, handling i18n.logoutputencoding for "git svn log" also
needs to be done in a future change.

Also, this change only deals with the encoding of commit
messages and nothing else (path names, blob content, ...).

In-Reply-To: <8b168cfb0810282014r789ac01dnec51824de1078f0@mail.gmail.com>
James North <tocapicha@gmail.com> wrote:
> Hi,
>
> I'm using git-svn on a system with ISO-8859-1 encoding. The problem is
> when I try to use "git svn dcommit" to send changes to a remote svn
> (also ISO-8859-1).
>
> Seems like git-svn is sending commit messages with utf-8 (just a
> guessing...) and they look bad on the remote svn log. E.g. "Ca?\241a
> de cami?\243n"
>
> I have tried using i18n.commitencoding=ISO-8859-1 as suggested by the
> warning when doing "git svn dcommit" but messages still are sent with
> wrong encoding.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
16 years agogit-svn: don't escape tilde ('~') for http(s) URLs
Eric Wong [Tue, 21 Oct 2008 21:12:15 +0000 (14:12 -0700)]
git-svn: don't escape tilde ('~') for http(s) URLs

Thanks to Jose Carlos Garcia Sogo and Björn Steinbrink for the
bug report.

On 2008.10.18 23:39:19 +0200, Björn Steinbrink wrote:
> Hi,
>
> Jose Carlos Garcia Sogo reported on #git that a git-svn clone of this
> svn repo fails for him:
> https://sucs.org/~welshbyte/svn/backuptool/trunk
>
> I can reproduce that here with:
> git-svn version 1.6.0.2.541.g46dc1.dirty (svn 1.5.1)
>
> The error message I get is:
> Apache got a malformed URI: Unusable URI: it does not refer to this
> repository at /usr/local/libexec/git-core/git-svn line 4057
>
> strace revealed that git-svn url-encodes ~ while svn does not do that.
>
> For svn we have:
> write(5, "<S:update-report send-all=\"true\" xmlns:S=\"svn:\">
> <S:src-path>https://sucs.org/~welshbyte/svn/backuptool/trunk</S:src-path>...
>
> While git-svn shows:
> write(7, "<S:update-report send-all=\"true\" xmlns:S=\"svn:\">
> <S:src-path>https://sucs.org/%7Ewelshbyte/svn/backuptool/trunk</S:src-path>...

Signed-off-by: Eric Wong <normalperson@yhbt.net>
16 years agoMerge git://git.bogomips.org/git-svn
Junio C Hamano [Fri, 14 Nov 2008 06:30:17 +0000 (22:30 -0800)]
Merge git://git.bogomips.org/git-svn

* git://git.bogomips.org/git-svn:
  git-svn: proper detection of bare repositories
  git-svn: respect i18n.commitencoding config
  git-svn: don't escape tilde ('~') for http(s) URLs

16 years agoMerge branch 'maint'
Junio C Hamano [Fri, 14 Nov 2008 05:58:07 +0000 (21:58 -0800)]
Merge branch 'maint'

* maint:
  date/time: do not get confused by fractional seconds

16 years agodate/time: do not get confused by fractional seconds
Linus Torvalds [Sun, 17 Aug 2008 04:25:40 +0000 (21:25 -0700)]
date/time: do not get confused by fractional seconds

The date/time parsing code was confused if the input time HH:MM:SS is
followed by fractional seconds.  Since we do not record anything finer
grained than seconds, we could just drop fractional part, but there is a
twist.

We have taught people that not just spaces but dot can be used as word
separators when spelling things like:

    $ git log --since 2.days
    $ git show @{12:34:56.7.days.ago}

and we shouldn't mistake "7" in the latter example as a fraction and
discard it.

The rules are:

 - valid days of month/mday are always single or double digits.

 - valid years are either two or four digits

   No, we don't support the year 600 _anyway_, since our encoding is based
   on the UNIX epoch, and the day we worry about the year 10,000 is far
   away and we can raise the limit to five digits when we get closer.

 - Other numbers (eg "600 days ago") can have any number of digits, but
   they cannot start with a zero. Again, the only exception is for
   two-digit numbers, since that is fairly common for dates ("Dec 01" is
   not unheard of)

So that means that any milli- or micro-second would be thrown out just
because the number of digits shows that it cannot be an interesting date.

A milli- or micro-second can obviously be a perfectly fine number
according to the rules above, as long as it doesn't start with a '0'. So
if we have

12:34:56.123

then that '123' gets parsed as a number, and we remember it. But because
it's bigger than 31, we'll never use it as such _unless_ there is
something after it to trigger that use.

So you can say "12:34:56.123.days.ago", and because of the "days", that
123 will actually be meaninful now.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge git://git.kernel.org/pub/scm/gitk/gitk
Junio C Hamano [Thu, 13 Nov 2008 16:28:51 +0000 (08:28 -0800)]
Merge git://git.kernel.org/pub/scm/gitk/gitk

* git://git.kernel.org/pub/scm/gitk/gitk:
  gitk: Fix linehtag undefined error with file highlighting
  gitk: Fix commit encoding support
  gitk: Fix transient windows on Win32 and MacOS
  gitk: Add accelerators to frequently used menu commands
  gitk: Implement a user-friendly Edit View dialog
  gitk: Improve cherry-pick error handling
  gitk: Make cherry-pick call git-citool on conflicts
  gitk: Make gitk dialog windows transient
  gitk: Add Return and Escape bindings to dialogs
  gitk: Cope with unmerged files in local changes
  gitk: Make "show origin of this line" work on fake commits
  gitk: Unify handling of merge diffs with normal 2-way diffs
  gitk: Make the background color of marked lines configurable
  gitk: Add a menu item to show where a given line comes from
  gitk: Fix some off-by-one errors in computing which line to blame
  gitk: Allow starting gui blame for a specific line
  gitk: Fix file list context menu for merge commits
  gitk: Allow forcing branch creation if it already exists

16 years agogitk: Fix linehtag undefined error with file highlighting
Paul Mackerras [Thu, 13 Nov 2008 11:39:00 +0000 (22:39 +1100)]
gitk: Fix linehtag undefined error with file highlighting

Occasionally gitk will throw a Tcl error complaining that linehtag(n)
is undefined when.  It happens when the commit list is still growing
(e.g. when updating the commit list) and gitk is set to highlight
commits that affect certain file(s).  What happens is that the changes
to the commit list set need_redisplay to indicate that the display
needs to be redrawn.  That causes the next call to drawcommits to call
clear_display, which unsets iddrawn and thus ensures that readfhighlight
won't call bolden on any rows that have moved.  However, it is possible
for readfhighlight to be called after the commit list has changed but
before drawcommits has run, meaning that readfhighlight will potentially
think that rows have been drawn when they haven't, because of the
change in the id -> row mapping (and the fact that iddrawn is indexed
by id but line[hnd]tag are indexed by row number).

This fixes it (and also optimizes things a little) by making bolden
and bolden_name check need_redisplay before doing anything.  If
need_redisplay is set, then there is no point doing anything because
the whole display is about to get cleared and redrawn, and it avoids
looking up line[hn]tag using stale row numbers.

Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years agogitk: Fix commit encoding support
Alexander Gavrilov [Sun, 9 Nov 2008 15:06:07 +0000 (18:06 +0300)]
gitk: Fix commit encoding support

This commit fixes two problems with commit encodings:

1) git-log actually uses i18n.logoutputencoding to generate
   its output, and falls back to i18n.commitencoding only
   when that option is not set.  Thus, gitk should use its
   value to read the results, if available.

2) The readcommit function did not process encodings at all.
   This led to randomly appearing misconverted commits if
   the commit encoding differed from the current locale.

Now commit messages should be displayed correctly, except
when logoutputencoding is set to an encoding that cannot
represent charecters in the message.  For example, it is
impossible to convert Japanese characters from Shift-JIS
to CP-1251 (although the reverse conversion works).

The reason for using git log to read the commit and then getting
Tcl to convert its output is that is essentially what happens in
the normal path through getcommitlines, hence there is less chance
for unintended differences in how commits are processed in
getcommitlines and do_readcommit.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years agogitk: Fix transient windows on Win32 and MacOS
Alexander Gavrilov [Tue, 11 Nov 2008 20:55:42 +0000 (23:55 +0300)]
gitk: Fix transient windows on Win32 and MacOS

Transient windows cause problems on these platforms:

- On Win32 the windows appear in the top left corner
  of the screen. In order to fix it, this patch causes
  them to be explicitly centered on their parents by
  an idle handler.

- On MacOS with Tk 8.4 they appear without a title bar.
  Since it is clearly unacceptable, this patch disables
  transient on that platform.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years agogitk: Add accelerators to frequently used menu commands
Alexander Gavrilov [Sun, 9 Nov 2008 10:00:45 +0000 (13:00 +0300)]
gitk: Add accelerators to frequently used menu commands

This commit documents keyboard accelerators used for menu
commands in the menu, as it is usually done, and adds some
more, e.g. F4 to invoke Edit View (or New View if the current
view is the un-editable "All files" view).

The changes include a workaround for handling Shift-F4 on
systems where XKB binds special XF86_Switch_VT_* symbols
to Ctrl-Alt-F* combinations.  Tk often receives these codes
when Shift-F* is pressed, so it is necessary to bind the
relevant actions to them as well.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years agoUpdate draft release notes to 1.6.1
Junio C Hamano [Thu, 13 Nov 2008 06:47:15 +0000 (22:47 -0800)]
Update draft release notes to 1.6.1

A large number of topics are merged to prepare for -rc0 now.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'jn/gitweb-customlinks'
Junio C Hamano [Thu, 13 Nov 2008 06:27:53 +0000 (22:27 -0800)]
Merge branch 'jn/gitweb-customlinks'

* jn/gitweb-customlinks:
  gitweb: Better processing format string in custom links in navbar

16 years agoMerge branch 'gb/gitweb-snapshot-pathinfo'
Junio C Hamano [Thu, 13 Nov 2008 06:27:49 +0000 (22:27 -0800)]
Merge branch 'gb/gitweb-snapshot-pathinfo'

* gb/gitweb-snapshot-pathinfo:
  gitweb: embed snapshot format parameter in PATH_INFO
  gitweb: retrieve snapshot format from PATH_INFO
  gitweb: make the supported snapshot formats array global

16 years agoMerge branch 'ds/uintmax-config' (early part)
Junio C Hamano [Thu, 13 Nov 2008 06:27:33 +0000 (22:27 -0800)]
Merge branch 'ds/uintmax-config' (early part)

* 'ds/uintmax-config' (early part):
  Add autoconf tests for pthreads
  Make Pthread link flags configurable
  Add Makefile check for FreeBSD 4.9-SECURITY
  Build: add NO_UINTMAX_T to support ancient systems

Conflicts:
Makefile