gitweb.git
Merge branch 'dw/gitweb-doc-grammo'Junio C Hamano Fri, 23 Mar 2012 21:36:13 +0000 (14:36 -0700)

Merge branch 'dw/gitweb-doc-grammo'

Typofix.

* dw/gitweb-doc-grammo:
Documentation/gitweb: trivial English fixes

merge-recursive: don't detect renames of empty filesJeff King Thu, 22 Mar 2012 22:52:24 +0000 (18:52 -0400)

merge-recursive: don't detect renames of empty files

Merge-recursive detects renames so that if one side modifies
"foo" and the other side moves it to "bar", the modification
is applied to "bar". However, our rename detection is based
on content analysis, it can be wrong (i.e., two files were
not intended as a rename, but just happen to have the same
or similar content).

This is quite rare if the files actually contain content,
since two unrelated files are unlikely to have exactly the
same content. However, empty files present a problem, in
that there is nothing to analyze. An uninteresting
placeholder file with zero bytes may or may not be related
to a placeholder file with another name.

The result is that adding content to an empty file may cause
confusion if the other side of a merge removed it; your
content may end up in another random placeholder file that
was added.

Let's err on the side of caution and not consider empty
files as renames. This will cause a modify/delete conflict
on the merge, which will let the user sort it out
themselves.

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

teach diffcore-rename to optionally ignore empty contentJeff King Thu, 22 Mar 2012 22:52:13 +0000 (18:52 -0400)

teach diffcore-rename to optionally ignore empty content

Our rename detection is a heuristic, matching pairs of
removed and added files with similar or identical content.
It's unlikely to be wrong when there is actual content to
compare, and we already take care not to do inexact rename
detection when there is not enough content to produce good
results.

However, we always do exact rename detection, even when the
blob is tiny or empty. It's easy to get false positives with
an empty blob, simply because it is an obvious content to
use as a boilerplate (e.g., when telling git that an empty
directory is worth tracking via an empty .gitignore).

This patch lets callers specify whether or not they are
interested in using empty files as rename sources and
destinations. The default is "yes", keeping the original
behavior. It works by detecting the empty-blob sha1 for
rename sources and destinations.

One more flexible alternative would be to allow the caller
to specify a minimum size for a blob to be "interesting" for
rename detection. But that would catch small boilerplate
files, not large ones (e.g., if you had the GPL COPYING file
in many directories).

A better alternative would be to allow a "-rename"
gitattribute to allow boilerplate files to be marked as
such. I'll leave the complexity of that solution until such
time as somebody actually wants it. The complaints we've
seen so far revolve around empty files, so let's start with
the simple thing.

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

make is_empty_blob_sha1 available everywhereJeff King Thu, 22 Mar 2012 18:53:39 +0000 (14:53 -0400)

make is_empty_blob_sha1 available everywhere

The read-cache implementation defines this static function,
but it is a generally useful concept in git. Let's give
the empty blob the same treatment as the empty tree,
providing both hex and binary forms of the sha1.

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

drop casts from users EMPTY_TREE_SHA1_BINJeff King Thu, 22 Mar 2012 18:53:24 +0000 (14:53 -0400)

drop casts from users EMPTY_TREE_SHA1_BIN

This macro already evaluates to the correct type, as it
casts the string literal to "unsigned char *" itself
(and callers who want the literal can use the _LITERAL
form).

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

Documentation/gitweb: trivial English fixesD Waitzman Fri, 23 Mar 2012 15:02:43 +0000 (11:02 -0400)

Documentation/gitweb: trivial English fixes

Change "it's" to "its" where a possessive is intended. Also add two
missing "the" that were noticed by Ben Walton.

Signed-off-by: David Waitzman <djw@bbn.com>

gitk: Add menu items for comparing a commit with the... Paul Mackerras Fri, 23 Mar 2012 11:07:27 +0000 (22:07 +1100)

gitk: Add menu items for comparing a commit with the marked commit

Sometimes one wants to see the different between two commits that are
a long distance apart in the graph display. This is difficult to do
with the "Diff this -> selected" and "Diff selected -> this" menu
items because the need to maintain the selection means that one can't
use the find facilities or the reference list window to navigate from
one to the other.

This provides an alternative using the mark. Having found one commit,
one marks it with the "Mark this commit" menu item, then navigates to
the other commit and uses the new "Diff this -> marked commit" and/or
"Diff marked commit -> this" menu items.

Signed-off-by: Paul Mackerras <paulus@samba.org>

contrib/completion: "local var=()" is misinterpreted... Alex Merry Thu, 1 Sep 2011 13:47:31 +0000 (14:47 +0100)

contrib/completion: "local var=()" is misinterpreted as func-decl by zsh

Certain versions of zsh seems to treat

local var=()

as a function declaration, rather than an assignment of an empty array,
although its documentation does not suggest that this should be the case.

With zsh 4.3.15 on Fedora Core 15, this causes

__git_ps1 " (%s)"

to trigger an error message:

local:2: command not found: svn_url_pattern

when GIT_PS1_SHOWUPSTREAM="auto".

Signed-off-by: Alex Merry <dev@randomguy3.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Tue, 20 Mar 2012 22:54:28 +0000 (15:54 -0700)

Merge branch 'maint'

* maint:

Merge branch 'maint-1.7.8' into maintJunio C Hamano Tue, 20 Mar 2012 22:53:30 +0000 (15:53 -0700)

Merge branch 'maint-1.7.8' into maint

* maint-1.7.8:
t/Makefile: Use $(sort ...) explicitly where needed
gitweb: Fix actionless dispatch for non-existent objects
i18n of multi-line advice messages

merge: backport GIT_MERGE_AUTOEDIT supportJunio C Hamano Tue, 20 Mar 2012 22:39:10 +0000 (15:39 -0700)

merge: backport GIT_MERGE_AUTOEDIT support

Even though 1.7.9.x series does not open the editor by default
when merging in general, it does do so in one occassion: when
merging an annotated tag. And worse yet, there is no good way
for older scripts to decline this.

Backport the support for GIT_MERGE_AUTOEDIT environment variable
from 1.7.10 track to help those stuck on 1.7.9.x maintenance
track.

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

Merge branch 'ks/sort-wildcard-in-makefile' into maint... Junio C Hamano Tue, 20 Mar 2012 22:26:19 +0000 (15:26 -0700)

Merge branch 'ks/sort-wildcard-in-makefile' into maint-1.7.8

* ks/sort-wildcard-in-makefile:
t/Makefile: Use $(sort ...) explicitly where needed

Merge branch 'jc/advise-i18n' into maint-1.7.8Junio C Hamano Tue, 20 Mar 2012 22:25:38 +0000 (15:25 -0700)

Merge branch 'jc/advise-i18n' into maint-1.7.8

* jc/advise-i18n:
i18n of multi-line advice messages

Merge branch 'jn/gitweb-unspecified-action' into maint... Junio C Hamano Tue, 20 Mar 2012 22:24:23 +0000 (15:24 -0700)

Merge branch 'jn/gitweb-unspecified-action' into maint-1.7.8

* jn/gitweb-unspecified-action:
gitweb: Fix actionless dispatch for non-existent objects

rebase -i: remind that the lines are top-to-bottomJunio C Hamano Fri, 16 Mar 2012 14:48:33 +0000 (07:48 -0700)

rebase -i: remind that the lines are top-to-bottom

Nelson Benitez Leon opened a discussion with a patch with this in the
note:

Hi, I was using git rebase -i for some time now and never occured to
me I could reorder the commit lines to affect the order the commits
are applied, learnt that recently from a git tutorial.

Nelson's patch was to stress the fact that the lines in the insn sheet can
be re-ordered in a much more verbose way. Let's add a one-liner reminder
and also remind that the lines in the insn sheet is read from top to
bottom, unlike the "git log" output.

Discussion-triggered-by: Nelson Benitez Leon
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t4202: add test for "log --graph --stat -p" separator... Lucian Poston Tue, 20 Mar 2012 08:05:34 +0000 (01:05 -0700)

t4202: add test for "log --graph --stat -p" separator lines

Add tests to make sure that the three-dash separator lines appear
after the graph ancestry lines, and also the graph ancestry lines
are not broken between the diffstat and the patch.

Signed-off-by: Lucian Poston <lucian.poston@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

log --graph: fix break in graph linesLucian Poston Tue, 20 Mar 2012 08:05:34 +0000 (01:05 -0700)

log --graph: fix break in graph lines

Output from "git log --graph --stat -p" broke the ancestry graph lines
with a single empty line between the diffstat and the patch.

Signed-off-by: Lucian Poston <lucian.poston@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

log --graph --stat: three-dash separator should come... Lucian Poston Tue, 20 Mar 2012 08:05:34 +0000 (01:05 -0700)

log --graph --stat: three-dash separator should come after graph lines

Output from "git log --graph --stat -p" emits the three-dash separator
line before the graph that shows ancestry lines. The separator should
come after the ancestry lines just like all the other output.

Signed-off-by: Lucian Poston <lucian.poston@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

push: Provide situational hints for non-fast-forward... Christopher Tiwald Tue, 20 Mar 2012 04:31:33 +0000 (00:31 -0400)

push: Provide situational hints for non-fast-forward errors

Pushing a non-fast-forward update to a remote repository will result in
an error, but the hint text doesn't provide the correct resolution in
every case. Give better resolution advice in three push scenarios:

1) If you push your current branch and it triggers a non-fast-forward
error, you should merge remote changes with 'git pull' before pushing
again.

2) If you push to a shared repository others push to, and your local
tracking branches are not kept up to date, the 'matching refs' default
will generate non-fast-forward errors on outdated branches. If this is
your workflow, the 'matching refs' default is not for you. Consider
setting the 'push.default' configuration variable to 'current' or
'upstream' to ensure only your current branch is pushed.

3) If you explicitly specify a ref that is not your current branch or
push matching branches with ':', you will generate a non-fast-forward
error if any pushed branch tip is out of date. You should checkout the
offending branch and merge remote changes before pushing again.

Teach transport.c to recognize these scenarios and configure push.c
to hint for them. If 'git push's default behavior changes or we
discover more scenarios, extension is easy. Standardize on the
advice API and add three new advice variables, 'pushNonFFCurrent',
'pushNonFFDefault', and 'pushNonFFMatching'. Setting any of these
to 'false' will disable their affiliated advice. Setting
'pushNonFastForward' to false will disable all three, thus preserving the
config option for users who already set it, but guaranteeing new
users won't disable push advice accidentally.

Based-on-patch-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Christopher Tiwald <christiwald@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7800: Test difftool passing arguments to diffDavid Aguilar Sat, 17 Mar 2012 03:54:37 +0000 (20:54 -0700)

t7800: Test difftool passing arguments to diff

git-difftool relies on the ability to forward unknown arguments
to the git-diff command. Add a test to ensure that this works
as advertised.

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

gitk: Speed up resolution of short SHA1 idsPaul Mackerras Mon, 19 Mar 2012 00:21:08 +0000 (11:21 +1100)

gitk: Speed up resolution of short SHA1 ids

On large repositories such as the Linux kernel, it can take quite a
noticeable time (several seconds) for gitk to resolve short SHA1 IDs
to their long form. This speeds up the process by maintaining lists
of IDs indexed by the first 4 characters of the SHA1 ID, speeding up
the search by a factor of 65536 on large repositories.

Signed-off-by: Paul Mackerras <paulus@samba.org>

gitk: Use symbolic font names "sans" and "monospace... Jonathan Nieder Thu, 8 Mar 2012 12:30:11 +0000 (06:30 -0600)

gitk: Use symbolic font names "sans" and "monospace" when available

The following only concerns systems using X and the client-side font
rendering framework from freedesktop.org. Windows and Mac OS X are
not affected.

Starting with version 8.5, Tk uses freetype and fontconfig by default
to render fonts on platforms that support it. Gitk currently defaults
to the font Helvetica for the interface and Courier for diffs, and
both unfortunately look rather bad on screen in the default
configuration on many Linux distros with anti-aliasing and poor
hinting.

It is better to default to "sans" and "monospace", which are mapped by
fontconfig to some appropriate font of the sysadmin and user's
choosing (typically Bitstream Vera Sans and Mono). The result looks
more sensible and it makes gitk feel like a well-behaved software
citizen since its fonts match other native apps.

This patch does not change the appearance of gitk for users that have
already run it, since gitk uses the remembered UI and diff font names
from ~/.gitk.

Requested-by: Michael Biebl <biebl@debian.org>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Acked-by: Mark Hills <mark@pogo.org.uk>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

gitk: Skip over AUTHOR/COMMIT_DATE when searching all... Frédéric Brière Sun, 14 Mar 2010 22:59:09 +0000 (18:59 -0400)

gitk: Skip over AUTHOR/COMMIT_DATE when searching all fields

This prevents a search for a number like "105" on "All Fields" from
matching against the raw author and commit timestamps. These
timestamps were already not searchable by themselves, and the
displayed format does not match the query string anyway.

Signed-off-by: Frédéric Brière <fbriere@fbriere.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

gitk: Make "git describe" output clickable, tooJim Meyering Sat, 10 Dec 2011 15:08:57 +0000 (16:08 +0100)

gitk: Make "git describe" output clickable, too

Automake's contribution guidelines suggest using "git describe" output
in commit logs to reference previous commits. By contrast, in
coreutils, I had acquired the habit of using a bare SHA1 prefix (8 hex
digits), since gitk creates clickable links for that, and not for "git
describe" output.

I prefer the readability of the full "git describe" output, yet want
to retain the gitk links, so this renders as clickable not just
SHA1-like strings, but also an SHA1-like string that is prefixed by
"-g".

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

gitk: Fix the display of files when filtered by pathPat Thoyts Tue, 13 Dec 2011 16:50:50 +0000 (16:50 +0000)

gitk: Fix the display of files when filtered by path

Launching 'gitk -- .' or 'gitk -- ..\t' restricts the display to files
under the given directory but the file list is left empty. This is because
the path_filter function fails to match the filenames which are relative
to the working tree to the filter which is filessytem relative.
This solves the problem by making both names fully qualified filesystem
paths before performing the comparison.

Tested-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>

gitk: Use a tabbed dialog to edit preferencesPat Thoyts Tue, 13 Dec 2011 14:56:49 +0000 (14:56 +0000)

gitk: Use a tabbed dialog to edit preferences

This commit converts the user preferences dialog into a tabbed property
sheet grouping general properties, colours and font selections onto
separate pages. The previous implementation was exceeding the screen
height on some systems and this avoids such problems and permits extension
using new pages in the future.

If themed Tk is unavailable or undesired a reasonable facsimile of the
tabbed notebook widget is used instead.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>

gitk: Use "gitk: repo-top-level-dir" as window titleZbigniew Jędrzejewski-Szmek Wed, 9 Nov 2011 16:28:28 +0000 (17:28 +0100)

gitk: Use "gitk: repo-top-level-dir" as window title

Previously, when run in a subdirectory, gitk would show the name
of this subdirectory as title, which was misleading. When run with
GIT_DIR set, it would show the cwd, which is even more misleading.

In case of non-bare repos, the .git suffix in the path is skipped.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>

Merge branch 'ab/perl-i18n'Junio C Hamano Fri, 16 Mar 2012 16:16:17 +0000 (09:16 -0700)

Merge branch 'ab/perl-i18n'

* ab/perl-i18n:
perl/Makefile: install Git::I18N under NO_PERL_MAKEMAKER
Git::I18N: compatibility with perl <5.8.3

perl/Makefile: install Git::I18N under NO_PERL_MAKEMAKERÆvar Arnfjörð Bjarmason Sat, 10 Mar 2012 12:29:35 +0000 (12:29 +0000)

perl/Makefile: install Git::I18N under NO_PERL_MAKEMAKER

When I added the i18n infrastructure in v1.7.8-rc2-1-g5e9637c I forgot
to install Git::I18N also when NO_PERL_MAKEMAKER=YesPlease was
set. Change the generation of the fallback perl.mak file to do that.

Now Git/I18N.pm is installed alongside Git.pm in such a way that
anything that uses GITPERLLIB will find it.

Reported-by: Tom G. Christensen <tgc@statsbiblioteket.dk>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes to 1.7.10Junio C Hamano Fri, 16 Mar 2012 15:42:22 +0000 (08:42 -0700)

Update draft release notes to 1.7.10

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

Merge branch 'th/mergetools-deltawalker'Junio C Hamano Fri, 16 Mar 2012 15:24:19 +0000 (08:24 -0700)

Merge branch 'th/mergetools-deltawalker'

* th/mergetools-deltawalker:
Documentation/difftool: add deltawalker to list of valid diff tools

Merge branch 'jc/maint-verify-objects-remove-pessimism'Junio C Hamano Fri, 16 Mar 2012 15:23:53 +0000 (08:23 -0700)

Merge branch 'jc/maint-verify-objects-remove-pessimism'

The code to validate the history connectivity between old refs and new
refs used by fetch and receive-pack, introduced in 1.7.8, was grossly
inefficient and unnecessarily tried to re-validate integrity of individual
objects. This essentially reverts that performance regression.

* jc/maint-verify-objects-remove-pessimism:
fetch/receive: remove over-pessimistic connectivity check

Merge branch 'sl/customize-sane-tool-path'Junio C Hamano Fri, 16 Mar 2012 15:23:34 +0000 (08:23 -0700)

Merge branch 'sl/customize-sane-tool-path'

* sl/customize-sane-tool-path:
configure: allow user to prevent $PATH "sanitization" on Solaris

Merge "two fixes for fast-import's 'ls' command" from... Junio C Hamano Fri, 16 Mar 2012 15:19:18 +0000 (08:19 -0700)

Merge "two fixes for fast-import's 'ls' command" from Jonathan

Andrew Sayers noticed that the svn-fe | git fast-import pipeline
mishandles a subversion history that copies the root directory to a
sub-directory (e.g. doing `svn cp . trunk` to standardise your
layout). As David Barr explained, the bug arises when the following
command is sent to git fast-import:

'ls' SP ':1' SP LF

Instead of reading back what is at the root of r1, it unconditionally
reports the path as missing.

After sleeping on it, here are two patches for 'maint'. One plugs a
memory leak. The other ensures that trying to pass an empty path to
the 'ls' command results in an error message that can help the
frontend author instead of the silently broken conversion Andrew
found.

Then we can carefully add 'ls ""' support in 1.7.11.

* commit 'refs/pull-request-tags/jn/maint-fast-import-empty-ls':
fast-import: don't allow 'ls' of path with empty components
fast-import: leakfix for 'ls' of dirty trees

l10n: Update zh_CN translation for Git 1.7.10-rc1Jiang Xin Fri, 16 Mar 2012 14:35:58 +0000 (22:35 +0800)

l10n: Update zh_CN translation for Git 1.7.10-rc1

Translate 1 new message from Git 1.7.10-rc1: "Gitdir '$a' is ..."

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>

l10n: Update git.pot (1 new message)Jiang Xin Fri, 16 Mar 2012 12:28:05 +0000 (20:28 +0800)

l10n: Update git.pot (1 new message)

Changes of po/git.pot from v1.7.10-rc0 to v1.7.10-rc1:

* 1 new l10n message at line: 3361.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>

Merge v1.7.10-rc0 for git l10n updateJiang Xin Fri, 16 Mar 2012 12:18:07 +0000 (20:18 +0800)

Merge v1.7.10-rc0 for git l10n update

Merge branch 'th/git-diffall'Junio C Hamano Fri, 16 Mar 2012 04:54:42 +0000 (21:54 -0700)

Merge branch 'th/git-diffall'

* th/git-diffall:
contrib/diffall: fix cleanup trap on Windows
contrib/diffall: eliminate duplicate while loops
contrib/diffall: eliminate use of tar
contrib/diffall: create tmp dirs without mktemp
contrib/diffall: comment actual reason for 'cdup'

Merge branch 'th/doc-diff-submodule-option'Junio C Hamano Fri, 16 Mar 2012 04:54:30 +0000 (21:54 -0700)

Merge branch 'th/doc-diff-submodule-option'

* th/doc-diff-submodule-option:
Documentation/diff-options: reword description of --submodule option

fetch/receive: remove over-pessimistic connectivity... Junio C Hamano Thu, 15 Mar 2012 21:57:02 +0000 (14:57 -0700)

fetch/receive: remove over-pessimistic connectivity check

Git 1.7.8 introduced an object and history re-validation step after
"fetch" or "push" causes new history to be added to a receiving
repository. This is to protect a malicious server or pushing client from
corrupting the repository by taking advantage of an existing corrupt
object that is unconnected to existing history.

But this check is way over-pessimistic. During "fetch" or "receive-pack"
(the server side of "push"), unpack-objects and index-pack already
validate individual objects that are received, and the only thing we would
want to catch are corrupted objects that already happen to exist in our
repository but are not referenced from our refs. Such objects must have
been written by an earlier run of our codepaths that write out loose
objects or packfiles, and they must have done the validation of individual
objects when they did so. The only thing left to worry about is the
connectivity integrity, which can be checked with "rev-list --objects",
which is much cheaper. We have been paying the 5x to 8x runtime overhead
the --verify-objects often adds for no real gain.

Revert check_everything_connected() not to use this over-pessimistic
check.

Credit goes to Nguyễn Thái Ngọc Duy, who originally identified the
performance regression and endured multiple rounds of reviews to fix it.

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

Documentation/difftool: add deltawalker to list of... Tim Henigan Thu, 15 Mar 2012 16:28:26 +0000 (12:28 -0400)

Documentation/difftool: add deltawalker to list of valid diff tools

deltawalker has been supported since 284a126c3ef3, but was not added
to the list of valid diff tools reported by 'git difftool --help'.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

clean: preserve nested git worktree in subdirectoriesJunio C Hamano Thu, 15 Mar 2012 08:04:12 +0000 (01:04 -0700)

clean: preserve nested git worktree in subdirectories

remove_dir_recursively() has a check to avoid removing the directory it
was asked to remove without recursing into it and report success when the
directory is the top level of a working tree of a nested git repository,
to protect such a repository from "clean -f" (without double -f). If a
working tree of a nested git repository is in a subdirectory of a toplevel
project, however, this protection did not apply by mistake; we forgot to
pass the REMOVE_DIR_KEEP_NESTED_GIT down to the recursive removal
codepath.

This requires us to also teach the higher level not to remove the
directory it is asked to remove, when the recursed invocation did not
remove the directory it was asked to remove due to a nested git
repository, as it is not an error to leave the parent directories of such
a nested repository.

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

notes-merge: Don't remove .git/NOTES_MERGE_WORKTREE... Johan Herland Thu, 15 Mar 2012 14:58:56 +0000 (15:58 +0100)

notes-merge: Don't remove .git/NOTES_MERGE_WORKTREE; it may be the user's cwd

When a manual notes merge is committed or aborted, we need to remove the
temporary worktree at .git/NOTES_MERGE_WORKTREE. However, removing the
entire directory is not good if the user ran the 'git notes merge
--commit/--abort' from within that directory. On Windows, the directory
removal would simply fail, while on POSIX systems, users would suddenly
find themselves in an invalid current directory.

Therefore, instead of deleting the entire directory, we delete everything
_within_ the directory, and leave the (empty) directory in place.

This would cause a subsequent notes merge to abort, complaining about a
previous - unfinished - notes merge (due to the presence of
.git/NOTES_MERGE_WORKTREE), so we also need to adjust this check to only
trigger when .git/NOTES_MERGE_WORKTREE is non-empty.

Finally, adjust the t3310 manual notes merge testcases to correctly handle
the existence of an empty .git/NOTES_MERGE_WORKTREE directory.

Inspired-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

notes-merge: use opendir/readdir instead of using read_... Johan Herland Mon, 12 Mar 2012 14:57:13 +0000 (15:57 +0100)

notes-merge: use opendir/readdir instead of using read_directory()

notes_merge_commit() only needs to list all entries (non-recursively)
under a directory, which can be easily accomplished with
opendir/readdir and would be more lightweight than read_directory().

read_directory() is designed to list paths inside a working
directory. Using it outside of its scope may lead to undesired effects.

Apparently, one of the undesired effects of read_directory() is that it
doesn't deal with being given absolute paths. This creates problems for
notes_merge_commit() when git_path() returns an absolute path, which
happens when the current working directory is in a subdirectory of the
.git directory.

Originally-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Updated-by: Johan Herland <johan@herland.net>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3310: illustrate failure to "notes merge --commit... Johan Herland Mon, 12 Mar 2012 14:57:12 +0000 (15:57 +0100)

t3310: illustrate failure to "notes merge --commit" inside $GIT_DIR/

The 'git notes merge' command expected to be run from the working
tree of the project being annotated, and did not anticipate getting
run inside $GIT_DIR/.

However, because we use $GIT_DIR/NOTES_MERGE_WORKTREE as a temporary
working space for the user to work on resolving conflicts, it is not
unreasonable for a user to run "git notes merge --commit" there. But
the command fails to do so.

Found-by: David Bremner <david@tethera.net>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remove_dir_recursively(): Add flag for skipping removal... Junio C Hamano Thu, 15 Mar 2012 14:58:54 +0000 (15:58 +0100)

remove_dir_recursively(): Add flag for skipping removal of toplevel dir

Add the REMOVE_DIR_KEEP_TOPLEVEL flag to remove_dir_recursively() for
deleting everything inside the given directory, but _not_ the given
directory itself.

Note that this does not pass the REMOVE_DIR_KEEP_NESTED_GIT flag, if set,
to the recursive invocations of remove_dir_recursively(). It is likely to
be a a bug that has been present since REMOVE_DIR_KEEP_NESTED_GIT was
introduced (a0f4afb), but this commit keeps the same behaviour for now.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t0303: resurrect commit message as test documentationZbigniew Jędrzejewski-Szmek Thu, 15 Mar 2012 11:08:01 +0000 (12:08 +0100)

t0303: resurrect commit message as test documentation

The commit message which added those tests (861444f 't: add test
harness for external credential helpers' 2011-12-10) provided nice
documentation in the commit message. Let's make it more visible
by putting it in the test description.

The documentation is updated to reflect the fact that
GIT_TEST_CREDENTIAL_HELPER must be set for
GIT_TEST_CREDENTIAL_HELPER_TIMEOUT to be used
and GIT_TEST_CREDENTIAL_HELPER_SETUP can be used.

Based-on-commit-message-by: Jeff King <peff@peff.net>
Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t0303: immediately bail out w/o GIT_TEST_CREDENTIAL_HELPERZbigniew Jędrzejewski-Szmek Thu, 15 Mar 2012 11:08:00 +0000 (12:08 +0100)

t0303: immediately bail out w/o GIT_TEST_CREDENTIAL_HELPER

t0300-credential-helpers.sh requires GIT_TEST_CREDENTIAL_HELPER to be
configured to do something sensible. If it is not set, prove will say:
./t0303-credential-external.sh .. skipped: (no reason given)
which isn't very nice.

Use skip_all="..." && test_done to bail out immediately and provide a
nicer message. In case GIT_TEST_CREDENTIAL_HELPER is set, but the
timeout tests are skipped, mention GIT_TEST_CREDENTIAL_HELPER_TIMEOUT.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git 1.7.10-rc1 v1.7.10-rc1Junio C Hamano Wed, 14 Mar 2012 22:38:47 +0000 (15:38 -0700)

Git 1.7.10-rc1

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

contrib/diffall: fix cleanup trap on WindowsTim Henigan Wed, 14 Mar 2012 16:38:06 +0000 (12:38 -0400)

contrib/diffall: fix cleanup trap on Windows

Prior to this commit, the cleanup trap that removes the tmp dir
created by the script would fail on Windows. The error was silently
ignored by the script.

On Windows, a directory cannot be removed while it is the working
directory of the process (thanks to Johannes Sixt on the Git list
for this info [1]).

This commit eliminates the 'cd' into the tmp directory that caused
the error.

[1]: http://article.gmane.org/gmane.comp.version-control.git/193086

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

contrib/diffall: eliminate duplicate while loopsTim Henigan Wed, 14 Mar 2012 16:38:05 +0000 (12:38 -0400)

contrib/diffall: eliminate duplicate while loops

There were 3 instances of a 'while read; do' that used identical logic
to populate '/tmp/right_dir'. This commit groups them into a single loop.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

contrib/diffall: eliminate use of tarTim Henigan Wed, 14 Mar 2012 16:38:04 +0000 (12:38 -0400)

contrib/diffall: eliminate use of tar

The 'tar' utility is not available on all platforms (some only support
'gnutar'). An earlier commit created a work-around for this problem,
but a better solution is to eliminate the use of 'tar' completely.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

contrib/diffall: create tmp dirs without mktempTim Henigan Wed, 14 Mar 2012 16:38:03 +0000 (12:38 -0400)

contrib/diffall: create tmp dirs without mktemp

mktemp is not available on all platforms. Instead of littering the code
with a work-around, this commit replaces mktemp with a one-line Perl
script.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

contrib/diffall: comment actual reason for 'cdup'Tim Henigan Wed, 14 Mar 2012 16:38:02 +0000 (12:38 -0400)

contrib/diffall: comment actual reason for 'cdup'

The comment from an earlier commit did not reflect the actual reason this
operation is needed.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff: tweak a _copy_ of diff_options with word-diffThomas Rast Wed, 14 Mar 2012 18:24:09 +0000 (19:24 +0100)

diff: tweak a _copy_ of diff_options with word-diff

When using word diff, the code sets the word_regex from various
defaults if it was not set already. The problem is that it does this
on the original diff_options, which will also be used in subsequent
diffs.

This means that when the word_regex is not given on the command line,
only the first diff for which a setting for word_regex (either from
attributes or diff.wordRegex) ever takes effect. This value then
propagates to the rest of the diff runs and in particular prevents
further attribute lookups.

Fix the problem of changing diff state once and for all, by working
with a _copy_ of the diff_options.

Noticed-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff: refactor the word-diff setup from builtin_diff_cmdThomas Rast Wed, 14 Mar 2012 18:24:08 +0000 (19:24 +0100)

diff: refactor the word-diff setup from builtin_diff_cmd

Quite a chunk of builtin_diff_cmd deals with word-diff setup, defaults
and such. This makes the function a bit hard to read, but is also
asymmetric because the corresponding teardown lives in free_diff_words_data
already.

Refactor into a new function init_diff_words_data. For simplicity,
also shuffle around some functions it depends on.

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

t4034: diff.*.wordregex should not be "sticky" in ... Johannes Sixt Wed, 14 Mar 2012 19:50:21 +0000 (20:50 +0100)

t4034: diff.*.wordregex should not be "sticky" in --word-diff

The test case applies a custom wordRegex to one file in a diff, and expects
that the default word splitting applies to the second file in the diff.
But the custom wordRegex is also incorrectly used for the second file.

Helped-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/diff-options: reword description of ... Tim Henigan Wed, 14 Mar 2012 17:00:55 +0000 (13:00 -0400)

Documentation/diff-options: reword description of --submodule option

The previous description was confusing. This rewrite makes it easier
to understand.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fmt-merge-msg: show those involved in a merged seriesJunio C Hamano Tue, 13 Mar 2012 17:00:00 +0000 (10:00 -0700)

fmt-merge-msg: show those involved in a merged series

As we already walk the history of the branch that gets merged to
come up with a short log, let's label it with names of the primary
authors, so that the user who summarizes the merge can easily give
credit to them in the log message.

Also infer the names of "lieutents" to help integrators at higher
level of the food-chain to give credit to them, by counting:

* The committer of the 'tip' commit that is merged
* The committer of merge commits that are merged

Often the first one gives the owner of the history being pulled, but
his last pull from his sublieutenants may have been a fast-forward,
in which case the first one would not be. The latter rule will
count the integrator of the history, so together it might be a
reasonable heuristics.

There are two special cases:

- The "author" credit is omitted when the series is written solely
by the same author who is making the merge. The name can be seen
on the "Author" line of the "git log" output to view the log
message anyway.

- The "lieutenant" credit is omitted when there is only one key
committer in the merged branch and it is the committer who is
making the merge. Typically this applies to the case where the
developer merges his own branch.

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

diffstat summary line varies by locale: miscellanyJonathan Nieder Tue, 13 Mar 2012 05:05:54 +0000 (00:05 -0500)

diffstat summary line varies by locale: miscellany

These changes are in the same spirit as the six patches that
precede them, but they haven't been split into individually
justifiable patches yet.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test: use numstat instead of diffstat in binary-diff... Jonathan Nieder Tue, 13 Mar 2012 05:02:19 +0000 (00:02 -0500)

test: use numstat instead of diffstat in binary-diff test

git's --stat output is intended for humans and since v1.7.9.2~13
(2012-02-01) varies by locale. The tests in this script using "apply
--stat" are meant to check two things:

- how binary file changes are accounted for and printed in
git's diffstat format

- that "git apply" can parse the various forms of binary diff

Split these two kinds of check into separate tests, and use --numstat
instead of --stat in the latter. This way, we lose less test coverage
when git is being run without writing its output in the C locale (for
example because GETTEXT_POISON is enabled) and there are fewer tests
to change if the --stat output needs to be tweaked again.

While at it, use commands separated by && that read and write to
temporary files in place of pipelines so segfaults and other failures
in the upstream of the processing pipeline don't get hidden.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test: use --numstat instead of --stat in "git stash... Jonathan Nieder Tue, 13 Mar 2012 05:01:32 +0000 (00:01 -0500)

test: use --numstat instead of --stat in "git stash show" tests

git's diff --stat output is intended for human consumption and
since v1.7.9.2~13 (2012-02-01) varies by locale. Add a test checking
that git stash show defaults to --stat and tweak the rest of the
"stash show" tests that showed a diffstat to use numstat.

This way, there are fewer tests to tweak if the diffstat format
changes again. This also improves test coverage when running tests
with git configured not to write its output in the C locale (e.g.,
via GETTEXT_POISON=Yes).

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test: test cherry-pick functionality and output separatelyJonathan Nieder Tue, 13 Mar 2012 05:00:36 +0000 (00:00 -0500)

test: test cherry-pick functionality and output separately

Since v1.7.3-rc0~26^2~9 (revert: report success when using option
--strategy, 2010-07-14), the cherry-pick-many-commits test checks the
format of output written to the terminal during a cherry-pick sequence
in addition to the functionality. There is no reason those have to
be checked in the same test, though, and it has some downsides:

- when progress output is broken, the test result does not convey
whether the functionality was also broken or not

- it is not immediately obvious when reading that these checks are
meant to prevent regressions in details of the output format and
are not just a roundabout way to check functional details like the
number of commits produced

- there is a temptation to include the same kind of output checking
for every new cherry-pick test, which would make future changes
to the output unnecessarily difficult

Put the tests from v1.7.3-rc0~26^2~9 in separate assertions, following
the principle "test one feature at a time".

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test: modernize funny-names test styleJonathan Nieder Tue, 13 Mar 2012 04:59:52 +0000 (23:59 -0500)

test: modernize funny-names test style

This is one of the early tests, so it uses a style that by modern
standards can be hard to read. Tweak it to:

- clearly declare what assertion each test is designed to check

- mark tests that create state later tests will depend on with the
word "setup" so people writing or running tests know the others
can be skipped or reordered safely

- put commands that populate a file with expected output inside
the corresponding test stanza, so it is easier to see by eye
where each test begins and ends

- instead of pipelines, use commands that read and write a
temporary file, so bugs causing commands to segfault or produce
the wrong exit status can be caught.

More cosmetic changes:

- put the opening quote starting each test on the same line as the
test_expect_* invocation, and indent the commands in each test
with a single tab

- end the test early if the underlying filesystem cannot
accomodate the filenames we use, instead of marking all tests
with the same TABS_IN_FILENAMES prerequisite.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test: use numstat instead of diffstat in funny-names... Jonathan Nieder Tue, 13 Mar 2012 04:58:59 +0000 (23:58 -0500)

test: use numstat instead of diffstat in funny-names test

This test script checks that git's plumbing commands quote filenames
with special characters like space, tab, and double-quote
appropriately in their input and output.

Since commit v1.7.9.2~13 (Use correct grammar in diffstat summary
line, 2012-02-01), the final "1 file changed, 1 insertion(+)" line
from diffstats is translatable, meaning tests that rely on exact "git
apply --stat" output have to be skipped when git is not configured to
produce output in the C locale (for example, when GETTEXT_POISON is
enabled). So:

- Tweak the three "git apply --stat" tests that check "git apply"'s
input parsing to use --numstat instead.

--numstat output is more reliable, does not vary with locale, and
is itself easier to parse. These tests are mainly about how "git
apply" parses its input so this should not result in much loss of
coverage.

- Add a new "apply --stat" test to check the quoting in --stat output
format.

This wins back a little of the test coverage lost with the patch
"test: use test_i18ncmp to check --stat output" when GETTEXT_POISON is
enabled.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test: use test_i18ncmp when checking --stat outputJonathan Nieder Tue, 13 Mar 2012 04:54:05 +0000 (23:54 -0500)

test: use test_i18ncmp when checking --stat output

Ever since v1.7.9.2~13 (2012-02-01), git's diffstat-style summary line
produced by "git apply --stat", "git diff --stat", and "git commit"
varies by locale, producing test failures when GETTEXT_POISON is set.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jc/i18n-shell-script-gettext'Junio C Hamano Tue, 13 Mar 2012 19:36:28 +0000 (12:36 -0700)

Merge branch 'jc/i18n-shell-script-gettext'

The auto detection was testing if a fixed string that is known to be
non-empty is empty by mistake.

* jc/i18n-shell-script-gettext:
i18n: fix auto detection of gettext scheme for shell scripts

Merge branch 'jc/maint-undefined-i18n-observation-test'Junio C Hamano Tue, 13 Mar 2012 19:36:09 +0000 (12:36 -0700)

Merge branch 'jc/maint-undefined-i18n-observation-test'

It was unclear what a test in t0204 wanted to check; it turns out
that it was only to observe an undefined behaviour of the system,
and did not anticipate one kind of reasonable error behaviour.

* jc/maint-undefined-i18n-observation-test:
t0204: clarify the "observe undefined behaviour" test

Merge branch 'ms/maint-config-error-at-eol-linecount'Junio C Hamano Tue, 13 Mar 2012 19:35:53 +0000 (12:35 -0700)

Merge branch 'ms/maint-config-error-at-eol-linecount'

When "git config" diagnoses an error in a configuration file and
shows the line number for the offending line, it miscounted if the
error was at the end of line.

By Martin Stenberg
* ms/maint-config-error-at-eol-linecount:
config: report errors at the EOL with correct line number

Conflicts:
t/t1300-repo-config.sh

Merge branch 'ph/rerere-doc'Junio C Hamano Tue, 13 Mar 2012 19:35:22 +0000 (12:35 -0700)

Merge branch 'ph/rerere-doc'

By Phil Hord
* ph/rerere-doc:
rerere: Document 'rerere remaining'

am: officially deprecate -b/--binary optionJunio C Hamano Tue, 13 Mar 2012 18:38:27 +0000 (11:38 -0700)

am: officially deprecate -b/--binary option

We have had these options as harmless no-op for more than 3 years without
officially deprecating them. Let's announce the deprecation and start
warning against their use, but without failing the command just not yet,
so that we can later repurpose the option if we want to in the future.

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

Update draft release notes to 1.7.10 before -rc1Junio C Hamano Mon, 12 Mar 2012 22:59:06 +0000 (15:59 -0700)

Update draft release notes to 1.7.10 before -rc1

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

Merge branch 'az/verify-tag-use-gpg-config'Junio C Hamano Mon, 12 Mar 2012 22:55:53 +0000 (15:55 -0700)

Merge branch 'az/verify-tag-use-gpg-config'

"git tag -s" honored "gpg.program" configuration variable since
1.7.9, but "git tag -v" and "git verify-tag" didn't.

By Alex Zepeda
* az/verify-tag-use-gpg-config:
verify-tag: Parse GPG configuration options.

Sync with 1.7.9.4Junio C Hamano Mon, 12 Mar 2012 22:54:21 +0000 (15:54 -0700)

Sync with 1.7.9.4

Git 1.7.9.4 v1.7.9.4Junio C Hamano Mon, 12 Mar 2012 22:52:52 +0000 (15:52 -0700)

Git 1.7.9.4

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

Merge branch 'tr/maint-bundle-boundary' into maintJunio C Hamano Mon, 12 Mar 2012 22:46:53 +0000 (15:46 -0700)

Merge branch 'tr/maint-bundle-boundary' into maint

"git bundle" did not record boundary commits correctly when there
are many of them.

By Thomas Rast
* tr/maint-bundle-boundary:
bundle: keep around names passed to add_pending_object()
t5510: ensure we stay in the toplevel test dir
t5510: refactor bundle->pack conversion

Merge branch 'jc/maint-diff-patch-header' into maintJunio C Hamano Mon, 12 Mar 2012 22:46:32 +0000 (15:46 -0700)

Merge branch 'jc/maint-diff-patch-header' into maint

"git diff-index" and its friends at the plumbing level showed the
"diff --git" header and nothing else for a path whose cached stat
info is dirty without actual difference when asked to produce a
patch. This was a longstanding bug that we could have fixed long
time ago.

By Junio C Hamano
* jc/maint-diff-patch-header:
diff -p: squelch "diff --git" header for stat-dirty paths
t4011: illustrate "diff-index -p" on stat-dirty paths
t4011: modernise style

Merge branch 'jn/maint-do-not-match-with-unsanitized... Junio C Hamano Mon, 12 Mar 2012 22:45:57 +0000 (15:45 -0700)

Merge branch 'jn/maint-do-not-match-with-unsanitized-searchtext' into maint

"gitweb" did use quotemeta() to prepare search string when asked to
do a fixed-string project search, but did not use it by mistake and
used the user-supplied string instead.

By Jakub Narebski
* jn/maint-do-not-match-with-unsanitized-searchtext:
gitweb: Fix fixed string (non-regexp) project search

Merge branch 'jc/am-3-nonstandard-popt' into maintJunio C Hamano Mon, 12 Mar 2012 22:43:06 +0000 (15:43 -0700)

Merge branch 'jc/am-3-nonstandard-popt' into maint

The code to synthesize the fake ancestor tree used by 3-way merge
fallback in "git am" was not prepared to read a patch created with
a non-standard -p<num> value.

* jc/am-3-nonstandard-popt:
test: "am -3" can accept non-standard -p<num>
am -3: allow nonstandard -p<num> option

git-am: error out when seeing -b/--binaryThomas Rast Mon, 12 Mar 2012 21:47:19 +0000 (22:47 +0100)

git-am: error out when seeing -b/--binary

The --binary option to git-apply has been a no-op since 2b6eef9 (Make
apply --binary a no-op., 2006-09-06) and was deprecated in cb3a160
(git-am: ignore --binary option, 2008-08-09).

We could remove it outright, but let's be nice to people who still
have scripts saying 'git am -b' (if they exist) and tell them the
reason for the sudden failure.

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

i18n: fix auto detection of gettext scheme for shell... Junio C Hamano Mon, 12 Mar 2012 21:41:15 +0000 (14:41 -0700)

i18n: fix auto detection of gettext scheme for shell scripts

A new code added by ad17ea7 (add a Makefile switch to avoid gettext
translation in shell scripts, 2012-01-23) tried to optionally force
a gettext scheme to "fallthrough", but ended up forcing it to everybody.

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

config: report errors at the EOL with correct line... Martin Stenberg Fri, 9 Mar 2012 21:57:54 +0000 (22:57 +0100)

config: report errors at the EOL with correct line number

A section in a config file with a missing "]" reports the next line
as bad, same goes to a value with a missing end quote.

This happens because the error is not detected until the end of the
line, when line number is already increased. Fix this by decreasing
line number by one for these cases.

Signed-off-by: Martin Stenberg <martin@gnutiken.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge https://github.com/git-l10n/git-poJunio C Hamano Mon, 12 Mar 2012 16:03:20 +0000 (09:03 -0700)

Merge https://github.com/git-l10n/git-po

Updates to localized messages for zn_CN and sv locales.

via Jiang Xin
* https://github.com/git-l10n/git-po:
l10n: Improve zh_CN translation for msg "not something we can merge"
l10n: Improve zh_CN trans for msg that cannot fast-forward
l10n: Update zh_CN translation for 1.7.10-rc0
Update Swedish translation (732t0f0u).
po/sv.po: add Swedish translation
l10n: Update git.pot (1 new message)
l10n: Update zh_CN translation for 1.7.9.2
l10n: Improve commit msg for zh_CN translation
l10n: Improve zh_CN translation for msg that make empty commit when amend.
l10n: Improve zh_CN translation for empty cherry-pick msg.
l10n: Improve zh_CN translation for msg about branch deletion deny
l10n: Improve zh_CN translation for lines insertion and deletion.

commit: pass author/committer info to hooksJunio C Hamano Sun, 11 Mar 2012 10:12:10 +0000 (03:12 -0700)

commit: pass author/committer info to hooks

When lying the author name via GIT_AUTHOR_NAME environment variable
to "git commit", the hooks run by the command saw it and could act
on the name that will be recorded in the final commit. When the user
uses the "--author" option from the command line, the command should
give the same information to the hook, and back when "git command"
was a scripted Porcelain, it did set the environment variable and
hooks can learn the author name from it.

However, when the command was reimplemented in C, the rewritten code
was not very faithful to the original, and hooks stopped getting the
authorship information given with "--author". Fix this by exporting
the necessary environment variables.

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

t7503: does pre-commit-hook learn authorship?Junio C Hamano Sun, 11 Mar 2012 10:51:32 +0000 (03:51 -0700)

t7503: does pre-commit-hook learn authorship?

When "--author" option is used to lie the authorship to "git commit"
command, hooks should learn the author name and email just like when
GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL environment variables are used
to lie the authorship. Test this.

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

ident.c: add split_ident_line() to parse formatted... Junio C Hamano Sun, 11 Mar 2012 09:25:43 +0000 (01:25 -0800)

ident.c: add split_ident_line() to parse formatted ident line

The commit formatting logic format_person_part() in pretty.c
implements the logic to split an author/committer ident line into
its parts, intermixed with logic to compute its output using these
piece it computes.

Separate the former out to a helper function split_ident_line() so
that other codepath can use the same logic, and rewrite the function
using the helper function.

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

Git::I18N: compatibility with perl <5.8.3Ævar Arnfjörð Bjarmason Sat, 10 Mar 2012 12:29:34 +0000 (12:29 +0000)

Git::I18N: compatibility with perl <5.8.3

Change the Exporter invocation in Git::I18N to be compatible with
5.8.0 to 5.8.2 inclusive. Before Exporter 5.57 (released with 5.8.3)
Exporter didn't export the 'import' subroutine.

Reported-by: Tom G. Christensen <tgc@statsbiblioteket.dk>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-import: don't allow 'ls' of path with empty componentsJonathan Nieder Sat, 10 Mar 2012 04:07:22 +0000 (22:07 -0600)

fast-import: don't allow 'ls' of path with empty components

As the fast-import manual explains:

The value of <path> must be in canonical form. That is it must
not:
. contain an empty directory component (e.g. foo//bar is invalid),
. end with a directory separator (e.g. foo/ is invalid),
. start with a directory separator (e.g. /foo is invalid),

Unfortunately the "ls" command accepts these invalid syntaxes and
responds by declaring that the indicated path is missing. This is too
subtle and causes importers to silently misbehave; better to error out
so the operator knows what's happening.

The C, R, and M commands already error out for such paths.

Reported-by: Andrew Sayers <andrew-git@pileofstuff.org>
Analysis-by: David Barr <davidbarr@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>

fast-import: leakfix for 'ls' of dirty treesJonathan Nieder Sat, 10 Mar 2012 03:20:34 +0000 (21:20 -0600)

fast-import: leakfix for 'ls' of dirty trees

When the chosen directory has changed since it was last written to
pack, "tree_content_get" makes a deep copy of its content to scribble
on while computing the tree name, which we forgot to free.

This leak has been present since the 'ls' command was introduced in
v1.7.5-rc0~3^2~33 (fast-import: add 'ls' command, 2010-12-02).

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>

t0204: clarify the "observe undefined behaviour" testJunio C Hamano Wed, 7 Mar 2012 23:36:59 +0000 (15:36 -0800)

t0204: clarify the "observe undefined behaviour" test

This test asks for an impossible conversion to the system by
preparing an UTF-8 translation with characters that cannot be
expressed in ISO-8859-1, and then asking the message shown in
ISO-8859-1. Even though the behaviour against such a request is
undefined, it may be interesting to see what the system does, and
the purpose of this test is to see if there are platforms that
exhibit behaviour that we haven't seen.

The original recognized two known modes of behaviour:

- the key used to query the message catalog ("TEST: Old English
Runes"), saying "I cannot do that i18n".
- impossible characters replaced with ASCII "?", saying "I punt".

but they were treated totally differently. The test simply issued
an informational message "Your system punts on this one" for the
first error mode, while it diagnosed the latter as "Your system is
good; you pass!".

It turns out that Mac OS X exhibits a third mode of error behaviour,
to spew out the raw value stored in the message catalog. The test
diagnosed this behaviour as "broken", but it is merely trying to do
its best to respond to an impossible request by saying "I punt" in a
way that is slightly different from the second one.

Update the offending test to make it clear what is (and is not)
being tested, update the code structure so that newly discovered
error mode can easily be added to it later, and reword the message
that comes from a failing case to clarify that it is not the system
that is broken when it fails, but merely that the behaviour is not
something we have seen.

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

configure: allow user to prevent $PATH "sanitization... Stefano Lattarini Fri, 9 Mar 2012 12:43:55 +0000 (13:43 +0100)

configure: allow user to prevent $PATH "sanitization" on Solaris

On a Solaris 10 system with Solaris make installed as '/usr/xpg4/bin/make',
GNU make installed as '/usr/local/bin/make', and with '/usr/local/bin'
appearing in $PATH *before* '/usr/xpg4/bin', I was seeing errors like this
upon invoking "make all":

Usage : make [ -f makefile ][ -K statefile ]...
make: Fatal error: Unknown option `-C'

This happenes because the Git's Makefile, when running on Solaris,
automatically "sanitizes" $PATH by prepending '/usr/xpg6/bin' and
'/usr/xpg4/bin' to it in order to avoid using non-POSIX /bin/sh from
being used. In the setup described above, however, this has an
unintended consequence of forcing the use of Solaris make in recursive
make invocations -- even if the $(MAKE) macro is being correctly used in
them!

When building without using the autoconf machinery, this can be solved
by overriding $(SANE_TOOL_PATH). Teach the autoconf machinery to also
allow users of ./configure to override it from the command line with a
new --with-sane-tool-path option.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

p4000: use -3000 when promising -3000Thomas Rast Fri, 9 Mar 2012 09:52:54 +0000 (10:52 +0100)

p4000: use -3000 when promising -3000

The 'log -3000 (baseline)' test accidentally still used -1000 from an
earlier version.

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

rerere: Document 'rerere remaining'Phil Hord Thu, 8 Mar 2012 21:08:50 +0000 (16:08 -0500)

rerere: Document 'rerere remaining'

This adds the 'remaining' command to the documentation of
'git rerere'. This command was added in ac49f5ca (Feb 16 2011;
Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>) but
it was never documented.

Touch up the other rerere commands to reduce noise.

First noticed by Vincent van Ravesteijn.

Signed-off-by: Phil Hord <phil.hord@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

verify-tag: Parse GPG configuration options.Alex Zepeda Thu, 8 Mar 2012 20:07:20 +0000 (12:07 -0800)

verify-tag: Parse GPG configuration options.

Modify verify-tag to load relevant GPG variables from the git
configuratio file. This allows git tag -v to use an alternative
GPG binary in the same way that git tag -s does.

Signed-off-by: Alex Zepeda <alex@inferiorhumanorgans.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes to 1.7.10Junio C Hamano Thu, 8 Mar 2012 21:08:26 +0000 (13:08 -0800)

Update draft release notes to 1.7.10

Also apply typofixes people on the list helped spotting and
correcting.

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

Merge branch 'kb/maint-prune-rmdir-closedir'Junio C Hamano Thu, 8 Mar 2012 21:05:04 +0000 (13:05 -0800)

Merge branch 'kb/maint-prune-rmdir-closedir'

By Karsten Blees
* kb/maint-prune-rmdir-closedir:
fix deletion of .git/objects sub-directories in git-prune/repack

Merge branch 'jl/maint-submodule-relative'Junio C Hamano Thu, 8 Mar 2012 21:04:52 +0000 (13:04 -0800)

Merge branch 'jl/maint-submodule-relative'

By Jens Lehmann (3) and Johannes Sixt (1)
* jl/maint-submodule-relative:
submodules: fix ambiguous absolute paths under Windows
submodules: refactor computation of relative gitdir path
submodules: always use a relative path from gitdir to work tree
submodules: always use a relative path to gitdir

Merge branch 'jn/maint-do-not-match-with-unsanitized... Junio C Hamano Thu, 8 Mar 2012 21:04:49 +0000 (13:04 -0800)

Merge branch 'jn/maint-do-not-match-with-unsanitized-searchtext'

By Jakub Narebski
* jn/maint-do-not-match-with-unsanitized-searchtext:
gitweb: Fix fixed string (non-regexp) project search

Conflicts:
gitweb/gitweb.perl

Merge branch 'vr/branch-doc'Junio C Hamano Thu, 8 Mar 2012 21:04:44 +0000 (13:04 -0800)

Merge branch 'vr/branch-doc'

By Vincent van Ravesteijn
* vr/branch-doc:
Documentation/git-branch: add default for --contains
Documentation/git-branch: fix a typo
Documentation/git-branch: cleanups

perf: export some important test-lib variablesThomas Rast Thu, 8 Mar 2012 08:54:55 +0000 (09:54 +0100)

perf: export some important test-lib variables

The only bug right now is that $GIT_TEST_CMP is needed for test_cmp to
work.

However, we also export the three most important paths for tests:

TEST_DIRECTORY
TRASH_DIRECTORY
GIT_BUILD_DIR

Since they are available within test_expect_success, a future test
writer may expect them to also be defined in test_perf.

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