gitweb.git
Merge branch 'tg/grep-no-index-fallback'Junio C Hamano Wed, 20 Jan 2016 19:43:38 +0000 (11:43 -0800)

Merge branch 'tg/grep-no-index-fallback'

"git grep" by default does not fall back to its "--no-index"
behaviour outside a directory under Git's control (otherwise the
user may by mistake end up running a huge recursive search); with a
new configuration (set in $HOME/.gitconfig--by definition this
cannot be set in the config file per project), this safety can be
disabled.

* tg/grep-no-index-fallback:
builtin/grep: add grep.fallbackToNoIndex config
t7810: correct --no-index test

Merge branch 'ho/gitweb-squelch-undef-warning'Junio C Hamano Wed, 20 Jan 2016 19:43:36 +0000 (11:43 -0800)

Merge branch 'ho/gitweb-squelch-undef-warning'

Asking gitweb for a nonexistent commit left a warning in the server
log.

Somebody may want to follow this up with a new test, perhaps?
IIRC, we do test that no Perl warnings are given to the server log,
so this should have been caught if our test coverage were good.

* ho/gitweb-squelch-undef-warning:
gitweb: squelch "uninitialized value" warning

Merge branch 'js/fopen-harder'Junio C Hamano Wed, 20 Jan 2016 19:43:35 +0000 (11:43 -0800)

Merge branch 'js/fopen-harder'

Some codepaths used fopen(3) when opening a fixed path in $GIT_DIR
(e.g. COMMIT_EDITMSG) that is meant to be left after the command is
done. This however did not work well if the repository is set to
be shared with core.sharedRepository and the umask of the previous
user is tighter. They have been made to work better by calling
unlink(2) and retrying after fopen(3) fails with EPERM.

* js/fopen-harder:
Handle more file writes correctly in shared repos
commit: allow editing the commit message even in shared repos

Merge branch 'ss/clone-depth-single-doc'Junio C Hamano Wed, 20 Jan 2016 19:43:35 +0000 (11:43 -0800)

Merge branch 'ss/clone-depth-single-doc'

Documentation for "git fetch --depth" has been updated for clarity.

* ss/clone-depth-single-doc:
docs: clarify that --depth for git-fetch works with newly initialized repos
docs: say "commits" in the --depth option wording for git-clone
docs: clarify that passing --depth to git-clone implies --single-branch

Merge branch 'nd/exclusion-regression-fix'Junio C Hamano Wed, 20 Jan 2016 19:43:33 +0000 (11:43 -0800)

Merge branch 'nd/exclusion-regression-fix'

The ignore mechanism saw a few regressions around untracked file
listing and sparse checkout selection areas in 2.7.0; the change
that is responsible for the regression has been reverted.

* nd/exclusion-regression-fix:
Revert "dir.c: don't exclude whole dir prematurely if neg pattern may match"

Merge branch 'dk/reflog-walk-with-non-commit'Junio C Hamano Wed, 20 Jan 2016 19:43:32 +0000 (11:43 -0800)

Merge branch 'dk/reflog-walk-with-non-commit'

"git reflog" incorrectly assumed that all objects that used to be
at the tip of a ref must be commits, which caused it to segfault.

* dk/reflog-walk-with-non-commit:
reflog-walk: don't segfault on non-commit sha1's in the reflog

Merge branch 'sg/t6050-failing-editor-test-fix'Junio C Hamano Wed, 20 Jan 2016 19:43:31 +0000 (11:43 -0800)

Merge branch 'sg/t6050-failing-editor-test-fix'

* sg/t6050-failing-editor-test-fix:
t6050-replace: make failing editor test more robust

Merge branch 'ew/for-each-ref-doc'Junio C Hamano Wed, 20 Jan 2016 19:43:30 +0000 (11:43 -0800)

Merge branch 'ew/for-each-ref-doc'

* ew/for-each-ref-doc:
for-each-ref: document `creatordate` and `creator` fields

Merge branch 'dw/signoff-doc'Junio C Hamano Wed, 20 Jan 2016 19:43:29 +0000 (11:43 -0800)

Merge branch 'dw/signoff-doc'

The documentation has been updated to hint the connection between
the '--signoff' option and DCO.

* dw/signoff-doc:
Expand documentation describing --signoff

Merge branch 'jk/clang-pedantic'Junio C Hamano Wed, 20 Jan 2016 19:43:29 +0000 (11:43 -0800)

Merge branch 'jk/clang-pedantic'

A few unportable C construct have been spotted by clang compiler
and have been fixed.

* jk/clang-pedantic:
bswap: add NO_UNALIGNED_LOADS define
avoid shifting signed integers 31 bits

Merge branch 'ew/send-email-mutt-alias-fix'Junio C Hamano Wed, 20 Jan 2016 19:43:28 +0000 (11:43 -0800)

Merge branch 'ew/send-email-mutt-alias-fix'

"git send-email" was confused by escaped quotes stored in the alias
files saved by "mutt", which has been corrected.

* ew/send-email-mutt-alias-fix:
git-send-email: do not double-escape quotes from mutt

Merge branch 'ss/user-manual'Junio C Hamano Wed, 20 Jan 2016 19:43:27 +0000 (11:43 -0800)

Merge branch 'ss/user-manual'

Drop a few old "todo" items by deciding that the change one of them
suggests is not such a good idea, and doing the change the other
one suggested to do.

* ss/user-manual:
user-manual: add addition gitweb information
user-manual: add section documenting shallow clones
glossary: define the term shallow clone
user-manual: remove temporary branch entry from todo list

Merge branch 'nd/clear-gitenv-upon-use-of-alias'Junio C Hamano Wed, 20 Jan 2016 19:43:26 +0000 (11:43 -0800)

Merge branch 'nd/clear-gitenv-upon-use-of-alias'

d95138e6 (setup: set env $GIT_WORK_TREE when work tree is set, like
$GIT_DIR, 2015-06-26) attempted to work around a glitch in alias
handling by overwriting GIT_WORK_TREE environment variable to
affect subprocesses when set_git_work_tree() gets called, which
resulted in a rather unpleasant regression to "clone" and "init".
Try to address the same issue by always restoring the environment
and respawning the real underlying command when handling alias.

* nd/clear-gitenv-upon-use-of-alias:
run-command: don't warn on SIGPIPE deaths
git.c: make sure we do not leak GIT_* to alias scripts
setup.c: re-fix d95138e (setup: set env $GIT_WORK_TREE when ..
git.c: make it clear save_env() is for alias handling only

Merge branch 'nd/ita-cleanup'Junio C Hamano Wed, 20 Jan 2016 19:43:25 +0000 (11:43 -0800)

Merge branch 'nd/ita-cleanup'

Paths that have been told the index about with "add -N" are not
quite yet in the index, but a few commands behaved as if they
already are in a harmful way.

* nd/ita-cleanup:
grep: make it clear i-t-a entries are ignored
add and use a convenience macro ce_intent_to_add()
blame: remove obsolete comment

Merge branch 'nd/dir-exclude-cleanup'Junio C Hamano Wed, 20 Jan 2016 19:43:24 +0000 (11:43 -0800)

Merge branch 'nd/dir-exclude-cleanup'

The "exclude_list" structure has the usual "alloc, nr" pair of
fields to be used by ALLOC_GROW(), but clear_exclude_list() forgot
to reset 'alloc' to 0 when it cleared 'nr'to discard the managed
array.

* nd/dir-exclude-cleanup:
dir.c: clean the entire struct in clear_exclude_list()

Merge branch 'jk/pack-revindex'Junio C Hamano Wed, 20 Jan 2016 19:43:22 +0000 (11:43 -0800)

Merge branch 'jk/pack-revindex'

In-core storage of the reverse index for .pack files (which lets
you go from a pack offset to an object name) has been streamlined.

* jk/pack-revindex:
pack-revindex: store entries directly in packed_git
pack-revindex: drop hash table

Merge branch 'mh/notes-allow-reading-treeish'Junio C Hamano Wed, 20 Jan 2016 19:43:21 +0000 (11:43 -0800)

Merge branch 'mh/notes-allow-reading-treeish'

Some "git notes" operations, e.g. "git log --notes=<note>", should
be able to read notes from any tree-ish that is shaped like a notes
tree, but the notes infrastructure required that the argument must
be a ref under refs/notes/. Loosen it to require a valid ref only
when the operation would update the notes (in which case we must
have a place to store the updated notes tree, iow, a ref).

* mh/notes-allow-reading-treeish:
notes: allow treeish expressions as notes ref

Sync with maintJunio C Hamano Tue, 12 Jan 2016 23:21:00 +0000 (15:21 -0800)

Sync with maint

* maint:
l10n: ko.po: Add Korean translation

First batch for post 2.7 cycleJunio C Hamano Tue, 12 Jan 2016 23:20:51 +0000 (15:20 -0800)

First batch for post 2.7 cycle

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

Merge branch 'vl/grep-configurable-threads'Junio C Hamano Tue, 12 Jan 2016 23:16:55 +0000 (15:16 -0800)

Merge branch 'vl/grep-configurable-threads'

"git grep" can now be configured (or told from the command line)
how many threads to use when searching in the working tree files.

* vl/grep-configurable-threads:
grep: add --threads=<num> option and grep.threads configuration
grep: slight refactoring to the code that disables threading
grep: allow threading even on a single-core machine

Merge branch 'ea/blame-progress'Junio C Hamano Tue, 12 Jan 2016 23:16:54 +0000 (15:16 -0800)

Merge branch 'ea/blame-progress'

"git blame" learned to produce the progress eye-candy when it takes
too much time before emitting the first line of the result.

* ea/blame-progress:
blame: add support for --[no-]progress option

Merge branch 'sb/submodule-parallel-fetch'Junio C Hamano Tue, 12 Jan 2016 23:16:54 +0000 (15:16 -0800)

Merge branch 'sb/submodule-parallel-fetch'

Add a framework to spawn a group of processes in parallel, and use
it to run "git fetch --recurse-submodules" in parallel.

Rerolled and this seems to be a lot cleaner. The merge of the
earlier one to 'next' has been reverted.

* sb/submodule-parallel-fetch:
submodules: allow parallel fetching, add tests and documentation
fetch_populated_submodules: use new parallel job processing
run-command: add an asynchronous parallel child processor
sigchain: add command to pop all common signals
strbuf: add strbuf_read_once to read without blocking
xread: poll on non blocking fds
submodule.c: write "Fetching submodule <foo>" to stderr

Merge branch 'ps/push-delete-option'Junio C Hamano Tue, 12 Jan 2016 23:16:53 +0000 (15:16 -0800)

Merge branch 'ps/push-delete-option'

"branch --delete" has "branch -d" but "push --delete" does not.

* ps/push-delete-option:
push: add '-d' as shorthand for '--delete'
push: add '--delete' flag to synopsis

Merge branch 'ep/make-phoney'Junio C Hamano Tue, 12 Jan 2016 23:16:53 +0000 (15:16 -0800)

Merge branch 'ep/make-phoney'

A slight update to the Makefile.

* ep/make-phoney:
Makefile: add missing phony target

Merge branch 'nd/stop-setenv-work-tree'Junio C Hamano Tue, 12 Jan 2016 23:16:53 +0000 (15:16 -0800)

Merge branch 'nd/stop-setenv-work-tree'

An earlier change in 2.5.x-era broke users' hooks and aliases by
exporting GIT_WORK_TREE to point at the root of the working tree,
interfering when they tried to use a different working tree without
setting GIT_WORK_TREE environment themselves.

* nd/stop-setenv-work-tree:
Revert "setup: set env $GIT_WORK_TREE when work tree is set, like $GIT_DIR"

notes: allow treeish expressions as notes refMike Hommey Thu, 8 Oct 2015 02:54:43 +0000 (11:54 +0900)

notes: allow treeish expressions as notes ref

init_notes() is the main point of entry to the notes API. It ensures
that the input can be used as ref, because it needs a ref to update to
store notes tree after modifying it.

There however are many use cases where notes tree is only read, e.g.
"git log --notes=...". Any notes-shaped treeish could be used for such
purpose, but it is not allowed due to existing restriction.

Allow treeish expressions to be used in the case the notes tree is going
to be used without write "permissions". Add a flag to distinguish
whether the notes tree is intended to be used read-only, or will be
updated.

With this change, operations that use notes read-only can be fed any
notes-shaped tree-ish can be used, e.g. git log --notes=notes@{1}.

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint' of git://github.com/git-l10n/git... Junio C Hamano Tue, 12 Jan 2016 23:05:05 +0000 (15:05 -0800)

Merge branch 'maint' of git://github.com/git-l10n/git-po into maint

* 'maint' of git://github.com/git-l10n/git-po:
l10n: ko.po: Add Korean translation

gitweb: squelch "uninitialized value" warningØyvind A. Holm Tue, 12 Jan 2016 03:31:56 +0000 (04:31 +0100)

gitweb: squelch "uninitialized value" warning

git_object() chomps $type that is read from "cat-file -t", but
it does so before checking if $type is defined, resulting in
a Perl warning in the server error log:

gitweb.cgi: Use of uninitialized value $type in scalar chomp at
[...]/gitweb.cgi line 7579., referer: [...]

when trying to access a non-existing commit, for example:

http://HOST/?p=PROJECT.git;a=commit;h=NON_EXISTING_COMMIT

Check the value in $type before chomping. This will cause us to
call href with its action parameter set to undef when formulating
the URL to redirect to, but that is harmless, as the function treats
a parameter that set to undef as if it does not exist.

Signed-off-by: Øyvind A. Holm <sunny@sunbase.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/grep: add grep.fallbackToNoIndex configThomas Gummerer Tue, 12 Jan 2016 10:40:26 +0000 (11:40 +0100)

builtin/grep: add grep.fallbackToNoIndex config

Currently when git grep is used outside of a git repository without the
--no-index option git simply dies. For convenience, add a
grep.fallbackToNoIndex configuration variable. If set to true, git grep
behaves like git grep --no-index if it is run outside of a git
repository. It defaults to false, preserving the current behavior.

Helped-by: Jeff King <peff@peff.net>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Handle more file writes correctly in shared reposJohannes Schindelin Mon, 11 Jan 2016 18:35:54 +0000 (19:35 +0100)

Handle more file writes correctly in shared repos

In shared repositories, we have to be careful when writing files whose
permissions do not allow users other than the owner to write them.

In particular, we force the marks file of fast-export and the FETCH_HEAD
when fetching to be rewritten from scratch.

This commit does not touch other calls to fopen() that want to
write files:

- commands that write to working tree files (core.sharedRepository
does not affect permission bits of working tree files),
e.g. .rej file created by "apply --reject", result of applying a
previous conflict resolution by "rerere", "git merge-file".

- git am, when splitting mails (git-am correctly cleans up its directory
after finishing, so there is no need to share those files between users)

- git submodule clone, when writing the .git file, because the file
will not be overwritten

- git_terminal_prompt() in compat/terminal.c, because it is not writing to
a file at all

- git diff --output, because the output file is clearly not intended to be
shared between the users of the current repository

- git fast-import, when writing a crash report, because the reports' file
names are unique due to an embedded process ID

- mailinfo() in mailinfo.c, because the output is clearly not intended to
be shared between the users of the current repository

- check_or_regenerate_marks() in remote-testsvn.c, because this is only
used for Git's internal testing

- git fsck, when writing lost&found blobs (this should probably be
changed, but left as a low-hanging fruit for future contributors).

Note that this patch does not touch callers of write_file() and
write_file_gently(), which would benefit from the same scrutiny as
to usage in shared repositories. Most notable users are branch,
daemon, submodule & worktree, and a worrisome call in transport.c
when updating one ref (which ignores the shared flag).

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

t7810: correct --no-index testThomas Gummerer Mon, 11 Jan 2016 21:26:19 +0000 (22:26 +0100)

t7810: correct --no-index test

GIT_CEILING_DIRECTORIES doesn't prevent chdir up into another directory
while looking for a repository directory if it is equal to the current
directory. Because of this, the test which claims to test the git grep
--no-index command outside of a repository actually tests it inside of a
repository. The test_must_fail assertions still pass because the git
grep only looks at untracked files and therefore no file matches, but
not because it's run outside of a repository as it was originally
intended.

Set the GIT_CEILING_DIRECTORIES environment variable to the parent
directory of the directory in which the git grep command is executed, to
make sure it is actually run outside of a git repository.

In addition, the && chain was broken in a couple of places in the same
test, fix that.

Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

docs: clarify that --depth for git-fetch works with... Sebastian Schuberth Fri, 8 Jan 2016 09:32:52 +0000 (10:32 +0100)

docs: clarify that --depth for git-fetch works with newly initialized repos

The original wording sounded as if --depth could only be used to deepen or
shorten the history of existing repos. However, that is not the case. In a
workflow like

$ git init
$ git remote add origin https://github.com/git/git.git
$ git fetch --depth=1

The newly initialized repo is properly created as a shallow repo.

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

docs: say "commits" in the --depth option wording for... Sebastian Schuberth Fri, 8 Jan 2016 09:18:21 +0000 (10:18 +0100)

docs: say "commits" in the --depth option wording for git-clone

It is not wrong to talk about "revisions" here, but in this context
revisions are always commits, and that is how we already name it in the
git-fetch docs. So align the docs by always referring to "commits".

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

Revert "dir.c: don't exclude whole dir prematurely... Nguyễn Thái Ngọc Duy Fri, 8 Jan 2016 12:05:25 +0000 (19:05 +0700)

Revert "dir.c: don't exclude whole dir prematurely if neg pattern may match"

This reverts commit 57534ee77d22e725d971ee89c77dc6aad61c573f. The
feature added in that commit requires that patterns behave the same way
from anywhere. But some patterns can behave differently depending on
current "working" directory. The conditions to catch and avoid these
patterns are too loose. The untracked listing[1] and sparse-checkout
selection[2] can become incorrect as a result.

[1] http://article.gmane.org/gmane.comp.version-control.git/283520
[2] http://article.gmane.org/gmane.comp.version-control.git/283532

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

commit: allow editing the commit message even in shared... Johannes Schindelin Wed, 6 Jan 2016 13:09:43 +0000 (14:09 +0100)

commit: allow editing the commit message even in shared repos

It was pointed out by Yaroslav Halchenko that the file containing the
commit message is writable only by the owner, which means that we have
to rewrite it from scratch in a shared repository.

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

docs: clarify that passing --depth to git-clone implies... Sebastian Schuberth Wed, 6 Jan 2016 13:06:47 +0000 (14:06 +0100)

docs: clarify that passing --depth to git-clone implies --single-branch

It is confusing to document how --depth behaves as part of the
--single-branch docs. Better move that part to the --depth docs, saying
that it implies --single-branch by default.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Expand documentation describing --signoffDavid A. Wheeler Tue, 5 Jan 2016 19:20:26 +0000 (14:20 -0500)

Expand documentation describing --signoff

Modify various document (man page) files to explain
in more detail what --signoff means.

This was inspired by https://lwn.net/Articles/669976/ where
paulj noted, "adding [the] '-s' argument to [a] git commit
doesn't really mean you have even heard of the DCO...".
Extending git's documentation will make it easier to argue
that developers understood --signoff when they use it.

Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

reflog-walk: don't segfault on non-commit sha1's in... Dennis Kaarsemaker Tue, 5 Jan 2016 21:12:10 +0000 (22:12 +0100)

reflog-walk: don't segfault on non-commit sha1's in the reflog

git reflog (ab)uses the log machinery to display its list of log
entries. To do so it must fake commit parent information for the log
walker.

For refs in refs/heads this is no problem, as they should only ever
point to commits. Tags and other refs however can point to anything,
thus their reflog may contain non-commit objects.

To avoid segfaulting, we check whether reflog entries are commits before
feeding them to the log walker and skip any non-commits. This means that
git reflog output will be incomplete for such refs, but that's one step
up from segfaulting. A more complete solution would be to decouple git
reflog from the log walker machinery.

Signed-off-by: Dennis Kaarsemaker <dennis@kaarsemaker.net>
Helped-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t6050-replace: make failing editor test more robustSZEDER Gábor Tue, 5 Jan 2016 10:33:30 +0000 (11:33 +0100)

t6050-replace: make failing editor test more robust

'git replace --edit' should error out when the invoked editor fails,
but the test checking this behavior would not notice if this weren't
the case.

The test in question, ever since it was added in 85f98fc037ae
(replace: add tests for --edit, 2014-05-17), has simulated a failing
editor in an unconventional way:

test_must_fail env GIT_EDITOR='./fakeeditor;false' git replace --edit

I presume the reason for this unconventional editor was the fact that
'git replace --edit' requires the edited object to be different from
the original, but a mere 'false' as editor would leave the object
unchanged and 'git replace --edit' would error out anyway complaining
about the new and the original object files being the same. Running
'fakeeditor' before 'false' was supposed to ensure that the object
file is modified and thus 'git replace --edit' errors out because of
the failed editor.

However, this editor doesn't actually modify the edited object,
because start_command() turns this editor into:

/bin/sh -c './fakeeditor;false "$@"' './fakeeditor;false' \
'.../.git/REPLACE_EDITOBJ'

This means that the test's fakeeditor script doesn't even get the path
of the object to be edited as argument, triggering error messages from
the commands executed inside the script ('sed' and 'mv'), and
ultimately leaving the object file unchanged.

If a patch were to remove the die() from the error path after
launch_editor(), the test would not catch it, because 'git replace'
would continue execution past launch_editor() and would error out a
bit later due to the unchanged edited object. Though 'git replace'
would error out for the wrong reason, this would satisfy
'test_must_fail' just as well, and the test would succeed leaving the
undesired change unnoticed.

Create a proper failing fake editor script for this test to ensure
that the edited object is in fact modified and 'git replace --edit'
won't error out because the new and original object files are the
same.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

for-each-ref: document `creatordate` and `creator`... Eric Wong Tue, 5 Jan 2016 03:51:57 +0000 (03:51 +0000)

for-each-ref: document `creatordate` and `creator` fields

These were introduced back in 2006 at 3175aa1ec28c but
never documented.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git 2.7 v2.7.0Junio C Hamano Mon, 4 Jan 2016 22:08:04 +0000 (14:08 -0800)

Git 2.7

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

Sync with 2.6.5Junio C Hamano Mon, 4 Jan 2016 22:06:59 +0000 (14:06 -0800)

Sync with 2.6.5

Git 2.6.5 v2.6.5Junio C Hamano Mon, 4 Jan 2016 22:06:00 +0000 (14:06 -0800)

Git 2.6.5

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

Merge branch 'jk/pending-keep-tag-name' into maintJunio C Hamano Mon, 4 Jan 2016 22:03:07 +0000 (14:03 -0800)

Merge branch 'jk/pending-keep-tag-name' into maint

History traversal with "git log --source" that starts with an
annotated tag failed to report the tag as "source", due to an
old regression in the command line parser back in v2.2 days.

* jk/pending-keep-tag-name:
revision.c: propagate tag names from pending array

Merge branch 'jk/symbolic-ref-maint' into maintJunio C Hamano Mon, 4 Jan 2016 22:02:58 +0000 (14:02 -0800)

Merge branch 'jk/symbolic-ref-maint' into maint

"git symbolic-ref" forgot to report a failure with its exit status.

* jk/symbolic-ref-maint:
t1401: test reflog creation for git-symbolic-ref
symbolic-ref: propagate error code from create_symref()

Merge branch 'jk/ident-loosen-getpwuid' into maintJunio C Hamano Mon, 4 Jan 2016 22:02:57 +0000 (14:02 -0800)

Merge branch 'jk/ident-loosen-getpwuid' into maint

When getpwuid() on the system returned NULL (e.g. the user is not
in the /etc/passwd file or other uid-to-name mappings), the
codepath to find who the user is to record it in the reflog barfed
and died. Loosen the check in this codepath, which already accepts
questionable ident string (e.g. host part of the e-mail address is
obviously bogus), and in general when we operate fmt_ident() function
in non-strict mode.

* jk/ident-loosen-getpwuid:
ident: loosen getpwuid error in non-strict mode
ident: keep a flag for bogus default_email
ident: make xgetpwuid_self() a static local helper

Merge branch 'jk/send-email-ssl-errors' into maintJunio C Hamano Mon, 4 Jan 2016 22:02:55 +0000 (14:02 -0800)

Merge branch 'jk/send-email-ssl-errors' into maint

Improve error reporting when SMTP TLS fails.

* jk/send-email-ssl-errors:
send-email: enable SSL level 1 debug output

Merge branch 'sg/completion-no-column' into maintJunio C Hamano Mon, 4 Jan 2016 22:02:45 +0000 (14:02 -0800)

Merge branch 'sg/completion-no-column' into maint

The completion script (in contrib/) used to list "git column"
(which is not an end-user facing command) as one of the choices

* sg/completion-no-column:
completion: remove 'git column' from porcelain commands

git-send-email: do not double-escape quotes from muttEric Wong Mon, 4 Jan 2016 20:53:30 +0000 (20:53 +0000)

git-send-email: do not double-escape quotes from mutt

mutt saves aliases with escaped quotes in the form of:

alias dot \"Dot U. Sir\" <somebody@example.org>

When we pass through our sanitize_address routine,
we end up with double-escaping:

To: "\\\"Dot U. Sir\\\" <somebody@example.org>

Remove the escaping in mutt only for now, as I am not sure
if other mailers can do this or if this is better fixed in
sanitize_address.

Cc: Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr>
Cc: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bswap: add NO_UNALIGNED_LOADS defineJeff King Tue, 29 Dec 2015 06:36:00 +0000 (01:36 -0500)

bswap: add NO_UNALIGNED_LOADS define

The byte-swapping code automatically decides, based on the
platform, whether it is sensible to cast and do a potentially
unaligned ntohl(), or to pick individual bytes out of an
array.

It can be handy to override this decision, though, when
turning on compiler flags that will complain about unaligned
loads (such as -fsanitize=undefined). This patch adds a
macro check to make this possible.

There's no nice Makefile knob here; this is for prodding at
Git's internals, and anybody using it can set
"-DNO_UNALIGNED_LOADS" in the same place they are setting up
"-fsanitize".

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

avoid shifting signed integers 31 bitsJeff King Tue, 29 Dec 2015 06:35:46 +0000 (01:35 -0500)

avoid shifting signed integers 31 bits

We sometimes use 32-bit unsigned integers as bit-fields.
It's fine to access the MSB, because it's unsigned. However,
doing so as "1 << 31" is wrong, because the constant "1" is
a signed int, and we shift into the sign bit, causing
undefined behavior.

We can fix this by using "1U" as the constant.

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

l10n: ko.po: Add Korean translationChangwoo Ryu Sun, 3 Jan 2016 10:07:29 +0000 (19:07 +0900)

l10n: ko.po: Add Korean translation

Signed-off-by: Changwoo Ryu <cwryu@debian.org>
Signed-off-by: Hyunjun Kim <yoloseem@users.noreply.github.com>

Merge tag 'l10n-2.7.0-rnd2+de' of git://github.com... Junio C Hamano Sat, 2 Jan 2016 19:31:43 +0000 (11:31 -0800)

Merge tag 'l10n-2.7.0-rnd2+de' of git://github.com/git-l10n/git-po

l10n-2.7.0-rnd2+de

* tag 'l10n-2.7.0-rnd2+de' of git://github.com/git-l10n/git-po:
l10n: de.po: translate 68 new messages
l10n: de.po: improve some translations

user-manual: add addition gitweb informationStephen P. Smith Wed, 30 Dec 2015 23:25:20 +0000 (16:25 -0700)

user-manual: add addition gitweb information

Rework the section on gitweb to add information about the cgi script
and the instaweb command.

Signed-off-by: Stephen P. Smith <ischis2@cox.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

user-manual: add section documenting shallow clonesStephen P. Smith Wed, 30 Dec 2015 00:03:50 +0000 (17:03 -0700)

user-manual: add section documenting shallow clones

Signed-off-by: Stephen P. Smith <ischis2@cox.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

glossary: define the term shallow cloneStephen P. Smith Tue, 29 Dec 2015 18:54:35 +0000 (11:54 -0700)

glossary: define the term shallow clone

There are several places in the documentation that
the term shallow clone is used. Defining the term
enables its use elsewhere with a known definition.

Signed-off-by: Stephen P. Smith <ischis2@cox.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

run-command: don't warn on SIGPIPE deathsJeff King Tue, 29 Dec 2015 08:12:22 +0000 (03:12 -0500)

run-command: don't warn on SIGPIPE deaths

When git executes a sub-command, we print a warning if the
command dies due to a signal, but make an exception for
"uninteresting" cases like SIGINT and SIGQUIT (since the
user presumably just hit ^C).

We should make a similar exception for SIGPIPE, because it's
an expected and uninteresting return in most cases; it
generally means the user quit the pager before git had
finished generating all output. This used to be very hard
to trigger in practice, because:

1. We only complain if we see a real SIGPIPE death, not
the shell-induced 141 exit code. This means that
anything we run via the shell does not trigger the
warning, which includes most non-trivial aliases.

2. The common case for SIGPIPE is the user quitting the
pager before git has finished generating all output.
But if the user triggers a pager with "-p", we redirect
the git wrapper's stderr to that pager, too. Since the
pager is dead, it means that the message goes nowhere.

3. You can see it if you run your own pager, like
"git foo | head". But that only happens if "foo" is a
non-builtin (so it doesn't work with "log", for
example).

However, it may become more common after 86d26f2, which
teaches alias to re-exec builtins rather than running them
in the same process. This case doesn't trigger (1), as we
don't need a shell to run a git command. It doesn't trigger
(2), because the pager is not started by the original git,
but by the inner re-exec of git. And it doesn't trigger (3),
because builtins are treated more like non-builtins in this
case.

Given how flaky this message already is (e.g., you cannot
even know whether you will see it, as git optimizes out some
shell invocations behind the scenes based on the contents of
the command!), and that it is unlikely to ever provide
useful information, let's suppress it for all cases of
SIGPIPE.

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

l10n: de.po: translate 68 new messagesRalf Thielow Tue, 22 Dec 2015 17:08:06 +0000 (18:08 +0100)

l10n: de.po: translate 68 new messages

Translate 68 new messages came from git.pot update in
f4f2c8f (l10n: git.pot: v2.7.0 round 1 (66 new, 29 removed)) and
2c0ca05 (l10n: git.pot: v2.7.0 round 2 (2 new, 2 removed)).

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Acked-by: Matthias Rüster <matthias.ruester@gmail.com>

l10n: de.po: improve some translationsRalf Thielow Thu, 29 Oct 2015 21:18:32 +0000 (22:18 +0100)

l10n: de.po: improve some translations

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Acked-by: Phillip Sz <phillip.szelat@gmail.com>

Git 2.7-rc3 v2.7.0-rc3Junio C Hamano Mon, 28 Dec 2015 22:00:52 +0000 (14:00 -0800)

Git 2.7-rc3

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

Merge branch 'sh/p4-multi-depot'Junio C Hamano Mon, 28 Dec 2015 21:58:57 +0000 (13:58 -0800)

Merge branch 'sh/p4-multi-depot'

"git p4" when interacting with multiple depots at the same time
used to incorrectly drop changes.

* sh/p4-multi-depot:
git-p4: reduce number of server queries for fetches
git-p4: support multiple depot paths in p4 submit
git-p4: failing test case for skipping changes with multiple depots

Merge branch 'jk/pending-keep-tag-name'Junio C Hamano Mon, 28 Dec 2015 21:58:03 +0000 (13:58 -0800)

Merge branch 'jk/pending-keep-tag-name'

History traversal with "git log --source" that starts with an
annotated tag failed to report the tag as "source", due to an
old regression in the command line parser back in v2.2 days.

* jk/pending-keep-tag-name:
revision.c: propagate tag names from pending array

Merge branch 'jk/symbolic-ref-maint'Junio C Hamano Mon, 28 Dec 2015 21:57:24 +0000 (13:57 -0800)

Merge branch 'jk/symbolic-ref-maint'

"git symbolic-ref" forgot to report a failure with its exit status.

* jk/symbolic-ref-maint:
t1401: test reflog creation for git-symbolic-ref
symbolic-ref: propagate error code from create_symref()

Merge tag 'l10n-2.7.0-rnd2' of git://github.com/git... Junio C Hamano Mon, 28 Dec 2015 21:53:47 +0000 (13:53 -0800)

Merge tag 'l10n-2.7.0-rnd2' of git://github.com/git-l10n/git-po

l10n-2.7.0-rnd2

* tag 'l10n-2.7.0-rnd2' of git://github.com/git-l10n/git-po:
l10n: ru.po: update Russian translation
l10n: Updated Bulgarian translation of git (2477t,0f,0u)
l10n: ca.po: update translation
l10n: zh_CN: for git v2.7.0 l10n round 2
l10n: sv.po: Update Swedish translation (2477t0f0u)
l10n: sv: Fix bad translation
l10n: fr.po v2.7.0 round 2 (2477t)
l10n: git.pot: v2.7.0 round 2 (2 new, 2 removed)
l10n: zh_CN: for git v2.7.0 l10n round 1
l10n: ca.po: update translation
l10n: fr v2.7.0 round 1 (2477t)
l10n: Updated Bulgarian translation of git (2477t,0f,0u)
l10n: sv.po: Update Swedish translation (2477t0f0u)
l10n: vi.po: Updated translation (2477t)
l10n: git.pot: v2.7.0 round 1 (66 new, 29 removed)
l10n: fr.po: Fix typo
l10n: fr.po: Fix typo

user-manual: remove temporary branch entry from todo... Stephen P. Smith Mon, 28 Dec 2015 20:16:44 +0000 (13:16 -0700)

user-manual: remove temporary branch entry from todo list

In the section on "How to check out a different version of a
project" the "new" branch is used as a temporary branch. A detached
HEAD was not used since it was a new feature introduced just a
couple weeks prior.

The section could be changed to use and explain a detached HEAD,
except that would increase the learning curve early in the manual.
Detached HEADs are discussed a couple sections later under
"Examining an old version without creating a new branch".

Let's declare that it is a bad idea to rewrite the example that
uses a temporary branch to do the sightseeing on a detached HEAD.

Signed-off-by: Stephen P. Smith <ischis2@cox.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir.c: clean the entire struct in clear_exclude_list()Nguyễn Thái Ngọc Duy Sun, 27 Dec 2015 01:54:34 +0000 (08:54 +0700)

dir.c: clean the entire struct in clear_exclude_list()

Make sure "el" can be reuseable again. The problem was el->alloc is
not cleared and may cause segfaults next time because add_exclude()
thinks el->excludes (being NULL) has enough space. Just clear the
entire struct to be safe.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

grep: make it clear i-t-a entries are ignoredNguyễn Thái Ngọc Duy Sun, 27 Dec 2015 01:51:32 +0000 (08:51 +0700)

grep: make it clear i-t-a entries are ignored

The expression "!S_ISREG(ce)" covers i-t-a entries as well because
ce->ce_mode would be zero then. I could make a comment saying that, but
it's probably better just to comment with code, in case i-t-a entry
content changes in future.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: ru.po: update Russian translationDimitriy Ryazantcev Fri, 25 Dec 2015 12:02:48 +0000 (14:02 +0200)

l10n: ru.po: update Russian translation

Signed-off-by: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com>

Merge branch 'master' of git://github.com/alshopov... Jiang Xin Mon, 28 Dec 2015 15:13:15 +0000 (23:13 +0800)

Merge branch 'master' of git://github.com/alshopov/git-po

* 'master' of git://github.com/alshopov/git-po:
l10n: Updated Bulgarian translation of git (2477t,0f,0u)

l10n: Updated Bulgarian translation of git (2477t,0f,0u)Alexander Shopov Mon, 28 Dec 2015 09:33:41 +0000 (11:33 +0200)

l10n: Updated Bulgarian translation of git (2477t,0f,0u)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>

l10n: ca.po: update translationAlex Henrie Mon, 28 Dec 2015 04:42:59 +0000 (21:42 -0700)

l10n: ca.po: update translation

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>

l10n: zh_CN: for git v2.7.0 l10n round 2Jiang Xin Tue, 22 Dec 2015 15:06:59 +0000 (23:06 +0800)

l10n: zh_CN: for git v2.7.0 l10n round 2

Update 2 translations (2477t0f0u) for git v2.7.0-rc1.

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

Merge branch 'master' of git://github.com/nafmo/git... Jiang Xin Sat, 26 Dec 2015 13:22:30 +0000 (21:22 +0800)

Merge branch 'master' of git://github.com/nafmo/git-l10n-sv

* 'master' of git://github.com/nafmo/git-l10n-sv:
l10n: sv.po: Update Swedish translation (2477t0f0u)
l10n: sv: Fix bad translation

l10n: sv.po: Update Swedish translation (2477t0f0u)Peter Krefting Sat, 26 Dec 2015 11:27:15 +0000 (12:27 +0100)

l10n: sv.po: Update Swedish translation (2477t0f0u)

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>

l10n: sv: Fix bad translationPeter Krefting Sat, 7 Nov 2015 14:48:20 +0000 (15:48 +0100)

l10n: sv: Fix bad translation

Found-by: Sebastian Rasmussen <sebras@gmail.com>
Signed-off-by: Peter Krefting <peter@softwolves.pp.se>

l10n: fr.po v2.7.0 round 2 (2477t)Jean-Noel Avila Thu, 24 Dec 2015 06:38:22 +0000 (07:38 +0100)

l10n: fr.po v2.7.0 round 2 (2477t)

Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>

Git 2.7-rc2 v2.7.0-rc2Junio C Hamano Tue, 22 Dec 2015 22:46:01 +0000 (14:46 -0800)

Git 2.7-rc2

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

Merge branch 'js/emu-write-epipe-on-windows'Junio C Hamano Tue, 22 Dec 2015 22:45:16 +0000 (14:45 -0800)

Merge branch 'js/emu-write-epipe-on-windows'

The write(2) emulation for Windows learned to set errno to EPIPE
when necessary.

* js/emu-write-epipe-on-windows:
mingw: emulate write(2) that fails with a EPIPE

push: don't mark options of recurse-submodules for... Ralf Thielow Tue, 22 Dec 2015 17:53:00 +0000 (18:53 +0100)

push: don't mark options of recurse-submodules for translation

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git.c: make sure we do not leak GIT_* to alias scriptsNguyễn Thái Ngọc Duy Sun, 20 Dec 2015 07:50:19 +0000 (14:50 +0700)

git.c: make sure we do not leak GIT_* to alias scripts

The unfortunate commit d95138e (setup: set env $GIT_WORK_TREE when
work tree is set, like $GIT_DIR - 2015-06-26) exposes another problem,
besides git-clone that's described in the previous commit. If
GIT_WORK_TREE (or even GIT_DIR) is exported to an alias script, it may
mislead git commands in the script where the repo is. Granted, most
scripts work on the repo where the alias is summoned from. But nowhere
do we forbid the script to visit another repository.

The revert of d95138e in the previous commit is sufficient as a
fix. However, to protect us from accidentally leaking GIT_*
environment variables again, we restore certain sensitive env before
calling the external script.

GIT_PREFIX is let through because there's another setup side effect
that we simply accepted so far: current working directory is
moved. Maybe in future we can introduce a new alias format that
guarantees no cwd move, then we can unexport GIT_PREFIX.

Reported-by: Gabriel Ganne <gabriel.ganne@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

setup.c: re-fix d95138e (setup: set env $GIT_WORK_TREE... Nguyễn Thái Ngọc Duy Sun, 20 Dec 2015 07:50:18 +0000 (14:50 +0700)

setup.c: re-fix d95138e (setup: set env $GIT_WORK_TREE when ..

Commit d95138e [1] attempted to fix a .git file problem by
setting GIT_WORK_TREE whenever GIT_DIR is set. It sounded harmless
because we handle GIT_DIR and GIT_WORK_TREE side by side for most
commands, with two exceptions: git-init and git-clone.

"git clone" is not happy with d95138e. This command ignores GIT_DIR
but respects GIT_WORK_TREE [2] [3] which means it used to run fine
from a hook, where GIT_DIR was set but GIT_WORK_TREE was not (*).
With d95138e, GIT_WORK_TREE is set all the time and git-clone
interprets that as "I give you order to put the worktree here",
usually against the user's intention.

The solution in d95138e is reverted earlier, and instead we reuse
the solution from c056261 [4]. It fixed another setup-messed-
up-by-alias by saving and restoring env and spawning a new process,
but for git-clone and git-init only.

Now we conclude that setup-messed-up-by-alias is always evil. So the
env restoration is done for _all_ commands, including external ones,
whenever aliases are involved. It fixes what d95138e tried to fix,
without upsetting git-clone-inside-hooks.

The test from d95138e remains to verify it's not broken by this. A new
test is added to make sure git-clone-inside-hooks remains happy.

(*) GIT_WORK_TREE was not set _most of the time_. In some cases
GIT_WORK_TREE is set and git-clone will behave differently. The
use of GIT_WORK_TREE to direct git-clone to put work tree
elsewhere looks like a mistake because it causes surprises this
way. But that's a separate story.

[1] d95138e (setup: set env $GIT_WORK_TREE when work tree is set, like
$GIT_DIR - 2015-06-26)
[2] 2beebd2 (clone: create intermediate directories of destination
repo - 2008-06-25)
[3] 20ccef4 (make git-clone GIT_WORK_TREE aware - 2007-07-06)
[4] c056261 (git potty: restore environments after alias expansion -
2014-06-08)

Reported-by: Anthony Sottile <asottile@umich.edu>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git.c: make it clear save_env() is for alias handling... Nguyễn Thái Ngọc Duy Thu, 3 Dec 2015 18:17:55 +0000 (19:17 +0100)

git.c: make it clear save_env() is for alias handling only

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'nd/stop-setenv-work-tree' into nd/clear... Junio C Hamano Tue, 22 Dec 2015 21:39:47 +0000 (13:39 -0800)

Merge branch 'nd/stop-setenv-work-tree' into nd/clear-gitenv-upon-use-of-alias

* nd/stop-setenv-work-tree:
Revert "setup: set env $GIT_WORK_TREE when work tree is set, like $GIT_DIR"

Revert "setup: set env $GIT_WORK_TREE when work tree... Nguyễn Thái Ngọc Duy Mon, 21 Dec 2015 10:22:52 +0000 (17:22 +0700)

Revert "setup: set env $GIT_WORK_TREE when work tree is set, like $GIT_DIR"

This reverts d95138e6 (setup: set env $GIT_WORK_TREE when work tree
is set, like $GIT_DIR, 2015-06-26).

It has caused three regression reports so far.

http://article.gmane.org/gmane.comp.version-control.git/281608
http://article.gmane.org/gmane.comp.version-control.git/281979
http://article.gmane.org/gmane.comp.version-control.git/282691

All of them are about spawning git subprocesses, where the new
presence of GIT_WORK_TREE either changes command behaviour (git-init
or git-clone), or how repo/worktree is detected (from aliases), with
or without $GIT_DIR.

The original bug will be re-fixed another way.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: git.pot: v2.7.0 round 2 (2 new, 2 removed)Jiang Xin Tue, 22 Dec 2015 14:51:43 +0000 (22:51 +0800)

l10n: git.pot: v2.7.0 round 2 (2 new, 2 removed)

Generate po/git.pot from v2.7.0-rc1-44-g1d88dab for git v2.7.0 l10n round 2.

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

Merge branch 'master' of git://github.com/git-l10n... Jiang Xin Tue, 22 Dec 2015 14:50:24 +0000 (22:50 +0800)

Merge branch 'master' of git://github.com/git-l10n/git-po

* 'master' of git://github.com/git-l10n/git-po:
l10n: zh_CN: for git v2.7.0 l10n round 1
l10n: ca.po: update translation
l10n: fr v2.7.0 round 1 (2477t)
l10n: Updated Bulgarian translation of git (2477t,0f,0u)
l10n: sv.po: Update Swedish translation (2477t0f0u)
l10n: vi.po: Updated translation (2477t)
l10n: git.pot: v2.7.0 round 1 (66 new, 29 removed)
l10n: fr.po: Fix typo
l10n: fr.po: Fix typo

pack-revindex: store entries directly in packed_gitJeff King Mon, 21 Dec 2015 06:20:33 +0000 (01:20 -0500)

pack-revindex: store entries directly in packed_git

A pack_revindex struct has two elements: the revindex
entries themselves, and a pointer to the packed_git. We need
both to do lookups, because only the latter knows things
like the number of objects in the pack.

Now that packed_git contains the pack_revindex struct it's
just as easy to pass around the packed_git itself, and we do
not need the extra back-pointer.

We can instead just store the entries directly in the pack.
All functions which took a pack_revindex now just take a
packed_git. We still lazy-load in find_pack_revindex, so
most callers are unaffected.

The exception is the bitmap code, which computes the
revindex and caches the pointer when we load the bitmaps. We
can continue to load, drop the extra cache pointer, and just
access bitmap_git.pack.revindex directly.

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

pack-revindex: drop hash tableJeff King Mon, 21 Dec 2015 06:19:49 +0000 (01:19 -0500)

pack-revindex: drop hash table

The main entry point to the pack-revindex code is
find_pack_revindex(). This calls revindex_for_pack(), which
lazily computes and caches the revindex for the pack.

We store the cache in a very simple hash table. It's created
by init_pack_revindex(), which inserts an entry for every
packfile we know about, and we never grow or shrink the
hash. If we ever need the revindex for a pack that isn't in
the hash, we die() with an internal error.

This can lead to a race, because we may load more packs
after having called init_pack_revindex(). For example,
imagine we have one process which needs to look at the
revindex for a variety of objects (e.g., cat-file's
"%(objectsize:disk)" format). Simultaneously, git-gc is
running, which is doing a `git repack -ad`. We might hit a
sequence like:

1. We need the revidx for some packed object. We call
find_pack_revindex() and end up in init_pack_revindex()
to create the hash table for all packs we know about.

2. We look up another object and can't find it, because
the repack has removed the pack it's in. We re-scan the
pack directory and find a new pack containing the
object. It gets added to our packed_git list.

3. We call find_pack_revindex() for the new object, which
hits revindex_for_pack() for our new pack. It can't
find the packed_git in the revindex hash, and dies.

You could also replace the `repack` above with a push or
fetch to create a new pack, though these are less likely
(you would have to somehow learn about the new objects to
look them up).

Prior to 1a6d8b9 (do not discard revindex when re-preparing
packfiles, 2014-01-15), this was safe, as we threw away the
revindex whenever we re-scanned the pack directory (and thus
re-created the revindex hash on the fly). However, we don't
want to simply revert that commit, as it was solving a
different race.

So we have a few options:

- We can fix the race in 1a6d8b9 differently, by having
the bitmap code look in the revindex hash instead of
caching the pointer. But this would introduce a lot of
extra hash lookups for common bitmap operations.

- We could teach the revindex to dynamically add new packs
to the hash table. This would perform the same, but
would mean adding extra code to the revindex hash (which
currently cannot be resized at all).

- We can get rid of the hash table entirely. There is
exactly one revindex per pack, so we can just store it
in the packed_git struct. Since it's initialized lazily,
it does not add to the startup cost.

This is the best of both worlds: less code and fewer
hash table lookups. The original code likely avoided
this in the name of encapsulation. But the packed_git
and reverse_index code are fairly intimate already, so
it's not much of a loss.

This patch implements the final option. It's a minimal
conversion that retains the pack_revindex struct. No callers
need to change, and we can do further cleanup in a follow-on
patch.

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

t1401: test reflog creation for git-symbolic-refJeff King Sun, 20 Dec 2015 07:27:23 +0000 (02:27 -0500)

t1401: test reflog creation for git-symbolic-ref

The current code writes a reflog entry whenever we update a
symbolic ref, but we never test that this is so. Let's add a
test to make sure upcoming refactoring doesn't cause a
regression.

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

symbolic-ref: propagate error code from create_symref()Jeff King Sun, 20 Dec 2015 07:27:18 +0000 (02:27 -0500)

symbolic-ref: propagate error code from create_symref()

If create_symref() fails, git-symbolic-ref will still exit
with code 0, and our caller has no idea that the command did
nothing.

This appears to have been broken since the beginning of time
(e.g., it is not a regression where create_symref() stopped
calling die() or something similar).

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

git-p4: reduce number of server queries for fetchesSam Hocevar Sat, 19 Dec 2015 09:39:40 +0000 (09:39 +0000)

git-p4: reduce number of server queries for fetches

When fetching changes from a depot using a full client spec, there
is no need to perform as many queries as there are top-level paths
in the client spec. Instead we query all changes in chronological
order, also getting rid of the need to sort the results and remove
duplicates.

Signed-off-by: Sam Hocevar <sam@hocevar.net>
Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: support multiple depot paths in p4 submitSam Hocevar Sat, 19 Dec 2015 09:39:39 +0000 (09:39 +0000)

git-p4: support multiple depot paths in p4 submit

When submitting from a repository that was cloned using a client spec,
use the full list of paths when ruling out files that are outside the
view. This fixes a bug where only files pertaining to the first path
would be included in the p4 submit.

Signed-off-by: Sam Hocevar <sam@hocevar.net>
Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update release notes to 2.7Junio C Hamano Mon, 21 Dec 2015 19:08:20 +0000 (11:08 -0800)

Update release notes to 2.7

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

Merge branch 'bc/format-patch-null-from-line'Junio C Hamano Mon, 21 Dec 2015 18:59:07 +0000 (10:59 -0800)

Merge branch 'bc/format-patch-null-from-line'

"format-patch" has learned a new option to zero-out the commit
object name on the mbox "From " line.

* bc/format-patch-null-from-line:
format-patch: check that header line has expected format
format-patch: add an option to suppress commit hash
sha1_file.c: introduce a null_oid constant

Merge branch 'jk/ident-loosen-getpwuid'Junio C Hamano Mon, 21 Dec 2015 18:59:07 +0000 (10:59 -0800)

Merge branch 'jk/ident-loosen-getpwuid'

When getpwuid() on the system returned NULL (e.g. the user is not
in the /etc/passwd file or other uid-to-name mappings), the
codepath to find who the user is to record it in the reflog barfed
and died. Loosen the check in this codepath, which already accepts
questionable ident string (e.g. host part of the e-mail address is
obviously bogus), and in general when we operate fmt_ident() function
in non-strict mode.

* jk/ident-loosen-getpwuid:
ident: loosen getpwuid error in non-strict mode
ident: keep a flag for bogus default_email
ident: make xgetpwuid_self() a static local helper

Merge branch 'jk/send-email-ssl-errors'Junio C Hamano Mon, 21 Dec 2015 18:59:06 +0000 (10:59 -0800)

Merge branch 'jk/send-email-ssl-errors'

Improve error reporting when SMTP TLS fails.

* jk/send-email-ssl-errors:
send-email: enable SSL level 1 debug output

Merge branch 'sg/completion-no-column'Junio C Hamano Mon, 21 Dec 2015 18:59:06 +0000 (10:59 -0800)

Merge branch 'sg/completion-no-column'

The completion script (in contrib/) used to list "git column"
(which is not an end-user facing command) as one of the choices

* sg/completion-no-column:
completion: remove 'git column' from porcelain commands

Merge branch 'mc/push-recurse-submodules-config'Junio C Hamano Mon, 21 Dec 2015 18:59:05 +0000 (10:59 -0800)

Merge branch 'mc/push-recurse-submodules-config'

Add new config to avoid typing "--recurse-submodules" on each push.

* mc/push-recurse-submodules-config:
push: follow the "last one wins" convention for --recurse-submodules
push: test that --recurse-submodules on command line overrides config
push: add recurseSubmodules config option

mingw: emulate write(2) that fails with a EPIPEJohannes Schindelin Thu, 17 Dec 2015 17:08:15 +0000 (18:08 +0100)

mingw: emulate write(2) that fails with a EPIPE

On Windows, when writing to a pipe fails, errno is always
EINVAL. However, Git expects it to be EPIPE.

According to the documentation, there are two cases in which write()
triggers EINVAL: the buffer is NULL, or the length is odd but the mode
is 16-bit Unicode (the broken pipe is not mentioned as possible cause).
Git never sets the file mode to anything but binary, therefore we know
that errno should actually be EPIPE if it is EINVAL and the buffer is
not NULL.

See https://msdn.microsoft.com/en-us/library/1570wh78.aspx for more
details.

This works around t5571.11 failing with v2.6.4 on Windows.

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

Merge git://ozlabs.org/~paulus/gitkJunio C Hamano Mon, 21 Dec 2015 16:56:16 +0000 (08:56 -0800)

Merge git://ozlabs.org/~paulus/gitk

* git://ozlabs.org/~paulus/gitk:
gitk: sv.po: Update Swedish translation (311t)
gitk: Let .bleft.mid widgets 'breathe'
gitk: Match ttk fonts to gitk fonts
gitk: Update revision date in Japanese PO file
gitk: Update "Language:" header
gitk: Improve translation message
gitk: Remove unused line
gitk: Update year
gitk: Change last translator line
gitk: Update fuzzy messages
gitk: Update Japanese translation
gitk: Fix translation around copyright sign
gitk: Update Japanese translation
gitk: Fix wrong translation
gitk: Translate Japanese catalog
gitk: Translate more to Japanese catalog
gitk: Update Japanese message catalog
gitk: Re-sync line number in Japanese message catalogue
gitk: Color name update