gitweb.git
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>

apply: fix access to an uninitialized mode variable... Johannes Schindelin Wed, 4 Feb 2009 01:50:15 +0000 (02:50 +0100)

apply: fix access to an uninitialized mode variable, found by valgrind

When 'tpatch' was initialized successfully, st_mode was already taken
from the previous diff. We should not try to override it with data
from an lstat() that was never called.

This is a companion patch to 7a07841(git-apply: handle a patch that
touches the same path more than once better).

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

filter-branch: Fix fatal error on bare repositoriesEric Kidd Tue, 3 Feb 2009 18:27:03 +0000 (13:27 -0500)

filter-branch: Fix fatal error on bare repositories

When git filter-branch is run on a bare repository, it prints out a fatal
error message:

$ git filter-branch branch
Rewrite 476c4839280c219c2317376b661d9d95c1727fc3 (9/9)
WARNING: Ref 'refs/heads/branch' is unchanged
fatal: This operation must be run in a work tree

Note that this fatal error message doesn't prevent git filter-branch from
exiting successfully. (Why doesn't git filter-branch actually exit with an
error when a shell command fails? I'm not sure why it was designed this
way.)

This error message is caused by the following section of code at the end of
git-filter-branch.sh:

if [ "$(is_bare_repository)" = false ]; then
unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE
test -z "$ORIG_GIT_DIR" || {
GIT_DIR="$ORIG_GIT_DIR" && export GIT_DIR
}
... elided ...
git read-tree -u -m HEAD
fi

The problem is the call to $(is_bare_repository), which is made before
GIT_DIR and GIT_WORK_TREE are restored. This call always returns "false",
even when we're running in a bare repository. But this means that we will
attempt to call 'git read-tree' even in a bare repository, which will fail
and print an error.

This patch modifies git-filter-branch.sh to restore the original
environment variables before trying to call is_bare_repository.

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

tests: fix test_commit() for case insensitive filesystemsJunio C Hamano Wed, 4 Feb 2009 05:46:33 +0000 (21:46 -0800)

tests: fix test_commit() for case insensitive filesystems

Brian Gernhardt noticed that t3411 was broken recently on case insensitive
filesystems.

0088496 (test-lib.sh: introduce test_commit() and test_merge() helpers,
2009-01-27) used a tag and a file with the same name, only different in
case, and converted many existing tests that needed only a file (or a
tag).

Some tests may want to refer to a rev or a file, but on a filesystem that
loses cases, referring to either without disambiguation mark ("--") on the
command line now triggers an error (t3411 was the only one such test).

Fix it by using a filename that is different from the tagname each step
creates.

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

builtin-remote: make rm() use properly named variable... Jay Soffian Tue, 3 Feb 2009 17:51:12 +0000 (12:51 -0500)

builtin-remote: make rm() use properly named variable to hold return value

"i" is a loop counter and should not be used to hold a return value; use
"result" instead which is consistent with the rest of builtin-remote.c.

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

t3412: further simplify setting of GIT_EDITORJunio C Hamano Wed, 4 Feb 2009 05:07:07 +0000 (21:07 -0800)

t3412: further simplify setting of GIT_EDITOR

2182896 (t3412: clean up GIT_EDITOR usage, 2009-01-30) tried to clean up
the script's use of GIT_EDITOR, but it can further be simplified, because
that is how test-lib.sh sets things up already.

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

receive-pack: explain what to do when push updates... Junio C Hamano Sun, 1 Feb 2009 01:34:05 +0000 (17:34 -0800)

receive-pack: explain what to do when push updates the current branch

This makes "git push" issue a more detailed instruction when a user pushes
into the current branch of a non-bare repository without having an
explicit configuration set to receive.denycurrentbranch. In such a case,
it will also tell the user that the default will change to refusal in a
future version of git.

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

Merge branch 'maint'Junio C Hamano Tue, 3 Feb 2009 08:32:34 +0000 (00:32 -0800)

Merge branch 'maint'

* maint:
grep: pass -I (ignore binary) down to external grep

Merge branch 'maint-1.6.0' into maintJunio C Hamano Tue, 3 Feb 2009 08:32:29 +0000 (00:32 -0800)

Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
grep: pass -I (ignore binary) down to external grep

Merge branch 'jc/maint-add-u-remove-conflicted'Junio C Hamano Tue, 3 Feb 2009 08:26:17 +0000 (00:26 -0800)

Merge branch 'jc/maint-add-u-remove-conflicted'

* jc/maint-add-u-remove-conflicted:
add -u: do not fail to resolve a path as deleted

Merge branch 'jk/maint-cleanup-after-exec-failure'Junio C Hamano Tue, 3 Feb 2009 08:26:12 +0000 (00:26 -0800)

Merge branch 'jk/maint-cleanup-after-exec-failure'

* jk/maint-cleanup-after-exec-failure:
git: use run_command() to execute dashed externals
run_command(): help callers distinguish errors
run_command(): handle missing command errors more gracefully
git: s/run_command/run_builtin/

http-push.c: get_remote_object_url() is only used under... Junio C Hamano Tue, 3 Feb 2009 06:24:40 +0000 (22:24 -0800)

http-push.c: get_remote_object_url() is only used under USE_CURL_MULTI

Otherwise -Wunused-function (which is implied by -Wall) triggers.

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

grep: pass -I (ignore binary) down to external grepJunio C Hamano Mon, 2 Feb 2009 18:58:20 +0000 (10:58 -0800)

grep: pass -I (ignore binary) down to external grep

We forgot to pass this option to the external grep process.

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

In add --patch, Handle K,k,J,j slightly more gracefully.William Pursell Thu, 27 Nov 2008 04:08:03 +0000 (04:08 +0000)

In add --patch, Handle K,k,J,j slightly more gracefully.

Instead of printing the help menu, this will print "No next hunk" and then
process the given hunk again.

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

Add / command in add --patchWilliam Pursell Thu, 27 Nov 2008 04:07:57 +0000 (04:07 +0000)

Add / command in add --patch

This command allows the user to skip hunks that don't match the specified
regex.

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

git-add -i/-p: Change prompt separater from slash to... William Pursell Thu, 27 Nov 2008 04:07:52 +0000 (04:07 +0000)

git-add -i/-p: Change prompt separater from slash to comma

Otherwise the find command '/' soon to be introduced will be hard to see.

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

t3412: use log|name-rev instead of log --graphThomas Rast Fri, 30 Jan 2009 22:47:01 +0000 (23:47 +0100)

t3412: use log|name-rev instead of log --graph

Replace all 'git log --graph' calls for history verification with the
combination of 'git log ...| git name-rev' first introduced by a6c7a27
(rebase -i: correctly remember --root flag across --continue,
2009-01-26). This should be less susceptible to format changes than
the --graph code.

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

gitweb: Update README that gitweb works better with... Jakub Narebski Sun, 1 Feb 2009 21:37:45 +0000 (22:37 +0100)

gitweb: Update README that gitweb works better with PATH_INFO

One had to configure gitweb for it to find static files (stylesheets,
images) when using path_info URLs. Now that it is not necessary
thanks to adding BASE element to HTML head if needed, update README to
reflect this fact.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mailinfo: cleanup extra spaces for complex 'From:'Kirill Smelkov Sun, 1 Feb 2009 17:45:05 +0000 (20:45 +0300)

mailinfo: cleanup extra spaces for complex 'From:'

currently for cases like

From: A U Thor <a.u.thor@example.com> (Comment)

mailinfo extracts the following 'Author:' field:

Author: A U Thor (Comment)
^^
which has two extra spaces left in there after removed email part.

I think this is wrong so here is a fix.

Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'ks/maint-mailinfo-folded'Junio C Hamano Sun, 1 Feb 2009 02:09:17 +0000 (18:09 -0800)

Merge branch 'ks/maint-mailinfo-folded'

* ks/maint-mailinfo-folded:
mailinfo: tests for RFC2047 examples
mailinfo: add explicit test for mails like '<a.u.thor@example.com> (A U Thor)'
mailinfo: 'From:' header should be unfold as well
mailinfo: correctly handle multiline 'Subject:' header

Merge branch 'jc/maint-apply-fix'Junio C Hamano Sun, 1 Feb 2009 02:08:58 +0000 (18:08 -0800)

Merge branch 'jc/maint-apply-fix'

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

Merge branch 'am/maint-push-doc'Junio C Hamano Sun, 1 Feb 2009 02:08:31 +0000 (18:08 -0800)

Merge branch 'am/maint-push-doc'

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

Merge branch 'jc/maint-allow-uninteresting-missing'Junio C Hamano Sun, 1 Feb 2009 02:08:22 +0000 (18:08 -0800)

Merge branch 'jc/maint-allow-uninteresting-missing'

* jc/maint-allow-uninteresting-missing:
revision traversal: allow UNINTERESTING objects to be missing

Merge branch 'jg/tag-contains'Junio C Hamano Sun, 1 Feb 2009 02:07:59 +0000 (18:07 -0800)

Merge branch 'jg/tag-contains'

* jg/tag-contains:
git-tag: Add --contains option
Make has_commit() non-static
Make opt_parse_with_commit() non-static

Merge branch 'js/maint-rebase-i-submodule'Junio C Hamano Sun, 1 Feb 2009 02:07:55 +0000 (18:07 -0800)

Merge branch 'js/maint-rebase-i-submodule'

* js/maint-rebase-i-submodule:
Fix submodule squashing into unrelated commit
rebase -i squashes submodule changes into unrelated commit

Merge branch 'jc/maint-split-diff-metainfo'Junio C Hamano Sun, 1 Feb 2009 02:07:42 +0000 (18:07 -0800)

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

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

Merge branch 'sp/runtime-prefix'Junio C Hamano Sun, 1 Feb 2009 01:43:59 +0000 (17:43 -0800)

Merge branch 'sp/runtime-prefix'

* sp/runtime-prefix:
Windows: Revert to default paths and convert them by RUNTIME_PREFIX
Compute prefix at runtime if RUNTIME_PREFIX is set
Modify setup_path() to only add git_exec_path() to PATH
Add calls to git_extract_argv0_path() in programs that call git_config_*
git_extract_argv0_path(): Move check for valid argv0 from caller to callee
Refactor git_set_argv0_path() to git_extract_argv0_path()
Move computation of absolute paths from Makefile to runtime (in preparation for RUNTIME_PREFIX)

Merge branch 'jk/signal-cleanup'Junio C Hamano Sun, 1 Feb 2009 01:43:56 +0000 (17:43 -0800)

Merge branch 'jk/signal-cleanup'

* jk/signal-cleanup:
t0005: use SIGTERM for sigchain test
pager: do wait_for_pager on signal death
refactor signal handling for cleanup functions
chain kill signals for cleanup functions
diff: refactor tempfile cleanup handling
Windows: Fix signal numbers

Merge branch 'jg/mergetool'Junio C Hamano Sun, 1 Feb 2009 01:43:28 +0000 (17:43 -0800)

Merge branch 'jg/mergetool'

* jg/mergetool:
mergetool: Don't repeat merge tool candidates

Merge branch 'maint'Junio C Hamano Sun, 1 Feb 2009 01:42:26 +0000 (17:42 -0800)

Merge branch 'maint'

* maint:
merge: fix out-of-bounds memory access

Merge branch 'maint-1.6.0' into maintJunio C Hamano Sun, 1 Feb 2009 01:42:17 +0000 (17:42 -0800)

Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
merge: fix out-of-bounds memory access

contrib/difftool: Don't repeat merge tool candidatesDavid Aguilar Sat, 31 Jan 2009 20:27:56 +0000 (12:27 -0800)

contrib/difftool: Don't repeat merge tool candidates

git difftool listed some candidates for mergetools twice, depending on
the environment.

This slightly changes the behavior when both KDE_FULL_SESSION and
GNOME_DESKTOP_SESSION_ID are set at the same time; in such a case
meld is used in favor of kdiff3 (the old code favored kdiff3 in such a
case), but it should not matter in practice.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

contrib/difftool: add support for KompareMarkus Heidelberg Fri, 30 Jan 2009 23:19:29 +0000 (00:19 +0100)

contrib/difftool: add support for Kompare

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Acked-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http-push: refactor request url creationTay Ray Chuan Fri, 30 Jan 2009 23:51:55 +0000 (07:51 +0800)

http-push: refactor request url creation

Introduce two helper functions append_remote_object_url() and
get_remote_object_url() and use them to remove various places
that allocate and format the URL by hand. These functions generate
a URL that point at the fan-out directory inside the remote object
store (e.g. http://host/path/to/repo/objects/a1/) or at an individual
loose object file.

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

merge: fix out-of-bounds memory accessRené Scharfe Sat, 31 Jan 2009 14:39:10 +0000 (15:39 +0100)

merge: fix out-of-bounds memory access

The parameter n of unpack_callback() can have a value of up to
MAX_UNPACK_TREES. The check at the top of unpack_trees() (its only
(indirect) caller) makes sure it cannot exceed this limit.

unpack_callback() passes it and the array src to unpack_nondirectories(),
which has this loop:

for (i = 0; i < n; i++) {
/* ... */
src[i + o->merge] = o->df_conflict_entry;

o->merge can be 0 or 1, so unpack_nondirectories() potentially accesses
the array src at index MAX_UNPACK_TREES. This patch makes it big enough.

Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mergetool: fix running mergetool in sub-directoriesCharles Bailey Fri, 30 Jan 2009 23:20:11 +0000 (23:20 +0000)

mergetool: fix running mergetool in sub-directories

The previous fix to mergetool to use checkout-index instead of cat-file
broke running mergetool anywhere except the root of the repository.

This fixes it by using the correct relative paths for temporary files
and index paths.

Signed-off-by: Charles Bailey <charles@hashpling.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mergetool: Add a test for running mergetool in a sub... Charles Bailey Fri, 30 Jan 2009 23:20:10 +0000 (23:20 +0000)

mergetool: Add a test for running mergetool in a sub-directory

Signed-off-by: Charles Bailey <charles@hashpling.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3412: clean up GIT_EDITOR usageThomas Rast Fri, 30 Jan 2009 22:47:00 +0000 (23:47 +0100)

t3412: clean up GIT_EDITOR usage

a6c7a27 (rebase -i: correctly remember --root flag across --continue,
2009-01-26) introduced a more portable GIT_EDITOR usage, but left the
old tests unchanged.

Since we never use the editor (all tests run the rebase script as
proposed by rebase -i), just disable it outright, which simplifies the
tests.

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

git-shortlog.txt: fix example about .mailmapMichele Ballabio Fri, 30 Jan 2009 16:55:24 +0000 (17:55 +0100)

git-shortlog.txt: fix example about .mailmap

In the example, Joe Developer has <joe@example.com> as his email,
but in the .mailmap is <joe@random.com>. Use example.com instead.

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-cvsserver: run post-update hook *after* update.Stefan Karpinski Thu, 29 Jan 2009 21:58:02 +0000 (13:58 -0800)

git-cvsserver: run post-update hook *after* update.

CVS server was running the hook before the update action was
actually done. This performs the update before the hook is called.

The original commit that introduced the current incorrect behavior
was 394d66d "git-cvsserver runs hooks/post-update". The error in
ordering of the hook call appears to have gone unnoticed, but since
git-cvsserver is supposed to emulate receive-pack, it stands to
reason that the hook should be run *after* the update. Since this
behavior is inconsistent with recieve-pack, users are either:

1) not using post-update hooks with git-cvsserver;
2) using post-update hooks that don't care whether they are
called before or after the actual update occurs;
3) using post-update hooks *only* with git-cvsserver, and
relying on the hook being called just before the update.

This patch would affect only users in case 3. These users are
depending on fairly obviously wrong behavior, and moreover they can
simply change their current post-update into post-recieve hooks,
and their systems will work correctly again.

Signed-off-by: Stefan Karpinski <stefan.karpinski@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix 'git diff --no-index' with a non-existing symlink... Johannes Schindelin Thu, 29 Jan 2009 16:30:51 +0000 (17:30 +0100)

Fix 'git diff --no-index' with a non-existing symlink target

When trying to find out mode changes, we should not access the symlink
targets using stat(); instead we use lstat() so that the diff does
not fail trying to find a non-existing symlink target.

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

gitweb: align comments to codeGiuseppe Bilotta Sat, 31 Jan 2009 01:31:52 +0000 (02:31 +0100)

gitweb: align comments to code

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: webserver config for PATH_INFOGiuseppe Bilotta Sat, 31 Jan 2009 01:31:51 +0000 (02:31 +0100)

gitweb: webserver config for PATH_INFO

Document some possible Apache configurations when the path_info feature
is enabled in gitweb.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: make static files accessible with PATH_INFOGiuseppe Bilotta Sat, 31 Jan 2009 01:31:50 +0000 (02:31 +0100)

gitweb: make static files accessible with PATH_INFO

Gitweb links to a number of static files such as CSS stylesheets,
favicon or the git logo. When, such as with the default Makefile, the
paths to these files are relative (i.e. doesn't start with a "/"), the
files become inaccessible in any view other tha project list and summary
page if gitweb is invoked with a non-empty PATH_INFO.

Fix this by adding a <base> element pointing to the script's own URL,
which ensure that all relative paths will be resolved correctly.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-cvsserver: handle CVS 'noop' command.Stefan Karpinski Fri, 30 Jan 2009 01:12:27 +0000 (17:12 -0800)

git-cvsserver: handle CVS 'noop' command.

The CVS protocol documentation, found at

http://www.wandisco.com/techpubs/cvs-protocol.pdf

states the following about the 'noop' command:

Response expected: yes. This request is a null command
in the sense that it doesn't do anything, but merely
(as with any other requests expecting a response) sends
back any responses pertaining to pending errors, pending
Notified responses, etc.

In accordance with this, the correct way to handle the 'noop'
command, when issued by a client, is to call req_EMPTY.

The 'noop' command is called by some CVS clients, notably
TortoiseCVS, thus making it desirable for git-cvsserver to
respond to the command rather than choking on it as unknown.

Signed-off-by: Stefan Karpinski <stefan.karpinski@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fsck: check loose objects from alternate object stores... Junio C Hamano Fri, 30 Jan 2009 08:50:54 +0000 (00:50 -0800)

fsck: check loose objects from alternate object stores by default

"git fsck" used to validate only loose objects that are local and nothing
else by default. This is not just too little when a repository is
borrowing objects from other object stores, but also caused the
connectivity check to mistakenly declare loose objects borrowed from them
to be missing.

The rationale behind the default mode that validates only loose objects is
because these objects are still young and more unlikely to have been
pushed to other repositories yet. That holds for loose objects borrowed
from alternate object stores as well.

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

fsck: HEAD is part of refsJunio C Hamano Fri, 30 Jan 2009 08:33:00 +0000 (00:33 -0800)

fsck: HEAD is part of refs

By default we looked at all refs but not HEAD. The only thing that made
fsck not lose sight of commits that are only reachable from a detached
HEAD was the reflog for the HEAD.

This fixes it, with a new test.

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

t0005: use SIGTERM for sigchain testJeff King Fri, 30 Jan 2009 08:21:01 +0000 (03:21 -0500)

t0005: use SIGTERM for sigchain test

The signal tests consists of checking that each of our
handlers is executed, and that the test program was killed
by the final signal. We arbitrarily used SIGINT as the kill
signal.

However, some platforms (notably Solaris) will default
SIGINT to SIG_IGN if there is no controlling terminal. In
that case, we don't end up killing the program with the
final signal and the test fails.

This is a problem since the test script should not depend
on outside factors; let's use SIGTERM instead, which should
behave consistently.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

symbolic ref: refuse non-ref targets in HEADJeff King Thu, 29 Jan 2009 08:33:02 +0000 (03:33 -0500)

symbolic ref: refuse non-ref targets in HEAD

When calling "git symbolic-ref" it is easy to forget that
the target must be a fully qualified ref. E.g., you might
accidentally do:

$ git symbolic-ref HEAD master

Unfortunately, this is very difficult to recover from,
because the bogus contents of HEAD make git believe we are
no longer in a git repository (as is_git_dir explicitly
checks for "^refs/heads/" in the HEAD target). So
immediately trying to fix the situation doesn't work:

$ git symbolic-ref HEAD refs/heads/master
fatal: Not a git repository

and one is left editing the .git/HEAD file manually.

Furthermore, one might be tempted to use symbolic-ref to set
up a detached HEAD:

$ git symbolic-ref HEAD `git rev-parse HEAD`

which sets up an even more bogus HEAD:

$ cat .git/HEAD
ref: 1a9ace4f2ad4176148e61b5a85cd63d5604aac6d

This patch introduces a small safety valve to prevent the
specific case of anything not starting with refs/heads/ to
go into HEAD. The scope of the safety valve is intentionally
very limited, to make sure that we are not preventing any
behavior that would otherwise be valid (like pointing a
different symref than HEAD outside of refs/heads/).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

validate_headref: tighten ref-matching to just branchesJeff King Thu, 29 Jan 2009 08:30:16 +0000 (03:30 -0500)

validate_headref: tighten ref-matching to just branches

When we are trying to determine whether a directory contains
a git repository, one of the tests we do is to check whether
HEAD is either a symlink or a symref into the "refs/"
hierarchy, or a detached HEAD.

We can tighten this a little more, though: a non-detached
HEAD should always point to a branch (since checking out
anything else should result in detachment), so it is safe to
check for "refs/heads/".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes to 1.6.2Junio C Hamano Thu, 29 Jan 2009 08:57:42 +0000 (00:57 -0800)

Update draft release notes to 1.6.2

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

Sync with 1.6.1.2Junio C Hamano Thu, 29 Jan 2009 08:32:52 +0000 (00:32 -0800)

Sync with 1.6.1.2

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

GIT 1.6.1.2 v1.6.1.2Junio C Hamano Thu, 29 Jan 2009 08:12:52 +0000 (00:12 -0800)

GIT 1.6.1.2

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

Merge branch 'jc/maint-format-patch-o-relative' into... Junio C Hamano Thu, 29 Jan 2009 07:56:13 +0000 (23:56 -0800)

Merge branch 'jc/maint-format-patch-o-relative' into maint

* jc/maint-format-patch-o-relative:
Teach format-patch to handle output directory relative to cwd

Conflicts:
t/t4014-format-patch.sh

Merge branch 'bs/maint-rename-populate-filespec' into... Junio C Hamano Thu, 29 Jan 2009 07:42:57 +0000 (23:42 -0800)

Merge branch 'bs/maint-rename-populate-filespec' into maint

* bs/maint-rename-populate-filespec:
Rename detection: Avoid repeated filespec population

Merge branch 'mh/maint-commit-color-status' into maintJunio C Hamano Thu, 29 Jan 2009 07:42:53 +0000 (23:42 -0800)

Merge branch 'mh/maint-commit-color-status' into maint

* mh/maint-commit-color-status:
git-status -v: color diff output when color.ui is set
git-commit: color status output when color.ui is set

Merge branch 'nd/grep-assume-unchanged' into maintJunio C Hamano Thu, 29 Jan 2009 07:42:41 +0000 (23:42 -0800)

Merge branch 'nd/grep-assume-unchanged' into maint

* nd/grep-assume-unchanged:
grep: grep cache entries if they are "assume unchanged"
grep: support --no-ext-grep to test builtin grep

Merge branch 'jc/maint-ls-tree' into maintJunio C Hamano Thu, 29 Jan 2009 07:42:15 +0000 (23:42 -0800)

Merge branch 'jc/maint-ls-tree' into maint

* jc/maint-ls-tree:
Document git-ls-tree --full-tree
ls-tree: add --full-tree option

Merge branch 'np/no-loosen-prune-expire-now' into maintJunio C Hamano Thu, 29 Jan 2009 07:42:10 +0000 (23:42 -0800)

Merge branch 'np/no-loosen-prune-expire-now' into maint

* np/no-loosen-prune-expire-now:
objects to be pruned immediately don't have to be loosened

Merge branch 'mc/cd-p-pwd' into maintJunio C Hamano Thu, 29 Jan 2009 07:41:56 +0000 (23:41 -0800)

Merge branch 'mc/cd-p-pwd' into maint

* mc/cd-p-pwd:
git-sh-setup: Fix scripts whose PWD is a symlink to a work-dir on OS X

Merge branch 'maint-1.6.0' into maintJunio C Hamano Thu, 29 Jan 2009 07:41:28 +0000 (23:41 -0800)

Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
avoid 31-bit truncation in write_loose_object

avoid 31-bit truncation in write_loose_objectJeff King Thu, 29 Jan 2009 05:56:34 +0000 (00:56 -0500)

avoid 31-bit truncation in write_loose_object

The size of the content we are adding may be larger than
2.1G (i.e., "git add gigantic-file"). Most of the code-path
to do so uses size_t or unsigned long to record the size,
but write_loose_object uses a signed int.

On platforms where "int" is 32-bits (which includes x86_64
Linux platforms), we end up passing malloc a negative size.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Simplify t3412Johannes Schindelin Tue, 27 Jan 2009 22:35:09 +0000 (23:35 +0100)

Simplify t3412

Use the newly introduced test_commit() and test_merge() helpers.

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

Simplify t3411Johannes Schindelin Tue, 27 Jan 2009 22:35:05 +0000 (23:35 +0100)

Simplify t3411

Use test_commit() and test_merge(). This way, it is harder to forget to
tag, or to call test_tick before committing.

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

Simplify t3410Johannes Schindelin Tue, 27 Jan 2009 22:34:54 +0000 (23:34 +0100)

Simplify t3410

Use test_commit() and test_merge(), reducing the code while making the
intent clearer.

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

test-lib.sh: introduce test_commit() and test_merge... Johannes Schindelin Tue, 27 Jan 2009 22:34:48 +0000 (23:34 +0100)

test-lib.sh: introduce test_commit() and test_merge() helpers

Often we just need to add a commit with a given (short) name, that will
be tagged with the same name. Now, relatively complicated graphs can be
constructed easily and in a clear fashion:

test_commit A &&
test_commit B &&
git checkout A &&
test_commit C &&
test_merge D B

will construct this graph:

A - B
\ \
C - D

For simplicity, files whose name is the lower case version of the commit
message (to avoid a warning about ambiguous names) will be committed, with
the corresponding commit messages as contents.

If you need to provide a different file/different contents, you can use
the more explicit form

test_commit $MESSAGE $FILENAME $CONTENTS

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

lib-rebase.sh: Document what set_fake_editor() doesJohannes Schindelin Tue, 27 Jan 2009 22:34:35 +0000 (23:34 +0100)

lib-rebase.sh: Document what set_fake_editor() does

Make it easy for other authors to use rebase tests' fake-editor.

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

t3404 & t3411: undo copy&pasteJohannes Schindelin Tue, 27 Jan 2009 22:34:29 +0000 (23:34 +0100)

t3404 & t3411: undo copy&paste

Rather than copying and pasting, which is prone to lead to fixes
missing in one version, move the fake-editor generator to t/t3404/.

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

add -u: do not fail to resolve a path as deletedJunio C Hamano Wed, 28 Jan 2009 22:24:53 +0000 (14:24 -0800)

add -u: do not fail to resolve a path as deleted

After you resolve a conflicted merge to remove the path, "git add -u"
failed to record the removal. Instead it errored out by saying that the
removed path is not found in the work tree, but that is what the user
already knows, and the wanted to record the removal as the resolution,
so the error does not make sense.

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

builtin-apply.c: do not set bogus mode in check_preimag... Junio C Hamano Mon, 26 Jan 2009 07:41:26 +0000 (23:41 -0800)

builtin-apply.c: do not set bogus mode in check_preimage() for deleted path

If it is deleted, it is deleted. Do not set the current mode to it.

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

mailinfo: tests for RFC2047 examplesKirill Smelkov Mon, 12 Jan 2009 22:21:04 +0000 (01:21 +0300)

mailinfo: tests for RFC2047 examples

Also as suggested by Junio, in order to try to catch other MIME
problems, test cases from the "8. Examples" section of RFC2047 are added
to t5100 testsuite as well.

Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>

mailinfo: add explicit test for mails like '<a.u.thor... Kirill Smelkov Tue, 13 Jan 2009 09:33:48 +0000 (12:33 +0300)

mailinfo: add explicit test for mails like '<a.u.thor@example.com> (A U Thor)'

Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>

Merge branch 'tr/previous-branch'Junio C Hamano Wed, 28 Jan 2009 23:00:27 +0000 (15:00 -0800)

Merge branch 'tr/previous-branch'

* tr/previous-branch:
t1505: remove debugging cruft
Simplify parsing branch switching events in reflog
Introduce for_each_recent_reflog_ent().
interpret_nth_last_branch(): plug small memleak
Fix reflog parsing for a malformed branch switching entry
Fix parsing of @{-1}@{1}
interpret_nth_last_branch(): avoid traversing the reflog twice
checkout: implement "-" abbreviation, add docs and tests
sha1_name: support @{-N} syntax in get_sha1()
sha1_name: tweak @{-N} lookup
checkout: implement "@{-N}" shortcut name for N-th last branch

Conflicts:
sha1_name.c