gitweb.git
Modernize t5400 test scriptJunio C Hamano Mon, 9 Feb 2009 21:39:52 +0000 (13:39 -0800)

Modernize t5400 test script

Many tests checked for failure by hand without using test_must_fail (they
probably predate the shell function).

When we know the desired outcome, explicitly check for it, instead of
checking if the result does not match one possible incorrect outcome.
E.g. if you expect a push to be refused, you do not test if the result is
different from what was pushed. Instead, make sure that the ref did not
before and after the push.

The test sequence chdir'ed around and any failure at one point could have
started the next test in an unexpected directory. Fix this problem by
using subshells as necessary.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Describe notable git.el changes in the release notesAlexandre Julliard Mon, 9 Feb 2009 13:39:30 +0000 (14:39 +0100)

Describe notable git.el changes in the release notes

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Revert "Merge branch 'js/notes'"Junio C Hamano Wed, 11 Feb 2009 05:31:33 +0000 (21:31 -0800)

Revert "Merge branch 'js/notes'"

This reverts commit 7b75b331f6744fbf953fe8913703378ef86a2189, reversing
changes made to 5d680a67d7909c89af96eba4a2d77abed606292b.

Merge branch 'lh/submodule-tree-traversal' (early part)Junio C Hamano Wed, 11 Feb 2009 05:31:19 +0000 (21:31 -0800)

Merge branch 'lh/submodule-tree-traversal' (early part)

* 'lh/submodule-tree-traversal' (early part):
tree.c: allow read_tree_recursive() to traverse gitlink entries

Merge branch 'js/git-submodule-trailing-slash'Junio C Hamano Wed, 11 Feb 2009 05:31:08 +0000 (21:31 -0800)

Merge branch 'js/git-submodule-trailing-slash'

* js/git-submodule-trailing-slash:
submodule: warn about non-submodules
Let ls-files strip trailing slashes in submodules' paths

Merge branch 'js/maint-1.6.0-path-normalize'Junio C Hamano Wed, 11 Feb 2009 05:30:52 +0000 (21:30 -0800)

Merge branch 'js/maint-1.6.0-path-normalize'

* js/maint-1.6.0-path-normalize:
Remove unused normalize_absolute_path()
Test and fix normalize_path_copy()
Fix GIT_CEILING_DIRECTORIES on Windows
Move sanitary_path_copy() to path.c and rename it to normalize_path_copy()
Make test-path-utils more robust against incorrect use

Merge branch 'maint'Junio C Hamano Wed, 11 Feb 2009 05:30:45 +0000 (21:30 -0800)

Merge branch 'maint'

* maint:
Clear the delta base cache during fast-import checkpoint

Merge branch 'maint-1.6.0' into maintJunio C Hamano Tue, 10 Feb 2009 23:32:26 +0000 (15:32 -0800)

Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
Clear the delta base cache during fast-import checkpoint

Clear the delta base cache during fast-import checkpointShawn O. Pearce Tue, 10 Feb 2009 21:36:12 +0000 (13:36 -0800)

Clear the delta base cache during fast-import checkpoint

Otherwise we may reuse the same memory address for a totally
different "struct packed_git", and a previously cached object from
the prior occupant might be returned when trying to unpack an object
from the new pack.

Found-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-web--browse: Fix check for /bin/startTodd Zullinger Sun, 8 Feb 2009 23:12:43 +0000 (18:12 -0500)

git-web--browse: Fix check for /bin/start

The previous check in git-web--browse for /bin/start used test -n
/bin/start, which was always true. This lead to "start" being tried
first in the browser list. On systems with upstart installed, "start"
exists and might be in the PATH, but it makes a poor choice for a web
browser. Instead, test that /bin/start exists and is executable.

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Mon, 9 Feb 2009 06:07:53 +0000 (22:07 -0800)

Merge branch 'maint'

* maint:
gitweb: add $prevent_xss option to prevent XSS by repository content
rev-list: fix showing distance when using --bisect-all

completion: Get rid of tabbed indentation in comments... Ted Pavlic Fri, 6 Feb 2009 16:05:38 +0000 (11:05 -0500)

completion: Get rid of tabbed indentation in comments. Replace with spaces.

Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: Fix GIT_PS1_SHOWDIRTYSTATE to prevent unbou... Ted Pavlic Fri, 6 Feb 2009 16:05:37 +0000 (11:05 -0500)

completion: Fix GIT_PS1_SHOWDIRTYSTATE to prevent unbound variable errors.

Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: add $prevent_xss option to prevent XSS by repos... Matt McCutchen Sun, 8 Feb 2009 00:00:09 +0000 (19:00 -0500)

gitweb: add $prevent_xss option to prevent XSS by repository content

Add a gitweb configuration variable $prevent_xss that disables features
to prevent content in repositories from launching cross-site scripting
(XSS) attacks in the gitweb domain. Currently, this option makes gitweb
ignore README.html (a better solution may be worked out in the future)
and serve a blob_plain file of an untrusted type with
"Content-Disposition: attachment", which tells the browser not to show
the file at its original URL.

The XSS prevention is currently off by default.

Signed-off-by: Matt McCutchen <matt@mattmccutchen.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

doc/bundle: Use the more conventional suffix '.bundle'Santi Béjar Sat, 7 Feb 2009 22:21:49 +0000 (23:21 +0100)

doc/bundle: Use the more conventional suffix '.bundle'

Although it does not matter in general it is handled different by
"git clone", as it removes it to make the "humanish" name of the
new repository.

Signed-off-by: Santi Béjar <santi@agolina.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add two extra tests for git rebaseJohannes Schindelin Mon, 9 Feb 2009 05:40:42 +0000 (21:40 -0800)

Add two extra tests for git rebase

Documentation: clarify commits affected by gitk --mergeSitaram Chamarty Fri, 6 Feb 2009 04:40:53 +0000 (10:10 +0530)

Documentation: clarify commits affected by gitk --merge

Signed-off-by: Sitaram Chamarty <sitaramc@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

add -p: get rid of Git.pm warnings about unitialized... Stephan Beyer Sun, 8 Feb 2009 17:40:39 +0000 (18:40 +0100)

add -p: get rid of Git.pm warnings about unitialized values

After invoking git add -p I always got the warnings:

Use of uninitialized value $_[3] in exec at Git.pm line 1282.
Use of uninitialized value $args[2] in join or string at Git.pm line 1264.

A bisect showed that these warnings occur in a301973 "add -p: print errors
in separate color" the first time.

They can be reproduced by setting color.ui (or color.interactive) to "auto"
and unsetting color.interactive.help and color.interactive.error.
I am using Perl 5.10.0.

The reason of the warning is that color.interactive.error defaults to
color.interactive.help which defaults to nothing in the specific codepath.
It defaults to 'red bold' some lines above which could lead to the wrong
assumption that it always defaults to 'red bold' now.

This patch lets it default to 'red bold', blowing the warnings away.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Acked-By: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config: Add new option to open an editor.Felipe Contreras Sat, 7 Feb 2009 21:53:00 +0000 (23:53 +0200)

config: Add new option to open an editor.

The idea was originated by discussion about usability of manually
editing the config file in 'special needs' systems such as Windows. Now
the user can forget a bit about where the config files actually are.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rev-list: fix showing distance when using --bisect-allChristian Couder Sun, 8 Feb 2009 14:54:47 +0000 (15:54 +0100)

rev-list: fix showing distance when using --bisect-all

Before d467a52 ("Make '--decorate' set an explicit 'show_decorations'
flag", Nov 3 2008), commit decorations were shown whenever they exist, and
distances stored in them by "git rev-list --bisect-all" were automatically
shown. d467a52 changed the rule so that commit decorations are not shown
unless rev_info explicitly asks to, with its show_decorations bit, but
forgot that the ones "git rev-list --bisect-all" adds need to be shown.

This patch fixes this old breakage.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Move mailmap documentation into separate fileMarius Storm-Olsen Sun, 8 Feb 2009 14:34:31 +0000 (15:34 +0100)

Move mailmap documentation into separate file

Include it directly from git-shortlog.txt, and refer
to it from pretty-format.txt.

Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Change current mailmap usage to do matching on both... Marius Storm-Olsen Sun, 8 Feb 2009 14:34:30 +0000 (15:34 +0100)

Change current mailmap usage to do matching on both name and email of author/committer.

Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add map_user() and clear_mailmap() to mailmapMarius Storm-Olsen Sun, 8 Feb 2009 14:34:29 +0000 (15:34 +0100)

Add map_user() and clear_mailmap() to mailmap

map_user() allows to lookup and replace both email and
name of a user, based on a new style mailmap file.

The possible mailmap definitions are now:

proper_name <commit_email> # Old style
<proper_email> <commit_email> # New style
proper_name <proper_email> <commit_email> # New style
proper_name <proper_email> commit_name <commit_email> # New style

map_email() operates the same as before, with the
exception that it also will to try to match on a name
passed in through the name return buffer.

clear_mailmap() is needed to now clear the more complex
mailmap structure.

Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add find_insert_index, insert_at_index and clear_func... Marius Storm-Olsen Sun, 8 Feb 2009 14:34:28 +0000 (15:34 +0100)

Add find_insert_index, insert_at_index and clear_func functions to string_list

string_list_find_insert_index() and string_list_insert_at_index()
enables you to see if an item is in the string_list, and to
insert at the appropriate index in the list, if not there.
This is usefull if you need to manipulate an existing item,
if present, and insert a new item if not.

Future mailmap code will use this construct to enable
complex (old_name, old_email) -> (new_name, new_email)
lookups.

The string_list_clear_func() allows to call a custom
cleanup function on each item in a string_list, which is
useful is the util member points to a complex structure.

Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add mailmap.file as configurational option for mailmap... Marius Storm-Olsen Sun, 8 Feb 2009 14:34:27 +0000 (15:34 +0100)

Add mailmap.file as configurational option for mailmap location

This allows us to augment the repo mailmap file, and to use
mailmap files elsewhere than the repository root. Meaning
that the entries in mailmap.file will override the entries
in "./.mailmap", should they match.

Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Better regexp for SHA-1 committag matchJakub Narebski Fri, 6 Feb 2009 09:12:41 +0000 (10:12 +0100)

gitweb: Better regexp for SHA-1 committag match

Make SHA-1 regexp to be turned into hyperlink (the SHA-1 committag)
to match word boundary at the beginning and the end. This way we
reduce number of false matches, for example we now don't match
0x74a5cd01 which is hex decimal (for example memory address),
but is not SHA-1.

Suggested-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule: warn about non-submodulesJohannes Schindelin Sat, 7 Feb 2009 13:43:15 +0000 (14:43 +0100)

submodule: warn about non-submodules

Earlier, when you called

git submodule some/bogus/path

Git would silently ignore the path, without warning the user about the
likely mistake. Now it does.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Let ls-files strip trailing slashes in submodules'... Johannes Schindelin Sat, 7 Feb 2009 13:43:03 +0000 (14:43 +0100)

Let ls-files strip trailing slashes in submodules' paths

Tab completion makes it easy to add a trailing slash to a submodule path.
As it is completely clear what the user actually wanted to say, be nice
and strip that slash at the end.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Remove unused normalize_absolute_path()Johannes Sixt Sat, 7 Feb 2009 15:08:31 +0000 (16:08 +0100)

Remove unused normalize_absolute_path()

This function is now superseded by normalize_path_copy().

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Test and fix normalize_path_copy()Johannes Sixt Sat, 7 Feb 2009 15:08:30 +0000 (16:08 +0100)

Test and fix normalize_path_copy()

This changes the test-path-utils utility to invoke normalize_path_copy()
instead of normalize_absolute_path() because the latter is about to be
removed.

The test cases in t0060 are adjusted in two regards:

- normalize_path_copy() more often leaves a trailing slash in the result.
This has no negative side effects because the new user of this function,
longest_ancester_length(), already accounts for this behavior.

- The function can fail.

The tests uncover a flaw in normalize_path_copy(): If there are
sufficiently many '..' path components so that the root is reached, such as
in "/d1/s1/../../d2", then the leading slash was lost. This manifested
itself that (assuming there is a repository at /tmp/foo)

$ git add /d1/../tmp/foo/some-file

reported 'pathspec is outside repository'. This is now fixed.

Moreover, the test case descriptions of t0060 now include the test data and
expected outcome.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix GIT_CEILING_DIRECTORIES on WindowsRené Scharfe Sat, 7 Feb 2009 15:08:29 +0000 (16:08 +0100)

Fix GIT_CEILING_DIRECTORIES on Windows

Using git with GIT_CEILING_DIRECTORIES crashed on Windows due to a failed
assertion in normalize_absolute_path(): This function expects absolute
paths to start with a slash, while on Windows they can start with a drive
letter or a backslash.

This fixes it by using the alternative, normalize_path_copy() instead,
which can handle Windows-style paths just fine.

Secondly, the portability macro PATH_SEP is used instead of expecting
colons to be used as path list delimiter.

The test script t1504 is also changed to help MSYS's bash recognize some
program arguments as path list. (MSYS's bash must translate POSIX-style
path lists to Windows-style path lists, and the heuristic did not catch
some cases.)

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Move sanitary_path_copy() to path.c and rename it to... Johannes Sixt Sat, 7 Feb 2009 15:08:28 +0000 (16:08 +0100)

Move sanitary_path_copy() to path.c and rename it to normalize_path_copy()

This function and normalize_absolute_path() do almost the same thing. The
former already works on Windows, but the latter crashes.

In subsequent changes we will remove normalize_absolute_path(). Here we
make the replacement function reusable. On the way we rename it to reflect
that it does some path normalization. Apart from that this is only moving
around code.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Make test-path-utils more robust against incorrect useJohannes Sixt Sat, 7 Feb 2009 15:08:27 +0000 (16:08 +0100)

Make test-path-utils more robust against incorrect use

Previously, this test utility happily returned with exit code 0 if garbage
was thrown at it. Now it reports failure if an unknown function name was
given on the command line.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tree.c: allow read_tree_recursive() to traverse gitlink... Lars Hjemli Sun, 25 Jan 2009 00:52:05 +0000 (01:52 +0100)

tree.c: allow read_tree_recursive() to traverse gitlink entries

When the callback function invoked from read_tree_recursive() returns
the value `READ_TREE_RECURSIVE` for a gitlink entry, the traversal will
now continue into the tree connected to the gitlinked commit. This
functionality can be used to allow inter-repository operations, but
since the current users of read_tree_recursive() does not yet support
such operations, they have been modified where necessary to make sure
that they never return READ_TREE_RECURSIVE for gitlink entries (hence
no change in behaviour should be introduces by this patch alone).

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

GIT 1.6.2-rc0 v1.6.2-rc0Junio C Hamano Sat, 7 Feb 2009 19:06:34 +0000 (11:06 -0800)

GIT 1.6.2-rc0

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'tr/add-p-single'Junio C Hamano Sat, 7 Feb 2009 19:10:16 +0000 (11:10 -0800)

Merge branch 'tr/add-p-single'

* tr/add-p-single:
add -p: import Term::ReadKey with 'require'
add -p: print errors in separate color
add -p: prompt for single characters

Merge branch 'js/filter-branch-submodule'Junio C Hamano Sat, 7 Feb 2009 19:09:48 +0000 (11:09 -0800)

Merge branch 'js/filter-branch-submodule'

* js/filter-branch-submodule:
filter-branch: do not consider diverging submodules a 'dirty worktree'
filter-branch: Fix fatal error on bare repositories

Merge branch 'maint'Junio C Hamano Sat, 7 Feb 2009 18:44:25 +0000 (10:44 -0800)

Merge branch 'maint'

* maint:
GIT 1.6.1.3

Conflicts:
GIT-VERSION-GEN
RelNotes

emacs: Remove the no longer maintained vc-git package.Alexandre Julliard Sat, 7 Feb 2009 13:24:54 +0000 (14:24 +0100)

emacs: Remove the no longer maintained vc-git package.

vc-git is distributed with Emacs since version 22.2, and is maintained
in the Emacs CVS tree. This file is obsolete and causes trouble for
people who want to add contrib/emacs to their load-path.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>

git.el: Add some notes about Emacs versions compatibility.Alexandre Julliard Sat, 7 Feb 2009 13:21:58 +0000 (14:21 +0100)

git.el: Add some notes about Emacs versions compatibility.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>

git.el: Use integer instead of character constants... Alexandre Julliard Sat, 7 Feb 2009 13:01:26 +0000 (14:01 +0100)

git.el: Use integer instead of character constants in case statement.

This is for compatibility with XEmacs. Reported by Vassili Karpov.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>

git.el: Set a regexp for paragraph-separate in log... Alexandre Julliard Tue, 27 Jan 2009 10:59:54 +0000 (11:59 +0100)

git.el: Set a regexp for paragraph-separate in log-edit mode.

This allows using fill-paragraph on the log message without
interference from the various header fields.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>

git.el: Make git-run-command-region display the error... Alexandre Julliard Sun, 23 Nov 2008 15:12:45 +0000 (16:12 +0100)

git.el: Make git-run-command-region display the error if any.

This makes it easier to figure out why a commit has failed.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>

git.el: Add commands for cherry-pick and revert.Alexandre Julliard Sun, 23 Nov 2008 13:34:48 +0000 (14:34 +0100)

git.el: Add commands for cherry-pick and revert.

Support for cherry-picking and reverting commits, with automatic
formatting of the commit log message. Bound to C-c C-p and C-c C-v
respectively.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>

git.el: Add a command to create a new branch.Alexandre Julliard Sun, 23 Nov 2008 13:25:50 +0000 (14:25 +0100)

git.el: Add a command to create a new branch.

Prompts for a branch name, create a new branch at HEAD and switch to
it. Bound to C-c C-b by default.

Based on a patch by Rémi Vanicat <vanicat@debian.org>.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>

git.el: Add a checkout command.Alexandre Julliard Sun, 23 Nov 2008 13:16:22 +0000 (14:16 +0100)

git.el: Add a checkout command.

Prompts for a branch name and checks it out. Bound to C-c C-o by
default.

Based on a patch by Rémi Vanicat <vanicat@debian.org>.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>

GIT 1.6.1.3 v1.6.1.3Junio C Hamano Sat, 7 Feb 2009 08:51:47 +0000 (00:51 -0800)

GIT 1.6.1.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-sh-setup: Use "cd" option, not /bin/pwd, for symlin... Marcel M. Cary Sat, 7 Feb 2009 03:24:28 +0000 (19:24 -0800)

git-sh-setup: Use "cd" option, not /bin/pwd, for symlinked work tree

In cd_to_toplevel, instead of 'cd $(unset PWD; /bin/pwd)/$path'
use 'cd -P $path'. The "-P" option yields a desirable similarity to
C chdir.

While the "-P" option may be slightly less commonly supported than
/bin/pwd, it is more concise, better tested, and less error prone.
I've already added the 'unset PWD' to fix the /bin/pwd solution on
BSD; there may be more edge cases out there.

This still passes all the same test cases in t5521-pull-symlink.sh and
t2300-cd-to-toplevel.sh, even before updating them to use 'pwd -P'.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule: add --no-fetch parameter to update commandFabian Franz Thu, 5 Feb 2009 22:18:32 +0000 (20:18 -0200)

submodule: add --no-fetch parameter to update command

git submodule update --no-fetch makes it possible to use git submodule
update in complete offline mode by not fetching new revisions.

This does make sense in the following setup:

* There is an unstable and a stable branch in the super/master repository.
* The submodules might be at different revisions in the branches.
* You are at some place without internet connection ;)

With this patch it is now possible to change branches and update
the submodules to be at the recorded revision without online access.

Another advantage is that with -N the update operation is faster, because fetch is checking for new updates even if there was no fetch/pull on the super/master repository since the last update.

Signed-off-by: Fabian Franz <git@fabian-franz.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

add -p: import Term::ReadKey with 'require'Thomas Rast Fri, 6 Feb 2009 19:30:01 +0000 (20:30 +0100)

add -p: import Term::ReadKey with 'require'

eval{use...} is no good because the 'use' is evaluated at compile
time, so manually 'require' it. We need to forward declare the
functions we use, otherwise Perl raises a compilation error.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'js/maint-remote-remove-mirror'Junio C Hamano Fri, 6 Feb 2009 03:40:41 +0000 (19:40 -0800)

Merge branch 'js/maint-remote-remove-mirror'

* js/maint-remote-remove-mirror:
builtin-remote: make rm operation safer in mirrored repository
builtin-remote: make rm() use properly named variable to hold return value

Merge branch 'js/notes'Junio C Hamano Fri, 6 Feb 2009 03:40:39 +0000 (19:40 -0800)

Merge branch 'js/notes'

* js/notes:
git-notes: fix printing of multi-line notes
notes: fix core.notesRef documentation
Add an expensive test for git-notes
Speed up git notes lookup
Add a script to edit/inspect notes
Introduce commit notes

Conflicts:
pretty.c

Merge branch 'jc/refuse-push-to-current'Junio C Hamano Fri, 6 Feb 2009 03:40:36 +0000 (19:40 -0800)

Merge branch 'jc/refuse-push-to-current'

* jc/refuse-push-to-current:
receive-pack: explain what to do when push updates the current branch

Merge branch 'rc/http-push'Junio C Hamano Fri, 6 Feb 2009 03:40:36 +0000 (19:40 -0800)

Merge branch 'rc/http-push'

* rc/http-push:
http-push: wrap signature of get_remote_object_url
http-push: add back underscore separator before lock token
http-push.c: get_remote_object_url() is only used under USE_CURL_MULTI
http-push: refactor request url creation

Merge branch 'gt/utf8-width'Junio C Hamano Fri, 6 Feb 2009 03:40:35 +0000 (19:40 -0800)

Merge branch 'gt/utf8-width'

* gt/utf8-width:
builtin-blame.c: Use utf8_strwidth for author's names
utf8: add utf8_strwidth()

Merge branch 'jk/head-symref'Junio C Hamano Fri, 6 Feb 2009 03:40:35 +0000 (19:40 -0800)

Merge branch 'jk/head-symref'

* jk/head-symref:
symbolic ref: refuse non-ref targets in HEAD
validate_headref: tighten ref-matching to just branches

Merge branch 'cb/mergetool'Junio C Hamano Fri, 6 Feb 2009 03:40:35 +0000 (19:40 -0800)

Merge branch 'cb/mergetool'

* cb/mergetool:
mergetool: fix running mergetool in sub-directories
mergetool: Add a test for running mergetool in a sub-directory
mergetool: respect autocrlf by using checkout-index

Merge branch 'maint'Junio C Hamano Fri, 6 Feb 2009 03:40:25 +0000 (19:40 -0800)

Merge branch 'maint'

* maint:
Fixed broken git help -w when installing from RPM

Merge branch 'maint-1.6.0' into maintJunio C Hamano Fri, 6 Feb 2009 03:38:58 +0000 (19:38 -0800)

Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
Fixed broken git help -w when installing from RPM

Merge branch 'jc/maint-apply-fix' into maintJunio C Hamano Fri, 6 Feb 2009 02:06:11 +0000 (18:06 -0800)

Merge branch 'jc/maint-apply-fix' into maint

* jc/maint-apply-fix:
builtin-apply.c: do not set bogus mode in check_preimage() for deleted path

Merge branch 'am/maint-push-doc' into maintJunio C Hamano Fri, 6 Feb 2009 02:06:03 +0000 (18:06 -0800)

Merge branch 'am/maint-push-doc' into maint

* am/maint-push-doc:
Documentation: rework src/dst description in git push
Documentation: more git push examples
Documentation: simplify refspec format description

Merge branch 'sg/maint-gitdir-in-subdir' into maintJunio C Hamano Fri, 6 Feb 2009 02:05:43 +0000 (18:05 -0800)

Merge branch 'sg/maint-gitdir-in-subdir' into maint

* sg/maint-gitdir-in-subdir:
Fix gitdir detection when in subdir of gitdir

Merge branch 'lt/maint-wrap-zlib' into maintJunio C Hamano Fri, 6 Feb 2009 02:01:00 +0000 (18:01 -0800)

Merge branch 'lt/maint-wrap-zlib' into maint

* lt/maint-wrap-zlib:
Wrap inflate and other zlib routines for better error reporting

Conflicts:
http-push.c
http-walker.c
sha1_file.c

Merge branch 'jc/maint-split-diff-metainfo' into maintJunio C Hamano Fri, 6 Feb 2009 01:54:17 +0000 (17:54 -0800)

Merge branch 'jc/maint-split-diff-metainfo' into maint

* jc/maint-split-diff-metainfo:
diff.c: output correct index lines for a split diff

Merge branch 'js/maint-all-implies-HEAD' into maintJunio C Hamano Fri, 6 Feb 2009 01:54:12 +0000 (17:54 -0800)

Merge branch 'js/maint-all-implies-HEAD' into maint

* js/maint-all-implies-HEAD:
bundle: allow the same ref to be given more than once
revision walker: include a detached HEAD in --all

Merge branch 'kc/maint-diff-bwi-fix' into maintJunio C Hamano Fri, 6 Feb 2009 01:52:22 +0000 (17:52 -0800)

Merge branch 'kc/maint-diff-bwi-fix' into maint

* kc/maint-diff-bwi-fix:
Fix combined use of whitespace ignore options to diff
test more combinations of ignore-whitespace options to diff

valgrind: do not require valgrind 3.4.0 or newerJohannes Schindelin Thu, 5 Feb 2009 21:03:00 +0000 (22:03 +0100)

valgrind: do not require valgrind 3.4.0 or newer

Valgrind 3.4.0 is pretty new, and even if --track-origins is a nice
feature, it is not the end of the world if that is not available. So
play nice and use that option only when only an older version of
valgrind is available.

In the same spirit, refrain from the use of '...' in suppression
files, which is also a feature only valgrind 3.4 and newer understand.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

filter-branch: do not consider diverging submodules... Johannes Schindelin Thu, 5 Feb 2009 18:19:33 +0000 (19:19 +0100)

filter-branch: do not consider diverging submodules a 'dirty worktree'

At the end of filter-branch in a non-bare repository, the work tree is
updated with "read-tree -m -u HEAD", to carry the change forward in case
the current branch was rewritten. In order to avoid losing any local
change during this step, filter-branch refuses to work when there are
local changes in the work tree.

This "read-tree -m -u HEAD" operation does not affect what commit is
checked out in a submodule (iow, it does not touch .git/HEAD in a
submodule checkout), and checking if there is any local change to the
submodule is not useful.

Staged submodules _are_ considered to be 'dirty', however, as the
"read-tree -m -u HEAD" could result in loss of staged information
otherwise.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

add -p: print errors in separate colorThomas Rast Thu, 5 Feb 2009 08:28:27 +0000 (09:28 +0100)

add -p: print errors in separate color

Print interaction error messages in color.interactive.error, which
defaults to the value of color.interactive.help.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

add -p: prompt for single charactersThomas Rast Thu, 5 Feb 2009 08:28:26 +0000 (09:28 +0100)

add -p: prompt for single characters

Use Term::ReadKey, if available and enabled with interactive.singlekey,
to let the user answer add -p's prompts by pressing a single key. We're
not doing the same in the main 'add -i' interface because file selection
etc. may expect several characters.

Two commands take an argument: 'g' can easily cope since it'll just
offer a choice of chunks. '/' now (unconditionally, even without
readkey) offers a chance to enter a regex if none was given.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: minor improvements for Mac OS X (Darwin)Jay Soffian Thu, 5 Feb 2009 06:09:08 +0000 (01:09 -0500)

Makefile: minor improvements for Mac OS X (Darwin)

1) Instead of requesting OLD_ICONV on all Mac OS X versions except for 10.5
(which will break when 10.6 is released), exlicitly request it for versions
older than 10.5.

2) NO_STRLCPY is not needed since Mac OS X 10.2. Noticed by Benjamin Kramer.

Note that uname -r returns the underlying Darwin version, which can be mapped
to Mac OS X version at http://www.opensource.apple.com/darwinsource/

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config.mak.in: define paths without trailing slashPascal Obry Thu, 5 Feb 2009 07:37:24 +0000 (08:37 +0100)

config.mak.in: define paths without trailing slash

The main Makefile defines gitexecdir and template_dir without trailing
slash. config.mak.in should do the same to be consistent.

Signed-off-by: Pascal Obry <pascal@obry.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: fix misdetection of relative pathnamesJunio C Hamano Thu, 5 Feb 2009 08:04:17 +0000 (00:04 -0800)

Makefile: fix misdetection of relative pathnames

The installation rules wanted to differentiate between a template_dir that
is given as an absolute path (e.g. /usr/share/git-core/templates) and a
relative one (e.g. share/git-core/templates) but it was done by checking
if $(abspath $(template_dir)) and $(template_dir) yield the same string.

This was wrong in at least two ways.

* The user can give template_dir with a trailing slash from the command
line to invoke make or from the included config.mak. A directory path
ought to mean the same thing with or without such a trailing slash but
use of $(abspath) means an absolute path with a trailing slash fails
the test.

* Versions of GNU make older than 3.81 do not have $(abspath) to begin
with.

This changes the detection logic to see if the given path begins with a
slash.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fixed broken git help -w when installing from RPMDavid J. Mellor Thu, 5 Feb 2009 04:14:29 +0000 (20:14 -0800)

Fixed broken git help -w when installing from RPM

After the git-core package was renamed to git, git help -w was still looking
for files in /usr/share/doc/git-core-$VERSION instead of
/usr/share/doc/git-$VERSION.

Signed-off-by: David J. Mellor <dmellor@whistlingcat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jc/fsck' (early part)Junio C Hamano Thu, 5 Feb 2009 00:40:15 +0000 (16:40 -0800)

Merge branch 'jc/fsck' (early part)

* 'jc/fsck' (early part):
fsck: check loose objects from alternate object stores by default
fsck: HEAD is part of refs

builtin-blame.c: Use utf8_strwidth for author's namesGeoffrey Thomas Fri, 30 Jan 2009 09:41:29 +0000 (04:41 -0500)

builtin-blame.c: Use utf8_strwidth for author's names

git blame misaligns output if a author's name has a differing display width and
strlen; for instance, an accented Latin letter that takes two bytes to encode
will cause the rest of the line to be shifted to the left by one. To fix this,
use utf8_strwidth instead of strlen (and compute the padding ourselves, since
printf doesn't know about UTF-8).

Signed-off-by: Geoffrey Thomas <geofft@mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

utf8: add utf8_strwidth()Geoffrey Thomas Fri, 30 Jan 2009 09:41:28 +0000 (04:41 -0500)

utf8: add utf8_strwidth()

I'm about to use this pattern more than once, so make it a common function.

Signed-off-by: Geoffrey Thomas <geofft@mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-bundle doc: update examplesNanako Shiraishi Wed, 4 Feb 2009 09:15:29 +0000 (18:15 +0900)

git-bundle doc: update examples

This rewrites the example part of the bundle doucmentation to follow
the suggestion made by Junio during a recent discussion (gmane 108030).

Instead of just showing different ways to create and use bundles in a
disconnected fashion, the rewritten example first shows the simplest
"full cycle" of sneakernet workflow, and then introduces various
variations.

The words are mostly taken from Junio's outline. I only reformatted
them and proofread to make sure the end result flows naturally.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Replace deprecated dashed git commands in usageAlexander Potashev Sun, 4 Jan 2009 18:39:27 +0000 (21:39 +0300)

Replace deprecated dashed git commands in usage

Signed-off-by: Alexander Potashev <aspotashev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-show-branch doc: show -g as synonym to --reflog... jidanni@jidanni.org Tue, 6 Jan 2009 03:14:02 +0000 (11:14 +0800)

git-show-branch doc: show -g as synonym to --reflog in the list

Signed-off-by: jidanni <jidanni@jidanni.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

contrib git-resurrect: find traces of a branch name... Thomas Rast Wed, 4 Feb 2009 10:04:18 +0000 (11:04 +0100)

contrib git-resurrect: find traces of a branch name and resurrect it

Add a tool 'git-resurrect.sh <branch>' that tries to find traces of
the <branch> in the HEAD reflog and, optionally, all merge commits in
the repository. It can then resurrect the branch, pointing it at the
most recent of all candidate commits found.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Wed, 4 Feb 2009 21:07:09 +0000 (13:07 -0800)

Merge branch 'maint'

* maint:
urls.txt: document optional port specification in git URLS
builtin-mv.c: check for unversionned files before looking at the destination.
Add a testcase for "git mv -f" on untracked files.
Missing && in t/t7001.sh.

Merge branch 'wp/add-patch-find'Junio C Hamano Wed, 4 Feb 2009 21:07:06 +0000 (13:07 -0800)

Merge branch 'wp/add-patch-find'

* wp/add-patch-find:
add -p: trap Ctrl-D in 'goto' mode
add -p: change prompt separator for 'g'
In add --patch, Handle K,k,J,j slightly more gracefully.
Add / command in add --patch
git-add -i/-p: Change prompt separater from slash to comma

Merge branch 'ns/am-slacker'Junio C Hamano Wed, 4 Feb 2009 21:07:02 +0000 (13:07 -0800)

Merge branch 'ns/am-slacker'

* ns/am-slacker:
git-am: Add --ignore-date option
am: Add --committer-date-is-author-date option

Conflicts:
git-am.sh

urls.txt: document optional port specification in git... Stefan Naewe Wed, 4 Feb 2009 20:49:35 +0000 (21:49 +0100)

urls.txt: document optional port specification in git URLS

Signed-off-by: Stefan Naewe <stefan.naewe+git@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint-1.6.0' into maintJunio C Hamano Wed, 4 Feb 2009 19:49:07 +0000 (11:49 -0800)

Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
builtin-mv.c: check for unversionned files before looking at the destination.
Add a testcase for "git mv -f" on untracked files.
Missing && in t/t7001.sh.

builtin-mv.c: check for unversionned files before looki... Matthieu Moy Wed, 4 Feb 2009 09:32:08 +0000 (10:32 +0100)

builtin-mv.c: check for unversionned files before looking at the destination.

The previous code was failing in the case where one moves an
unversionned file to an existing destination, with mv -f: the
"existing destination" was checked first, and the error was cancelled
by the force flag.

We now check the unrecoverable error first, which fixes the bug.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add a testcase for "git mv -f" on untracked files.Matthieu Moy Wed, 4 Feb 2009 09:32:07 +0000 (10:32 +0100)

Add a testcase for "git mv -f" on untracked files.

This currently fails with:
git: builtin-mv.c:217: cmd_mv: Assertion `pos >= 0' failed.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Missing && in t/t7001.sh.Matthieu Moy Wed, 4 Feb 2009 09:32:06 +0000 (10:32 +0100)

Missing && in t/t7001.sh.

Without this, the exit status is only the one of the last line.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin-remote: make rm operation safer in mirrored... Jay Soffian Wed, 4 Feb 2009 16:06:07 +0000 (11:06 -0500)

builtin-remote: make rm operation safer in mirrored repository

"git remote rm <repo>" happily removes non-remote refs and their reflogs.
This may be okay if the repository truely is a mirror, but if the user
had done "git remote add --mirror <repo>" by accident and was just
undoing their mistake, then they are left in a situation that is
difficult to recover from.

After this commit, "git remote rm" skips over non-remote refs. The user
is advised on how remove branches using "git branch -d", which itself
has nice safety checks wrt to branch removal lacking from "git remote rm".
Non-remote non-branch refs are skipped silently.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

add -p: trap Ctrl-D in 'goto' modeThomas Rast Mon, 2 Feb 2009 21:46:29 +0000 (22:46 +0100)

add -p: trap Ctrl-D in 'goto' mode

If the user hit Ctrl-D (EOF) while the script was in 'go to hunk?'
mode, it threw an undefined variable error. Explicitly test for EOF
and have it re-enter the goto prompt loop.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

add -p: change prompt separator for 'g'Thomas Rast Mon, 2 Feb 2009 21:46:28 +0000 (22:46 +0100)

add -p: change prompt separator for 'g'

57886bc (git-add -i/-p: Change prompt separater from slash to comma,
2008-11-27) changed the prompt separator to ',', but forgot to adapt
the 'g' (goto) command.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Wed, 4 Feb 2009 08:12:19 +0000 (00:12 -0800)

Merge branch 'maint'

* maint:
User-manual: "git stash <comment>" form is long gone
add test-dump-cache-tree in Makefile
fix typo in Documentation
apply: fix access to an uninitialized mode variable, found by valgrind

Conflicts:
Makefile

Merge branch 'maint-1.6.0' into maintJunio C Hamano Wed, 4 Feb 2009 07:50:09 +0000 (23:50 -0800)

Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
User-manual: "git stash <comment>" form is long gone
add test-dump-cache-tree in Makefile
fix typo in Documentation
apply: fix access to an uninitialized mode variable, found by valgrind

http-push: wrap signature of get_remote_object_urlTay Ray Chuan Tue, 3 Feb 2009 12:39:00 +0000 (20:39 +0800)

http-push: wrap signature of get_remote_object_url

The signature of get_remote_object_url stands at 96 characters (as
pointed out by Dscho); this patch wraps it so that it conforms to the
80 characters guideline.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

http-push: add back underscore separator before lock... Tay Ray Chuan Tue, 3 Feb 2009 13:07:26 +0000 (21:07 +0800)

http-push: add back underscore separator before lock token

817d14a (http-push: refactor request url creation, 2009-01-31) removed the
underscore separator between the object path and the appended lock token.

This patch adds it back.

This would be keeping in line with the aforementioned patch's objective
of refactoring, without changing the behaviour and effect, of the code.

This would also be useful for testing if the lock token has been
indeed appended to the object url.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

User-manual: "git stash <comment>" form is long goneWilliam Pursell Tue, 3 Feb 2009 22:41:14 +0000 (22:41 +0000)

User-manual: "git stash <comment>" form is long gone

These days you must explicitly say "git stash save <comment>".

Signed-off-by: William Pursell <bill.pursell@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

add test-dump-cache-tree in MakefileGuanqun Lu Wed, 4 Feb 2009 21:00:41 +0000 (05:00 +0800)

add test-dump-cache-tree in Makefile

5c5ba73 (Makefile: Use generic rule to build test programs,
2007-05-31) tried to use generic rule to build test programs, but it
misses the file 'dump-cache-tree.c', since its name is not prefixed by
'test-'. This commit solves this little problem by renaming this file
instead of carrying out an explicit rule in Makefile.

Signed-off-by: Guanqun Lu <guanqun.lu@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fix typo in DocumentationGuanqun Lu Wed, 4 Feb 2009 21:00:40 +0000 (05:00 +0800)

fix typo in Documentation

Signed-off-by: Guanqun Lu <guanqun.lu@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bash: offer to show (un)staged changesThomas Rast Tue, 3 Feb 2009 09:20:54 +0000 (10:20 +0100)

bash: offer to show (un)staged changes

Add a bit of code to __git_ps1 that lets it append '*' to the branch
name if there are any unstaged changes, and '+' if there are any
staged changes.

Since this is a rather expensive operation and will force a lot of
data into the cache whenever you first enter a repository, you have to
enable it manually by setting GIT_PS1_SHOWDIRTYSTATE to a nonempty
value. The configuration variable bash.showDirtyState can then be
used to disable it again for some repositories.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>