gitweb.git
Merge branch 'jk/filter-branch-no-index'Junio C Hamano Fri, 4 Dec 2015 19:19:10 +0000 (11:19 -0800)

Merge branch 'jk/filter-branch-no-index'

Speed up filter-branch for cases where we only care about rewriting
commits, not tree data.

* jk/filter-branch-no-index:
filter-branch: skip index read/write when possible

Merge branch 'ad/sha1-update-chunked'Junio C Hamano Fri, 4 Dec 2015 19:19:09 +0000 (11:19 -0800)

Merge branch 'ad/sha1-update-chunked'

Apple's common crypto implementation of SHA1_Update() does not take
more than 4GB at a time, and we now have a compile-time workaround
for it.

* ad/sha1-update-chunked:
sha1: allow limiting the size of the data passed to SHA1_Update()
sha1: provide another level of indirection for the SHA-1 functions

Merge branch 'mk/blame-first-parent'Jeff King Tue, 1 Dec 2015 23:54:58 +0000 (18:54 -0500)

Merge branch 'mk/blame-first-parent'

Regression fix for a topic already in master.

* mk/blame-first-parent:
blame: fix object casting regression

Merge branch 'jk/send-email-ca-path'Jeff King Tue, 1 Dec 2015 23:54:54 +0000 (18:54 -0500)

Merge branch 'jk/send-email-ca-path'

Use a safer behavior when we hit errors verifying remote certificates.

* jk/send-email-ca-path:
send-email: die if CA path doesn't exist

Merge branch 'rs/fsck-nul-header'Jeff King Tue, 1 Dec 2015 23:54:47 +0000 (18:54 -0500)

Merge branch 'rs/fsck-nul-header'

Fsck did not correctly detect a NUL-truncated header in a tag.

* rs/fsck-nul-header:
fsck: treat a NUL in a tag header as an error
t1450: add tests for NUL in headers of commits and tags

Merge branch 'ls/p4-test-timeouts'Jeff King Tue, 1 Dec 2015 23:54:40 +0000 (18:54 -0500)

Merge branch 'ls/p4-test-timeouts'

Work around some test flakiness with p4d.

* ls/p4-test-timeouts:
git-p4: add trap to kill p4d on test exit
git-p4: add p4d timeout in tests
git-p4: retry kill/cleanup operations in tests with timeout

Merge branch 'js/test-modernize-t9300'Jeff King Tue, 1 Dec 2015 23:54:37 +0000 (18:54 -0500)

Merge branch 'js/test-modernize-t9300'

Clean up style in an ancient test.

* js/test-modernize-t9300:
modernize t9300: move test preparations into test_expect_success
modernize t9300: mark here-doc words to ignore tab indentation
modernize t9300: use test_when_finished for clean-up
modernize t9300: wrap lines after &&
modernize t9300: use test_must_be_empty
modernize t9300: use test_must_fail
modernize t9300: single-quote placement and indentation

Merge branch 'jk/send-email-expand-paths'Jeff King Tue, 1 Dec 2015 23:54:34 +0000 (18:54 -0500)

Merge branch 'jk/send-email-expand-paths'

Expand paths in some send-email config variables.

* jk/send-email-expand-paths:
send-email: expand path in sendemail.smtpsslcertpath config

Merge branch 'dg/subtree-test-cleanup'Jeff King Tue, 1 Dec 2015 23:54:31 +0000 (18:54 -0500)

Merge branch 'dg/subtree-test-cleanup'

Test cleanups for the subtree project.

* dg/subtree-test-cleanup:
contrib/subtree: Handle '--prefix' argument with a slash appended
contrib/subtree: Make each test self-contained
contrib/subtree: Add split tests
contrib/subtree: Add merge tests
contrib/subtree: Add tests for subtree add
contrib/subtree: Add test for missing subtree
contrib/subtree: Clean and refactor test code

Merge branch 'dt/http-range'Jeff King Tue, 1 Dec 2015 23:54:28 +0000 (18:54 -0500)

Merge branch 'dt/http-range'

Portability fix for a topic already in 'master'.

* dt/http-range:
http: fix some printf format warnings

verify_pack: do not ignore return value of verification... David Turner Mon, 30 Nov 2015 22:47:42 +0000 (17:47 -0500)

verify_pack: do not ignore return value of verification function

In verify_pack, a caller-supplied verification function is called.
The function returns an int. If that return value is non-zero,
verify_pack should fail.

The only caller of verify_pack is in builtin/fsck.c, whose verify_fn
returns a meaningful error code (which was then ignored). Now, fsck
might return a different error code (with more detail). This would
happen in the unlikely event that a commit or tree that is a valid git
object but not a valid instance of its type gets into a pack.

Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Jeff King <peff@peff.net>

Make error message after failing commit_lock_file(... SZEDER Gábor Mon, 30 Nov 2015 11:40:53 +0000 (12:40 +0100)

Make error message after failing commit_lock_file() less confusing

The error message after a failing commit_lock_file() call sometimes
looks like this, causing confusion:

$ git remote add remote git@server.com/repo.git
error: could not commit config file .git/config
# Huh?!
# I didn't want to commit anything, especially not my config file!

While in the narrow context of the lockfile module using the verb
'commit' in the error message makes perfect sense, in the broader
context of git the word 'commit' already has a very specific meaning,
hence the confusion.

Reword these error messages to say "could not write" instead of "could
not commit".

While at it, include strerror in the error messages after writing the
config file or the credential store fails to provide some information
about the cause of the failure, and update the style of the error
message after writing the reflog fails to match surrounding error
messages (i.e. no '' around the pathname and no () around the error
description).

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Jeff King <peff@peff.net>

Merge branch 'maint'Jeff King Tue, 1 Dec 2015 22:32:38 +0000 (17:32 -0500)

Merge branch 'maint'

* maint:
http: treat config options sslCAPath and sslCAInfo as paths
Documentation/diff: give --word-diff-regex=. example
filter-branch: deal with object name vs. pathname ambiguity in tree-filter
check-ignore: correct documentation about output
git-p4: clean up after p4 submit failure
git-p4: work with a detached head
git-p4: add option to system() to return subshell status
git-p4: add failing test for submit from detached head
remote-http(s): support SOCKS proxies
t5813: avoid creating urls that break on cygwin
Escape Git's exec path in contrib/rerere-train.sh script
allow hooks to ignore their standard input stream
rebase-i-exec: Allow space in SHELL_PATH
Documentation: make environment variable formatting more consistent

Merge branch 'eg/p4-submit-catch-failure' into maintJeff King Tue, 1 Dec 2015 22:24:20 +0000 (17:24 -0500)

Merge branch 'eg/p4-submit-catch-failure' into maint

Just like the working tree is cleaned up when the user cancelled
submission in P4Submit.applyCommit(), clean up the mess if "p4
submit" fails.

* eg/p4-submit-catch-failure:
git-p4: clean up after p4 submit failure

Merge branch 'dk/check-ignore-docs' into maintJeff King Tue, 1 Dec 2015 22:21:31 +0000 (17:21 -0500)

Merge branch 'dk/check-ignore-docs' into maint

Documentation clarification for "check-ignore" without "--verbose".

* dk/check-ignore-docs:
check-ignore: correct documentation about output

Merge branch 'ld/p4-detached-head' into maintJeff King Tue, 1 Dec 2015 22:21:29 +0000 (17:21 -0500)

Merge branch 'ld/p4-detached-head' into maint

Make git-p4 work on a detached head.

* ld/p4-detached-head:
git-p4: work with a detached head
git-p4: add option to system() to return subshell status
git-p4: add failing test for submit from detached head

Merge branch 'sg/filter-branch-dwim-ambiguity' into... Jeff King Tue, 1 Dec 2015 22:21:17 +0000 (17:21 -0500)

Merge branch 'sg/filter-branch-dwim-ambiguity' into maint

Fix for a corner case in filter-branch.

* sg/filter-branch-dwim-ambiguity:
filter-branch: deal with object name vs. pathname ambiguity in tree-filter

Merge branch 'mg/doc-word-diff-example' into maintJeff King Tue, 1 Dec 2015 22:21:11 +0000 (17:21 -0500)

Merge branch 'mg/doc-word-diff-example' into maint

* mg/doc-word-diff-example:
Documentation/diff: give --word-diff-regex=. example

Merge branch 'cb/ssl-config-pathnames' into maintJeff King Tue, 1 Dec 2015 22:21:01 +0000 (17:21 -0500)

Merge branch 'cb/ssl-config-pathnames' into maint

Allow tilde-expansion in some http config variables.

* cb/ssl-config-pathnames:
http: treat config options sslCAPath and sslCAInfo as paths

Merge branch 'dk/t5813-unc-paths' into maintJeff King Tue, 1 Dec 2015 22:20:52 +0000 (17:20 -0500)

Merge branch 'dk/t5813-unc-paths' into maint

Test portability fix for a topic in v2.6.1.

* dk/t5813-unc-paths:
t5813: avoid creating urls that break on cygwin

Merge branch 'dk/rerere-train-quoting' into maintJeff King Tue, 1 Dec 2015 22:20:46 +0000 (17:20 -0500)

Merge branch 'dk/rerere-train-quoting' into maint

Fix shell quoting in contrib script.

* dk/rerere-train-quoting:
Escape Git's exec path in contrib/rerere-train.sh script

Merge branch 'cb/hook-sigpipe' into maintJeff King Tue, 1 Dec 2015 22:19:52 +0000 (17:19 -0500)

Merge branch 'cb/hook-sigpipe' into maint

We now consistently allow all hooks to ignore their standard input,
rather than having git complain of SIGPIPE.

* cb/hook-sigpipe:
allow hooks to ignore their standard input stream

Merge branch 'fm/shell-path-whitespace' into maintJeff King Tue, 1 Dec 2015 22:19:37 +0000 (17:19 -0500)

Merge branch 'fm/shell-path-whitespace' into maint

Portability fix for Windows, which may rewrite $SHELL variable using
non-POSIX paths.

* fm/shell-path-whitespace:
rebase-i-exec: Allow space in SHELL_PATH

Merge branch 'ar/doc-env-variable-format' into maintJeff King Tue, 1 Dec 2015 22:19:33 +0000 (17:19 -0500)

Merge branch 'ar/doc-env-variable-format' into maint

Minor documentation fixup.

* ar/doc-env-variable-format:
Documentation: make environment variable formatting more consistent

Merge branch 'pt/http-socks-proxy' into maintJeff King Tue, 1 Dec 2015 22:19:12 +0000 (17:19 -0500)

Merge branch 'pt/http-socks-proxy' into maint

Add support for talking http/https over socks proxy.

* pt/http-socks-proxy:
remote-http(s): support SOCKS proxies

Merge branch 'rc/configure-use-libs-when-checking-a... Jeff King Tue, 1 Dec 2015 22:19:06 +0000 (17:19 -0500)

Merge branch 'rc/configure-use-libs-when-checking-a-lib' into maint

The "configure" script did not test for -lpthread correctly, which
upset some linkers.

* rc/configure-use-libs-when-checking-a-lib:
configure.ac: use $LIBS not $CFLAGS when testing -lpthread

wt-status: correct and simplify check for detached... René Scharfe Wed, 25 Nov 2015 14:10:18 +0000 (15:10 +0100)

wt-status: correct and simplify check for detached HEAD

If a branch name is longer than four characters then memcmp() reads over
the end of the static string "HEAD". This causes the following test
failures with AddressSanitizer:

t3203-branch-output.sh (Wstat: 256 Tests: 18 Failed: 4)
Failed tests: 12, 15-17
Non-zero exit status: 1
t3412-rebase-root.sh (Wstat: 256 Tests: 31 Failed: 3)
Failed tests: 28-29, 31
Non-zero exit status: 1
t3507-cherry-pick-conflict.sh (Wstat: 256 Tests: 31 Failed: 4)
Failed tests: 14, 29-31
Non-zero exit status: 1
t3510-cherry-pick-sequence.sh (Wstat: 256 Tests: 39 Failed: 14)
Failed tests: 17, 22-26, 28-30, 34-35, 37-39
Non-zero exit status: 1
t3420-rebase-autostash.sh (Wstat: 256 Tests: 28 Failed: 4)
Failed tests: 24-27
Non-zero exit status: 1
t3404-rebase-interactive.sh (Wstat: 256 Tests: 91 Failed: 57)
Failed tests: 17, 19, 21-42, 44, 46-74, 77, 81-82
Non-zero exit status: 1
t3900-i18n-commit.sh (Wstat: 256 Tests: 34 Failed: 1)
Failed test: 34
Non-zero exit status: 1
t5407-post-rewrite-hook.sh (Wstat: 256 Tests: 14 Failed: 6)
Failed tests: 9-14
Non-zero exit status: 1
t7001-mv.sh (Wstat: 256 Tests: 46 Failed: 5)
Failed tests: 39-43
Non-zero exit status: 1
t7509-commit.sh (Wstat: 256 Tests: 12 Failed: 2)
Failed tests: 11-12
Non-zero exit status: 1
t7512-status-help.sh (Wstat: 256 Tests: 39 Failed: 35)
Failed tests: 5-39
Non-zero exit status: 1
t6030-bisect-porcelain.sh (Wstat: 256 Tests: 70 Failed: 1)
Failed test: 13
Non-zero exit status: 1

And if a branch is named "H", "HE", or "HEA" then the current if clause
erroneously considers it as matching "HEAD" because it only compares
up to the end of the branch name.

Fix that by doing the comparison using strcmp() and only after the
branch name is extracted. This way neither too less nor too many
characters are checked. While at it call strchrnul() to find the end
of the branch name instead of open-coding it.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Jeff King <peff@peff.net>

ident.c: add support for IPv6Elia Pinto Fri, 27 Nov 2015 14:08:27 +0000 (14:08 +0000)

ident.c: add support for IPv6

Add IPv6 support by implementing name resolution with the
protocol agnostic getaddrinfo(3) API. The old gethostbyname(3)
code is still available when git is compiled with NO_IPV6.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
Helped-by: Jeff King <peff@peff.net>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Jeff King <peff@peff.net>

Add Travis CI supportLars Schneider Fri, 27 Nov 2015 09:23:27 +0000 (10:23 +0100)

Add Travis CI support

The tests are currently executed on "Ubuntu 12.04 LTS Server Edition
64 bit" and on "OS X Mavericks" using gcc and clang.

Perforce and Git-LFS are installed and therefore available for the
respective tests.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>

add "ok=sigpipe" to test_must_fail and use it to fix... Lars Schneider Fri, 27 Nov 2015 09:15:14 +0000 (10:15 +0100)

add "ok=sigpipe" to test_must_fail and use it to fix flaky tests

t5516 "75 - deny fetch unreachable SHA1, allowtipsha1inwant=true" is
flaky in the following case:
1. remote upload-pack finds out "not our ref"
2. remote sends a response and closes the pipe
3. fetch-pack still tries to write commands to the remote upload-pack
4. write call in wrapper.c dies with SIGPIPE

The test is flaky because the sending fetch-pack may or may
not have finished writing its output by step (3). If it did,
then we see a closed pipe on the next read() call. If it
didn't, then we get the SIGPIPE from step (4) above. Both
are fine, but the latter fools test_must_fail.

t5504 "9 - push with transfer.fsckobjects" is flaky, too, and returns
SIGPIPE once in a while. I had to remove the final "To dst..." output
check because there is no output if the process dies with SIGPIPE.

Accept such a death-with-sigpipe also as OK when we are expecting a
failure.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>

implement test_might_fail using a refactored test_must_failLars Schneider Fri, 27 Nov 2015 09:15:13 +0000 (10:15 +0100)

implement test_might_fail using a refactored test_must_fail

Add an (optional) first parameter "ok=<special case>" to test_must_fail
and return success for "<special case>". Add "success" as
"<special case>" and use it to implement "test_might_fail". This removes
redundancies in test-lib-function.sh.

You can pass multiple <special case> arguments divided by comma (e.g.
"test_must_fail ok=success,something")

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Jeff King <peff@peff.net>

Merge branch 'fp/subtree-todo-update'Jeff King Wed, 25 Nov 2015 00:06:54 +0000 (19:06 -0500)

Merge branch 'fp/subtree-todo-update'

Cross completed task off of subtree project's todo list.

* fp/subtree-todo-update:
contrib/subtree: remove "push" command from the "todo" file

Merge branch 'rc/configure-use-libs-when-checking-a... Jeff King Wed, 25 Nov 2015 00:06:33 +0000 (19:06 -0500)

Merge branch 'rc/configure-use-libs-when-checking-a-lib'

The "configure" script did not test for -lpthread correctly, which
upset some linkers.

* rc/configure-use-libs-when-checking-a-lib:
configure.ac: use $LIBS not $CFLAGS when testing -lpthread

Merge branch 'maint'Jeff King Wed, 25 Nov 2015 00:04:41 +0000 (19:04 -0500)

Merge branch 'maint'

* maint:
Documentation/git-update-index: add missing opts to synopsys

http: treat config options sslCAPath and sslCAInfo... Charles Bailey Mon, 23 Nov 2015 12:02:40 +0000 (12:02 +0000)

http: treat config options sslCAPath and sslCAInfo as paths

This enables ~ and ~user expansion for these config options.

Signed-off-by: Charles Bailey <cbailey32@bloomberg.net>
Signed-off-by: Jeff King <peff@peff.net>

Documentation/diff: give --word-diff-regex=. exampleMichael J Gruber Fri, 20 Nov 2015 13:36:14 +0000 (14:36 +0100)

Documentation/diff: give --word-diff-regex=. example

It's just so useful.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Jeff King <peff@peff.net>

filter-branch: deal with object name vs. pathname ambig... SZEDER Gábor Mon, 23 Nov 2015 12:23:16 +0000 (13:23 +0100)

filter-branch: deal with object name vs. pathname ambiguity in tree-filter

'git filter-branch' fails complaining about an ambiguous argument, if
a tree-filter renames a path and the new pathname happens to match an
existing object name.

After the tree-filter has been applied, 'git filter-branch' looks for
changed paths by running:

git diff-index -r --name-only --ignore-submodules $commit

which then, because of the lack of disambiguating double-dash, can't
decide whether to treat '$commit' as revision or path and errors out.

Add that disambiguating double-dash after 'git diff-index's revision
argument to make sure that '$commit' is interpreted as a revision.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Jeff King <peff@peff.net>

send-email: die if CA path doesn't existJohn Keeping Tue, 24 Nov 2015 23:31:40 +0000 (23:31 +0000)

send-email: die if CA path doesn't exist

If the CA path isn't found it's most likely to indicate a
misconfiguration, in which case accepting any certificate is unlikely to
be the correct thing to do.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Jeff King <peff@peff.net>

check-ignore: correct documentation about outputDennis Kaarsemaker Fri, 20 Nov 2015 20:30:48 +0000 (21:30 +0100)

check-ignore: correct documentation about output

By default git check-ignore shows only the filenames that will be
ignored, not the pattern that causes their exclusion. Instead of moving
the partial exclude pattern precendence information to the -v option
where it belongs, link to gitignore(5) which describes this more
thoroughly.

Signed-off-by: Dennis Kaarsemaker <dennis@kaarsemaker.net>
Signed-off-by: Jeff King <peff@peff.net>

blame: fix object casting regressionJeff King Tue, 17 Nov 2015 23:22:37 +0000 (18:22 -0500)

blame: fix object casting regression

Commit 1b0d400 refactored the prepare_final() function so
that it could be reused in multiple places. Originally, the
loop had two outputs: a commit to stuff into sb->final, and
the name of the commit from the rev->pending array.

After the refactor, that loop is put in its own function
with a single return value: the object_array_entry from the
rev->pending array. This contains both the name and the object,
but with one important difference: the object is the
_original_ object found by the revision parser, not the
dereferenced commit. If one feeds a tag to "git blame", we
end up casting the tag object to a "struct commit", which
causes a segfault.

Instead, let's return the commit (properly casted) directly
from the function, and take the "name" as an optional
out-parameter. This does the right thing, and actually
simplifies the callers, who no longer need to cast or
dereference the object_array_entry themselves.

[test case by Max Kirillov <max@max630.net>]

Signed-off-by: Jeff King <peff@peff.net>

Documentation/git-update-index: add missing opts to... Christian Couder Tue, 24 Nov 2015 11:55:07 +0000 (12:55 +0100)

Documentation/git-update-index: add missing opts to synopsys

Untracked cache related options should appear in the synopsis.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Jeff King <peff@peff.net>

git-p4: clean up after p4 submit failureGIRARD Etienne Tue, 24 Nov 2015 07:43:59 +0000 (07:43 +0000)

git-p4: clean up after p4 submit failure

When "p4 submit" command fails in P4Submit.applyCommit, the
workspace is left with the changes. We already have code to revert
the changes to the workspace when the user decides to cancel
submission by aborting the editor that edits the change description,
and we should treat the "p4 submit" failure the same way.

Clean the workspace if p4_write_pipe raised SystemExit, so that the
user don't have to do it themselves.

Signed-off-by: GIRARD Etienne <egirard@murex.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Jeff King <peff@peff.net>

bash prompt: indicate dirty index even on orphan branchesSZEDER Gábor Sat, 21 Nov 2015 11:30:09 +0000 (12:30 +0100)

bash prompt: indicate dirty index even on orphan branches

__git_ps1() doesn't indicate dirty index while on an orphan branch.

To check the dirtiness of the index, __git_ps1() runs 'git diff-index
--cached ... HEAD', which doesn't work on an orphan branch,
because HEAD doesn't point to a valid commit.

Run 'git diff ... --cached' instead, as it does the right thing both
on valid and invalid HEAD, i.e. compares the index to the existing
HEAD in the former case and to the empty tree in the latter. This
fixes the two failing tests added in the first commit of this series.

The dirtiness of the worktree is already checked with 'git diff' and
is displayed correctly even on an orphan branch.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Jeff King <peff@peff.net>

bash prompt: remove a redundant 'git diff' optionSZEDER Gábor Sat, 21 Nov 2015 14:46:40 +0000 (15:46 +0100)

bash prompt: remove a redundant 'git diff' option

To get the dirty state indicator __git_ps1() runs 'git diff' with
'--quiet --exit-code' options. '--quiet' already implies
'--exit-code', so the latter is unnecessary and can be removed.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Jeff King <peff@peff.net>

bash prompt: test dirty index and worktree while on... SZEDER Gábor Sat, 21 Nov 2015 11:30:07 +0000 (12:30 +0100)

bash prompt: test dirty index and worktree while on an orphan branch

There is only a single test exercising the dirty state indicator on an
orphan branch, and in that test neither the index nor the worktree are
dirty.

Add two failing tests to check the dirty state indicator while either
the index is dirty or while both the index and the worktree are dirty
on an orphan branch, and to show that the dirtiness of the index is
not displayed in these cases (the fourth combination, i.e. clean index
and dirty worktree are impossible on an orphan branch). Update the
existing dirty state indicator on clean orphan branch test to match
the style of the two new tests, most importantly to use 'git checkout
--orphan' instead of cd-ing into a repository that just happens to be
empty and clean.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Jeff King <peff@peff.net>

git-p4: work with a detached headLuke Diamand Sat, 21 Nov 2015 09:54:41 +0000 (09:54 +0000)

git-p4: work with a detached head

When submitting, git-p4 finds the current branch in
order to know if it is allowed to submit (configuration
"git-p4.allowSubmit").

On a detached head, detecting the branch would fail, and
git-p4 would report a cryptic error.

This change teaches git-p4 to recognise a detached head and
submit successfully.

Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Jeff King <peff@peff.net>

git-p4: add option to system() to return subshell statusLuke Diamand Sat, 21 Nov 2015 09:54:40 +0000 (09:54 +0000)

git-p4: add option to system() to return subshell status

Add an optional parameter ignore_error to the git-p4 system()
function. If used, it will return the subshell exit status
rather than throwing an exception.

Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Jeff King <peff@peff.net>

git-p4: add failing test for submit from detached headLuke Diamand Sat, 21 Nov 2015 09:54:39 +0000 (09:54 +0000)

git-p4: add failing test for submit from detached head

git-p4 can't submit from a detached head. This test case
demonstrates the problem.

Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Jeff King <peff@peff.net>

push: add recurseSubmodules config optionMike Crowe Tue, 17 Nov 2015 11:05:56 +0000 (11:05 +0000)

push: add recurseSubmodules config option

The --recurse-submodules command line parameter has existed for some
time but it has no config file equivalent.

Following the style of the corresponding parameter for git fetch, let's
invent push.recurseSubmodules to provide a default for this
parameter. This also requires the addition of --recurse-submodules=no to
allow the configuration to be overridden on the command line when
required.

The most straightforward way to implement this appears to be to make
push use code in submodule-config in a similar way to fetch.

Signed-off-by: Mike Crowe <mac@mcrowe.com>
Signed-off-by: Jeff King <peff@peff.net>

credential-cache: new option to ignore sighupNoam Postavsky Tue, 10 Nov 2015 00:26:29 +0000 (19:26 -0500)

credential-cache: new option to ignore sighup

Introduce new option "credentialCache.ignoreSIGHUP" which stops
git-credential-cache--daemon from quitting on SIGHUP. This is useful
when "git push" is started from Emacs, because all child
processes (including the daemon) will receive a SIGHUP when "git push"
exits.

Signed-off-by: Noam Postavsky <npostavs@users.sourceforge.net>
Signed-off-by: Jeff King <peff@peff.net>

show-ref: stop using PARSE_OPT_NO_INTERNAL_HELPRené Scharfe Tue, 17 Nov 2015 10:26:05 +0000 (11:26 +0100)

show-ref: stop using PARSE_OPT_NO_INTERNAL_HELP

The flag PARSE_OPT_NO_INTERNAL_HELP is set to allow overriding the
option -h, except when it's the only one given. This is the default
behavior now, so remove the flag and the hand-rolled --help-all
handling. The internal --help-all handler now actually shows hidden
options, i.e. -h in this case.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Jeff King <peff@peff.net>

fsck: treat a NUL in a tag header as an errorRené Scharfe Thu, 19 Nov 2015 16:25:31 +0000 (17:25 +0100)

fsck: treat a NUL in a tag header as an error

We check the return value of verify_header() for commits already, so do
the same for tags as well.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Jeff King <peff@peff.net>

grep: stop using PARSE_OPT_NO_INTERNAL_HELPRené Scharfe Tue, 17 Nov 2015 10:25:53 +0000 (11:25 +0100)

grep: stop using PARSE_OPT_NO_INTERNAL_HELP

The flag PARSE_OPT_NO_INTERNAL_HELP is set to allow overriding the
option -h, except when it's the only one given. This is the default
behavior now, so remove the flag and the hand-rolled --help-all
handling. The internal --help-all handler now actually shows hidden
options, i.e. --debug in this case.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Jeff King <peff@peff.net>

t1450: add tests for NUL in headers of commits and... René Scharfe Thu, 19 Nov 2015 16:20:14 +0000 (17:20 +0100)

t1450: add tests for NUL in headers of commits and tags

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Jeff King <peff@peff.net>

parse-options: allow -h as a short optionRené Scharfe Tue, 17 Nov 2015 10:25:38 +0000 (11:25 +0100)

parse-options: allow -h as a short option

Let callers provide their own handler for the short option -h even
without the flag PARSE_OPT_NO_INTERNAL_HELP, but call the internal
handler (showing usage information) if that is the only parameter.
Implement the first part by checking for -h only if parse_short_opt()
can't find it and returns -2.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Jeff King <peff@peff.net>

parse-options: inline parse_options_usage() at its... René Scharfe Tue, 17 Nov 2015 10:25:27 +0000 (11:25 +0100)

parse-options: inline parse_options_usage() at its only remaining caller

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Jeff King <peff@peff.net>

parse-options: deduplicate parse_options_usage() callsRené Scharfe Tue, 17 Nov 2015 10:25:14 +0000 (11:25 +0100)

parse-options: deduplicate parse_options_usage() calls

Avoid long lines and repeating parse_options_usage() calls with their
duplicate parameters by providing labels with speaking names to jump to.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Jeff King <peff@peff.net>

completion: add support for completing email aliasesJacob Keller Thu, 19 Nov 2015 22:52:12 +0000 (14:52 -0800)

completion: add support for completing email aliases

Using the new --dump-aliases option from git-send-email, add completion
for --to, --cc, --bcc, and --from with the available configured aliases.

Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>

git-p4: add trap to kill p4d on test exitLars Schneider Thu, 19 Nov 2015 08:58:10 +0000 (09:58 +0100)

git-p4: add trap to kill p4d on test exit

Sometimes the "prove" test runner hangs on test exit because p4d is
still running. Add a trap to always kill "p4d" on test exit.

You can reproduce the problem by commenting "P4D_TIMEOUT" in
"lib-git-p4.sh" and running "prove ./t9800-git-p4-basic.sh".

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>

modernize t9300: move test preparations into test_expec... Johannes Sixt Thu, 19 Nov 2015 19:09:49 +0000 (20:09 +0100)

modernize t9300: move test preparations into test_expect_success

Our usual style these days is to execute everything inside
test_expect_success. Make it so.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Jeff King <peff@peff.net>

send-email: expand path in sendemail.smtpsslcertpath... John Keeping Tue, 17 Nov 2015 22:01:05 +0000 (22:01 +0000)

send-email: expand path in sendemail.smtpsslcertpath config

As it says in the name, the SSL certificate path is a path so treat it
as one and support tilde-expansion.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Jeff King <peff@peff.net>

sendemail: teach git-send-email to dump alias namesJacob Keller Thu, 19 Nov 2015 22:52:11 +0000 (14:52 -0800)

sendemail: teach git-send-email to dump alias names

Add an option "--dump-aliases" which changes the default behavior of
git-send-email. This mode will simply read the alias files configured by
sendemail.aliasesfile and sendemail.aliasfiletype and dump a list of all
configured aliases, one per line. The intended use case for this option
is the bash-completion script which will use it to autocomplete aliases
on the options which take addresses.

Add some tests for the new option using various alias file formats.

A possible future extension to the alias dump format could be done by
extending the --dump-aliases to take an optional argument defining the
format to display. This has not been done in this patch as no user of
this information has been identified.

Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>

git-p4: add p4d timeout in testsLars Schneider Thu, 19 Nov 2015 08:58:09 +0000 (09:58 +0100)

git-p4: add p4d timeout in tests

In rare cases p4d seems to hang. This watchdog will kill the p4d
process after 300s in any case. That means each individual git p4 test
needs to finish before 300s or it will fail.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Acked-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Jeff King <peff@peff.net>

modernize t9300: mark here-doc words to ignore tab... Johannes Sixt Thu, 19 Nov 2015 19:09:48 +0000 (20:09 +0100)

modernize t9300: mark here-doc words to ignore tab indentation

In the next commit, we will indent test case preparations. This will
require that here-documents ignore the tab indentation. Prepare for
this change by marking the here-doc words accordingly. This does not
have an effect now, but will remove some noise from the git diff -b
output of the next commit.

The change here is entirely automated with this perl command:

perl -i -lpe 's/(cat.*<<) *((EOF|(EXPECT|INPUT)_END).*$)/$1-$2 &&/' t/t9300-fast-import.sh

i.e., inserts a dash between << and the EOF word (and removes blanks
that our style guide abhors) and appends the && that will become
necessary.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Jeff King <peff@peff.net>

git-p4: retry kill/cleanup operations in tests with... Lars Schneider Thu, 19 Nov 2015 08:58:08 +0000 (09:58 +0100)

git-p4: retry kill/cleanup operations in tests with timeout

In rare cases kill/cleanup operations in tests fail. Retry these
operations with a timeout to make the test less flaky.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>

modernize t9300: use test_when_finished for clean-upJohannes Sixt Thu, 19 Nov 2015 19:09:47 +0000 (20:09 +0100)

modernize t9300: use test_when_finished for clean-up

A number of clean-ups of test cases are performed outside of
test_expect_success. Replace these cases by using test_when_finished.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Jeff King <peff@peff.net>

modernize t9300: wrap lines after &&Johannes Sixt Thu, 19 Nov 2015 19:09:46 +0000 (20:09 +0100)

modernize t9300: wrap lines after &&

It is customary to have each command in test snippets on its own line.
Fix those instances that do not follow this guideline.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Jeff King <peff@peff.net>

modernize t9300: use test_must_be_emptyJohannes Sixt Thu, 19 Nov 2015 19:09:45 +0000 (20:09 +0100)

modernize t9300: use test_must_be_empty

Instead of comparing actual output to an empty file, use
test_must_be_empty. In addition to the better error message provided by
the helper, allocation of an empty file during the setup sequence can be
avoided.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Jeff King <peff@peff.net>

modernize t9300: use test_must_failJohannes Sixt Thu, 19 Nov 2015 19:09:44 +0000 (20:09 +0100)

modernize t9300: use test_must_fail

One test case open-codes a test for an expected failure. Replace it by
test_must_fail.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Jeff King <peff@peff.net>

modernize t9300: single-quote placement and indentationJohannes Sixt Thu, 19 Nov 2015 19:09:43 +0000 (20:09 +0100)

modernize t9300: single-quote placement and indentation

Many test cases do not follow our modern style that places the
single-quotes that surround the shell code snippets before and after
the shell code. Make it so.

Many of the lines changed in this way are indented other than by a
single tab. Change them (and some additional lines) to be indented
with a tab.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Jeff King <peff@peff.net>

remote: convert functions to struct object_idbrian m. carlson Tue, 10 Nov 2015 02:22:30 +0000 (02:22 +0000)

remote: convert functions to struct object_id

Convert several unsigned char arrays to use struct object_id instead,
and change hard-coded 40-based constants to use GIT_SHA1_HEXSZ as well.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Jeff King <peff@peff.net>

Remove get_object_hash.brian m. carlson Tue, 10 Nov 2015 02:22:29 +0000 (02:22 +0000)

Remove get_object_hash.

Convert all instances of get_object_hash to use an appropriate reference
to the hash member of the oid member of struct object. This provides no
functional change, as it is essentially a macro substitution.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Jeff King <peff@peff.net>

Convert struct object to object_idbrian m. carlson Tue, 10 Nov 2015 02:22:28 +0000 (02:22 +0000)

Convert struct object to object_id

struct object is one of the major data structures dealing with object
IDs. Convert it to use struct object_id instead of an unsigned char
array. Convert get_object_hash to refer to the new member as well.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Jeff King <peff@peff.net>

Add several uses of get_object_hash.brian m. carlson Tue, 10 Nov 2015 02:22:27 +0000 (02:22 +0000)

Add several uses of get_object_hash.

Convert most instances where the sha1 member of struct object is
dereferenced to use get_object_hash. Most instances that are passed to
functions that have versions taking struct object_id, such as
get_sha1_hex/get_oid_hex, or instances that can be trivially converted
to use struct object_id instead, are not converted.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Jeff King <peff@peff.net>

object: introduce get_object_hash macro.brian m. carlson Tue, 10 Nov 2015 02:22:26 +0000 (02:22 +0000)

object: introduce get_object_hash macro.

This macro is a temporary change to ease the transition of struct object
to use struct object_id. It takes an argument of struct object and
returns the object's hash. Provide this hash next to struct object for
easier conversion.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Jeff King <peff@peff.net>

ref_newer: convert to use struct object_idbrian m. carlson Tue, 10 Nov 2015 02:22:25 +0000 (02:22 +0000)

ref_newer: convert to use struct object_id

Convert ref_newer and its caller to use struct object_id instead of
unsigned char *.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Jeff King <peff@peff.net>

push_refs_with_export: convert to struct object_idbrian m. carlson Tue, 10 Nov 2015 02:22:24 +0000 (02:22 +0000)

push_refs_with_export: convert to struct object_id

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Jeff King <peff@peff.net>

get_remote_heads: convert to struct object_idbrian m. carlson Tue, 10 Nov 2015 02:22:23 +0000 (02:22 +0000)

get_remote_heads: convert to struct object_id

Replace an unsigned char array with struct object_id and express several
hard-coded constants in terms of GIT_SHA1_HEXSZ.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Jeff King <peff@peff.net>

parse_fetch: convert to use struct object_idbrian m. carlson Tue, 10 Nov 2015 02:22:22 +0000 (02:22 +0000)

parse_fetch: convert to use struct object_id

Convert the parse_fetch function to use struct object_id. Remove the
strlen check as get_oid_hex will fail safely on receiving a too-short
NUL-terminated string.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Jeff King <peff@peff.net>

add_sought_entry_mem: convert to struct object_idbrian m. carlson Tue, 10 Nov 2015 02:22:21 +0000 (02:22 +0000)

add_sought_entry_mem: convert to struct object_id

Convert this function to use struct object_id. Express several
hardcoded constants in terms of GIT_SHA1_HEXSZ.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Jeff King <peff@peff.net>

Convert struct ref to use object_id.brian m. carlson Tue, 10 Nov 2015 02:22:20 +0000 (02:22 +0000)

Convert struct ref to use object_id.

Use struct object_id in three fields in struct ref and convert all the
necessary places that use it.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Jeff King <peff@peff.net>

sha1_file: introduce has_object_file helper.brian m. carlson Tue, 10 Nov 2015 02:22:19 +0000 (02:22 +0000)

sha1_file: introduce has_object_file helper.

Add has_object_file, which is a wrapper around has_sha1_file, but for
struct object_id.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Jeff King <peff@peff.net>

remote-http(s): support SOCKS proxiesPat Thoyts Mon, 26 Oct 2015 13:15:07 +0000 (14:15 +0100)

remote-http(s): support SOCKS proxies

With this patch we properly support SOCKS proxies, configured e.g. like
this:

git config http.proxy socks5://192.168.67.1:32767

Without this patch, Git mistakenly tries to use SOCKS proxies as if they
were HTTP proxies, resulting in a error message like:

fatal: unable to access 'http://.../': Proxy CONNECT aborted

This patch was required to work behind a faulty AP and scraped from
http://stackoverflow.com/questions/15227130/#15228479 and guarded with
an appropriate cURL version check by Johannes Schindelin.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'master' of git://git.bogomips.org/git-svnJeff King Fri, 20 Nov 2015 11:56:58 +0000 (06:56 -0500)

Merge branch 'master' of git://git.bogomips.org/git-svn

* 'master' of git://git.bogomips.org/git-svn:
git-svn: improve rebase/mkdirs performance

Merge branch 'lf/ref-is-hidden-namespace'Jeff King Fri, 20 Nov 2015 11:56:11 +0000 (06:56 -0500)

Merge branch 'lf/ref-is-hidden-namespace'

Extend transfer.hideRefs to work better with use of namespaces.

* lf/ref-is-hidden-namespace:
t5509: add basic tests for hideRefs
hideRefs: add support for matching full refs
upload-pack: strip refs before calling ref_is_hidden()
config.txt: document the semantics of hideRefs with namespaces

Merge branch 'dk/gc-idx-wo-pack'Jeff King Fri, 20 Nov 2015 11:55:34 +0000 (06:55 -0500)

Merge branch 'dk/gc-idx-wo-pack'

Having a leftover .idx file without corresponding .pack file in
the repository hurts performance; "git gc" learned to prune them.

* dk/gc-idx-wo-pack:
gc: remove garbage .idx files from pack dir
t5304: test cleaning pack garbage
prepare_packed_git(): refactor garbage reporting in pack directory

t5813: avoid creating urls that break on cygwinDennis Kaarsemaker Mon, 9 Nov 2015 17:49:35 +0000 (18:49 +0100)

t5813: avoid creating urls that break on cygwin

When passed an ssh:// url, git strips ssh://host from the url but does
not remove leading slashes from the path. So when this test used
ssh://remote//path/to/pwd, the path accessed by our fake SSH is
//path/to/pwd, which cygwin interprets as a UNC path, causing the test
to fail.

We may want to actually fix this in git itself, making it remove extra
slashes from urls before feeding them to transports or helpers, but
that's for another topic as it could cause regressions.

Signed-off-by: Dennis Kaarsemaker <dennis@kaarsemaker.net>
Signed-off-by: Jeff King <peff@peff.net>

Escape Git's exec path in contrib/rerere-train.sh scriptDaniel Knittl-Frank Sun, 8 Nov 2015 11:27:55 +0000 (12:27 +0100)

Escape Git's exec path in contrib/rerere-train.sh script

Whitespace can cause the source command to fail. This is usually not a
problem on Unix systems, but on Windows Git is likely to be installed
under "C:/Program Files/", thus rendering the script broken.

Signed-off-by: Daniel Knittl-Frank <knittl89+git@googlemail.com>
Signed-off-by: Jeff King <peff@peff.net>

refs: break out ref conflict checksDavid Turner Tue, 10 Nov 2015 11:42:40 +0000 (12:42 +0100)

refs: break out ref conflict checks

Create new function find_descendant_ref, to hold one of the ref
conflict checks used in verify_refname_available. Multiple backends
will need this function, so move it to the common code.

Also move rename_ref_available to the common code, because alternate
backends might need it and it has no files-backend-specific code.

Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jeff King <peff@peff.net>

files_log_ref_write: new functionDavid Turner Tue, 10 Nov 2015 11:42:39 +0000 (12:42 +0100)

files_log_ref_write: new function

Because HEAD and stash are per-worktree, every refs backend needs to
go through the files backend to write these refs.

So create a new function, files_log_ref_write, and add it to
refs/refs-internal.h. Later, we will use this to handle reflog updates
for per-worktree symbolic refs (HEAD).

Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jeff King <peff@peff.net>

initdb: make safe_create_dir publicDavid Turner Tue, 10 Nov 2015 11:42:38 +0000 (12:42 +0100)

initdb: make safe_create_dir public

Soon we will want to create initdb functions for ref backends, and
code from initdb that calls this function needs to move into the files
backend. So this function needs to be public.

Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jeff King <peff@peff.net>

refs: split filesystem-based refs code into a new fileMichael Haggerty Mon, 9 Nov 2015 13:34:01 +0000 (14:34 +0100)

refs: split filesystem-based refs code into a new file

As another step in the move to pluggable reference backends, move the
code that is specific to the filesystem-based reference backend (i.e.,
the current system of storing references as loose and packed files) into
a separate file, refs/files-backend.c.

Aside from a tiny bit of file header boilerplate, this commit only moves
a subset of the code verbatim from refs.c to the new file, as can easily
be verified using patience diff:

git diff --patience $commit^:refs.c $commit:refs.c
git diff --patience $commit^:refs.c $commit:refs/files-backend.c

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jeff King <peff@peff.net>

refs/refs-internal.h: new header fileMichael Haggerty Tue, 10 Nov 2015 11:42:36 +0000 (12:42 +0100)

refs/refs-internal.h: new header file

There are a number of constants, structs, and static functions defined
in refs.c and treated as private to the references module. But we want
to support multiple reference backends within the reference module,
and those backends will need access to some heretofore private
declarations.

We don't want those declarations to be visible to non-refs code, so we
don't want to move them to refs.h. Instead, add a new header file,
refs/refs-internal.h, that is intended to be included only from within
the refs module. Make some functions non-static and move some
declarations (and their corresponding docstrings) from refs.c to this
file.

In a moment we will add more content to the "refs" subdirectory.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jeff King <peff@peff.net>

refname_is_safe(): improve docstringMichael Haggerty Tue, 10 Nov 2015 11:42:35 +0000 (12:42 +0100)

refname_is_safe(): improve docstring

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jeff King <peff@peff.net>

pack_if_possible_fn(): use ref_type() instead of is_per... Michael Haggerty Tue, 10 Nov 2015 11:42:34 +0000 (12:42 +0100)

pack_if_possible_fn(): use ref_type() instead of is_per_worktree_ref()

is_per_worktree_ref() will soon be made private, so use the public
interface, ref_type(), in its place. And now that we're using
ref_type(), we can make it clear that we won't pack pseudorefs. This was
the case before, but due to the not-so-obvious reason that this function
is applied to references via the loose reference cache, which only
includes references that live inside "refs/".

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jeff King <peff@peff.net>

copy_msg(): rename to copy_reflog_msg()David Turner Tue, 10 Nov 2015 11:42:33 +0000 (12:42 +0100)

copy_msg(): rename to copy_reflog_msg()

We will soon increase the visibility of this function, so make its name
more distinctive.

Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jeff King <peff@peff.net>

verify_refname_available(): new functionRonnie Sahlberg Tue, 10 Nov 2015 11:42:32 +0000 (12:42 +0100)

verify_refname_available(): new function

Add a new verify_refname_available() function, which checks whether the
refname is available for use, taking all references (both packed and
loose) into account. This function, unlike the old
verify_refname_available(), has semantics independent of the choice of
reference storage, and can therefore be implemented by alternative
reference backends.

Use the new function in a couple of places.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jeff King <peff@peff.net>

verify_refname_available(): rename functionRonnie Sahlberg Tue, 10 Nov 2015 11:42:31 +0000 (12:42 +0100)

verify_refname_available(): rename function

Rename verify_refname_available() to verify_refname_available_dir() to
make the old name available for a more general purpose.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jeff King <peff@peff.net>

allow hooks to ignore their standard input streamClemens Buchacher Mon, 16 Nov 2015 08:05:58 +0000 (09:05 +0100)

allow hooks to ignore their standard input stream

Since ec7dbd145 (receive-pack: allow hooks to ignore its
standard input stream) the pre-receive and post-receive
hooks ignore SIGPIPE. Do the same for the remaining hooks
pre-push and post-rewrite, which read from standard input.
The same arguments for ignoring SIGPIPE apply.

Include test by Jeff King which checks that SIGPIPE does not
cause pre-push hook failure. With the use of git update-ref
--stdin it is fast enough to be enabled by default.

Signed-off-by: Clemens Buchacher <clemens.buchacher@intel.com>
Signed-off-by: Jeff King <peff@peff.net>

rebase-i-exec: Allow space in SHELL_PATHFredrik Medley Fri, 13 Nov 2015 06:03:19 +0000 (07:03 +0100)

rebase-i-exec: Allow space in SHELL_PATH

On Windows, when Git is installed under "C:\Program Files\Git",
SHELL_PATH will include a space. Fix "git rebase --interactive --exec"
so that it works with spaces in SHELL_PATH.

Signed-off-by: Fredrik Medley <fredrik.medley@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>