gitweb.git
dir.c: don't exclude whole dir prematurelyNguyễn Thái Ngọc Duy Mon, 15 Feb 2016 09:03:39 +0000 (16:03 +0700)

dir.c: don't exclude whole dir prematurely

If there is a pattern "!foo/bar", this patch makes it not exclude
"foo" right away. This gives us a chance to examine "foo" and
re-include "foo/bar".

Helped-by: brian m. carlson <sandals@crustytoothpaste.net>
Helped-by: Micha Wiedenmann <mw-u2@gmx.de>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir.c: support marking some patterns already matchedNguyễn Thái Ngọc Duy Mon, 15 Feb 2016 09:03:38 +0000 (16:03 +0700)

dir.c: support marking some patterns already matched

Given path "a" and the pattern "a", it's matched. But if we throw path
"a/b" to pattern "a", the code fails to realize that if "a" matches
"a" then "a/b" should also be matched.

When the pattern is matched the first time, we can mark it "sticky", so
that all files and dirs inside the matched path also matches. This is a
simpler solution than modify all match scenarios to fix that.

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

dir.c: support tracing excludeNguyễn Thái Ngọc Duy Mon, 15 Feb 2016 09:03:37 +0000 (16:03 +0700)

dir.c: support tracing exclude

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

dir.c: fix match_pathname()Nguyễn Thái Ngọc Duy Mon, 15 Feb 2016 09:03:36 +0000 (16:03 +0700)

dir.c: fix match_pathname()

Given the pattern "1/2/3/4" and the path "1/2/3/4/f", the pattern
prefix is "1/2/3/4". We will compare and remove the prefix from both
pattern and path and come to this code

/*
* If the whole pattern did not have a wildcard,
* then our prefix match is all we need; we
* do not need to call fnmatch at all.
*/
if (!patternlen && !namelen)
return 1;

where patternlen is zero (full pattern consumed) and the remaining
path in "name" is "/f". We fail to realize it's matched in this case
and fall back to fnmatch(), which also fails to catch it. Fix it.

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

Merge branch 'cc/untracked'Junio C Hamano Wed, 10 Feb 2016 22:20:06 +0000 (14:20 -0800)

Merge branch 'cc/untracked'

Update the untracked cache subsystem and change its primary UI from
"git update-index" to "git config".

* cc/untracked:
t7063: add tests for core.untrackedCache
test-dump-untracked-cache: don't modify the untracked cache
config: add core.untrackedCache
dir: simplify untracked cache "ident" field
dir: add remove_untracked_cache()
dir: add {new,add}_untracked_cache()
update-index: move 'uc' var declaration
update-index: add untracked cache notifications
update-index: add --test-untracked-cache
update-index: use enum for untracked cache options
dir: free untracked cache when removing it

Merge branch 'js/xmerge-marker-eol'Junio C Hamano Wed, 10 Feb 2016 22:20:06 +0000 (14:20 -0800)

Merge branch 'js/xmerge-marker-eol'

The low-level merge machinery has been taught to use CRLF line
termination when inserting conflict markers to merged contents that
are themselves CRLF line-terminated.

* js/xmerge-marker-eol:
merge-file: ensure that conflict sections match eol style
merge-file: let conflict markers match end-of-line style of the context

Merge branch 'nd/do-not-move-worktree-manually'Junio C Hamano Wed, 10 Feb 2016 22:20:05 +0000 (14:20 -0800)

Merge branch 'nd/do-not-move-worktree-manually'

"git worktree" had a broken code that attempted to auto-fix
possible inconsistency that results from end-users moving a
worktree to different places without telling Git (the original
repository needs to maintain backpointers to its worktrees, but
"mv" run by end-users who are not familiar with that fact will
obviously not adjust them), which actually made things worse
when triggered.

* nd/do-not-move-worktree-manually:
worktree: stop supporting moving worktrees manually
worktree.c: fix indentation

Sync with 2.7.1Junio C Hamano Fri, 5 Feb 2016 23:24:02 +0000 (15:24 -0800)

Sync with 2.7.1

Git 2.7.1 v2.7.1Junio C Hamano Fri, 5 Feb 2016 22:53:52 +0000 (14:53 -0800)

Git 2.7.1

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

Merge branch 'lv/add-doc-working-tree' into maintJunio C Hamano Fri, 5 Feb 2016 22:54:22 +0000 (14:54 -0800)

Merge branch 'lv/add-doc-working-tree' into maint

* lv/add-doc-working-tree:
git-add doc: do not say working directory when you mean working tree

Merge branch 'ss/clone-depth-single-doc' into maintJunio C Hamano Fri, 5 Feb 2016 22:54:21 +0000 (14:54 -0800)

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

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 'sg/t6050-failing-editor-test-fix' into... Junio C Hamano Fri, 5 Feb 2016 22:54:20 +0000 (14:54 -0800)

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

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

Merge branch 'ew/for-each-ref-doc' into maintJunio C Hamano Fri, 5 Feb 2016 22:54:19 +0000 (14:54 -0800)

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

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

Merge branch 'ss/user-manual' into maintJunio C Hamano Fri, 5 Feb 2016 22:54:18 +0000 (14:54 -0800)

Merge branch 'ss/user-manual' into maint

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 'jk/ref-cache-non-repository-optim' into... Junio C Hamano Fri, 5 Feb 2016 22:54:17 +0000 (14:54 -0800)

Merge branch 'jk/ref-cache-non-repository-optim' into maint

The underlying machinery used by "ls-files -o" and other commands
have been taught not to create empty submodule ref cache for a
directory that is not a submodule. This removes a ton of wasted
CPU cycles.

* jk/ref-cache-non-repository-optim:
resolve_gitlink_ref: ignore non-repository paths
clean: make is_git_repository a public function

Merge branch 'js/dirname-basename' into maintJunio C Hamano Fri, 5 Feb 2016 22:54:17 +0000 (14:54 -0800)

Merge branch 'js/dirname-basename' into maint

dirname() emulation has been added, as Msys2 lacks it.

* js/dirname-basename:
mingw: avoid linking to the C library's isalpha()
t0060: loosen overly strict expectations
t0060: verify that basename() and dirname() work as expected
compat/basename.c: provide a dirname() compatibility function
compat/basename: make basename() conform to POSIX
Refactor skipping DOS drive prefixes

Merge branch 'tb/complete-word-diff-regex' into maintJunio C Hamano Fri, 5 Feb 2016 22:54:17 +0000 (14:54 -0800)

Merge branch 'tb/complete-word-diff-regex' into maint

* tb/complete-word-diff-regex:
completion: complete "diff --word-diff-regex="

Merge branch 'pw/completion-stash' into maintJunio C Hamano Fri, 5 Feb 2016 22:54:16 +0000 (14:54 -0800)

Merge branch 'pw/completion-stash' into maint

* pw/completion-stash:
completion: update completion arguments for stash

Merge branch 'pw/completion-show-branch' into maintJunio C Hamano Fri, 5 Feb 2016 22:54:16 +0000 (14:54 -0800)

Merge branch 'pw/completion-show-branch' into maint

* pw/completion-show-branch:
completion: complete show-branch "--date-order"

Merge branch 'jk/completion-rebase' into maintJunio C Hamano Fri, 5 Feb 2016 22:54:16 +0000 (14:54 -0800)

Merge branch 'jk/completion-rebase' into maint

* jk/completion-rebase:
completion: add missing git-rebase options

Merge branch 'nd/diff-with-path-params' into maintJunio C Hamano Fri, 5 Feb 2016 22:54:15 +0000 (14:54 -0800)

Merge branch 'nd/diff-with-path-params' into maint

A few options of "git diff" did not work well when the command was
run from a subdirectory.

* nd/diff-with-path-params:
diff: make -O and --output work in subdirectory
diff-no-index: do not take a redundant prefix argument

Merge branch 'dw/subtree-split-do-not-drop-merge' into... Junio C Hamano Fri, 5 Feb 2016 22:54:15 +0000 (14:54 -0800)

Merge branch 'dw/subtree-split-do-not-drop-merge' into maint

The "split" subcommand of "git subtree" (in contrib/) incorrectly
skipped merges when it shouldn't, which was corrected.

* dw/subtree-split-do-not-drop-merge:
contrib/subtree: fix "subtree split" skipped-merge bug

Merge branch 'ew/svn-1.9.0-auth' into maintJunio C Hamano Fri, 5 Feb 2016 22:54:15 +0000 (14:54 -0800)

Merge branch 'ew/svn-1.9.0-auth' into maint

* ew/svn-1.9.0-auth:
git-svn: fix auth parameter handling on SVN 1.9.0+

Merge branch 'jk/list-tag-2.7-regression' into maintJunio C Hamano Fri, 5 Feb 2016 22:54:15 +0000 (14:54 -0800)

Merge branch 'jk/list-tag-2.7-regression' into maint

"git tag" started listing a tag "foo" as "tags/foo" when a branch
named "foo" exists in the same repository; remove this unnecessary
disambiguation, which is a regression introduced in v2.7.0.

* jk/list-tag-2.7-regression:
tag: do not show ambiguous tag names as "tags/foo"
t6300: use test_atom for some un-modern tests

Merge branch 'jk/sanity' into maintJunio C Hamano Fri, 5 Feb 2016 22:54:14 +0000 (14:54 -0800)

Merge branch 'jk/sanity' into maint

The description for SANITY prerequisite the test suite uses has
been clarified both in the comment and in the implementation.

* jk/sanity:
test-lib: clarify and tighten SANITY

Merge branch 'jk/filter-branch-no-index' into maintJunio C Hamano Fri, 5 Feb 2016 22:54:13 +0000 (14:54 -0800)

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

A recent optimization to filter-branch in v2.7.0 introduced a
regression when --prune-empty filter is used, which has been
corrected.

* jk/filter-branch-no-index:
filter-branch: resolve $commit^{tree} in no-index case

Merge branch 'js/close-packs-before-gc' into maintJunio C Hamano Fri, 5 Feb 2016 22:54:13 +0000 (14:54 -0800)

Merge branch 'js/close-packs-before-gc' into maint

Many codepaths that run "gc --auto" before exiting kept packfiles
mapped and left the file descriptors to them open, which was not
friendly to systems that cannot remove files that are open. They
now close the packs before doing so.

* js/close-packs-before-gc:
receive-pack: release pack files before garbage-collecting
merge: release pack files before garbage-collecting
am: release pack files before garbage-collecting
fetch: release pack files before garbage-collecting

Merge branch 'jk/ok-to-fail-gc-auto-in-rebase' into... Junio C Hamano Fri, 5 Feb 2016 22:54:13 +0000 (14:54 -0800)

Merge branch 'jk/ok-to-fail-gc-auto-in-rebase' into maint

"git rebase", unlike all other callers of "gc --auto", did not
ignore the exit code from "gc --auto".

* jk/ok-to-fail-gc-auto-in-rebase:
rebase: ignore failures from "gc --auto"

Merge branch 'ho/gitweb-squelch-undef-warning' into... Junio C Hamano Fri, 5 Feb 2016 22:54:12 +0000 (14:54 -0800)

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

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' into maintJunio C Hamano Fri, 5 Feb 2016 22:54:11 +0000 (14:54 -0800)

Merge branch 'js/fopen-harder' into maint

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 'nd/exclusion-regression-fix' into maintJunio C Hamano Fri, 5 Feb 2016 22:54:11 +0000 (14:54 -0800)

Merge branch 'nd/exclusion-regression-fix' into maint

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' into... Junio C Hamano Fri, 5 Feb 2016 22:54:10 +0000 (14:54 -0800)

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

"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 'dw/signoff-doc' into maintJunio C Hamano Fri, 5 Feb 2016 22:54:09 +0000 (14:54 -0800)

Merge branch 'dw/signoff-doc' into maint

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' into maintJunio C Hamano Fri, 5 Feb 2016 22:54:09 +0000 (14:54 -0800)

Merge branch 'jk/clang-pedantic' into maint

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' into maintJunio C Hamano Fri, 5 Feb 2016 22:54:09 +0000 (14:54 -0800)

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

"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 'nd/dir-exclude-cleanup' into maintJunio C Hamano Fri, 5 Feb 2016 22:54:08 +0000 (14:54 -0800)

Merge branch 'nd/dir-exclude-cleanup' into maint

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 'nd/stop-setenv-work-tree' into maintJunio C Hamano Fri, 5 Feb 2016 22:54:07 +0000 (14:54 -0800)

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

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"

Fifth batch for 2.8 cycleJunio C Hamano Wed, 3 Feb 2016 22:31:13 +0000 (14:31 -0800)

Fifth batch for 2.8 cycle

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

Merge branch 'kf/http-proxy-auth-methods'Junio C Hamano Wed, 3 Feb 2016 22:16:08 +0000 (14:16 -0800)

Merge branch 'kf/http-proxy-auth-methods'

New http.proxyAuthMethod configuration variable can be used to
specify what authentication method to use, as a way to work around
proxies that do not give error response expected by libcurl when
CURLAUTH_ANY is used. Also, the codepath for proxy authentication
has been taught to use credential API to store the authentication
material in user's keyrings.

* kf/http-proxy-auth-methods:
http: use credential API to handle proxy authentication
http: allow selection of proxy authentication method

Merge branch 'jk/ref-cache-non-repository-optim'Junio C Hamano Wed, 3 Feb 2016 22:16:07 +0000 (14:16 -0800)

Merge branch 'jk/ref-cache-non-repository-optim'

The underlying machinery used by "ls-files -o" and other commands
have been taught not to create empty submodule ref cache for a
directory that is not a submodule. This removes a ton of wasted
CPU cycles.

* jk/ref-cache-non-repository-optim:
resolve_gitlink_ref: ignore non-repository paths
clean: make is_git_repository a public function

Merge branch 'ls/travis-prove-order'Junio C Hamano Wed, 3 Feb 2016 22:16:07 +0000 (14:16 -0800)

Merge branch 'ls/travis-prove-order'

Automated tests in Travis CI environment has been optimized by
persisting runtime statistics of previous "prove" run, executing
tests that take longer before other ones; this reduces the total
wallclock time.

* ls/travis-prove-order:
travis-ci: explicity use container-based infrastructure
travis-ci: run previously failed tests first, then slowest to fastest

Merge branch 'dt/unpack-compare-entry-optim'Junio C Hamano Wed, 3 Feb 2016 22:16:06 +0000 (14:16 -0800)

Merge branch 'dt/unpack-compare-entry-optim'

"git checkout $branch" (and other operations that share the same
underlying machinery) has been optimized.

* dt/unpack-compare-entry-optim:
unpack-trees: fix accidentally quadratic behavior
do_compare_entry: use already-computed path

Merge branch 'js/dirname-basename'Junio C Hamano Wed, 3 Feb 2016 22:16:06 +0000 (14:16 -0800)

Merge branch 'js/dirname-basename'

dirname() emulation has been added, as Msys2 lacks it.

* js/dirname-basename:
mingw: avoid linking to the C library's isalpha()
t0060: loosen overly strict expectations
t0060: verify that basename() and dirname() work as expected
compat/basename.c: provide a dirname() compatibility function
compat/basename: make basename() conform to POSIX
Refactor skipping DOS drive prefixes

Merge branch 'pw/completion-stash'Junio C Hamano Wed, 3 Feb 2016 22:16:06 +0000 (14:16 -0800)

Merge branch 'pw/completion-stash'

* pw/completion-stash:
completion: update completion arguments for stash

Merge branch 'pw/completion-show-branch'Junio C Hamano Wed, 3 Feb 2016 22:16:05 +0000 (14:16 -0800)

Merge branch 'pw/completion-show-branch'

* pw/completion-show-branch:
completion: complete show-branch "--date-order"

Merge branch 'jk/completion-rebase'Junio C Hamano Wed, 3 Feb 2016 22:16:05 +0000 (14:16 -0800)

Merge branch 'jk/completion-rebase'

* jk/completion-rebase:
completion: add missing git-rebase options

Merge branch 'nd/diff-with-path-params'Junio C Hamano Wed, 3 Feb 2016 22:16:04 +0000 (14:16 -0800)

Merge branch 'nd/diff-with-path-params'

A few options of "git diff" did not work well when the command was
run from a subdirectory.

* nd/diff-with-path-params:
diff: make -O and --output work in subdirectory
diff-no-index: do not take a redundant prefix argument

Merge branch 'lv/add-doc-working-tree'Junio C Hamano Wed, 3 Feb 2016 22:16:04 +0000 (14:16 -0800)

Merge branch 'lv/add-doc-working-tree'

* lv/add-doc-working-tree:
git-add doc: do not say working directory when you mean working tree

Merge branch 'dw/subtree-split-do-not-drop-merge'Junio C Hamano Wed, 3 Feb 2016 22:16:03 +0000 (14:16 -0800)

Merge branch 'dw/subtree-split-do-not-drop-merge'

The "split" subcommand of "git subtree" (in contrib/) incorrectly
skipped merges when it shouldn't, which was corrected.

* dw/subtree-split-do-not-drop-merge:
contrib/subtree: fix "subtree split" skipped-merge bug

Merge branch 'tb/complete-word-diff-regex'Junio C Hamano Wed, 3 Feb 2016 22:16:03 +0000 (14:16 -0800)

Merge branch 'tb/complete-word-diff-regex'

* tb/complete-word-diff-regex:
completion: complete "diff --word-diff-regex="

Merge branch 'mk/asciidoctor-bq-workaround'Junio C Hamano Wed, 3 Feb 2016 22:16:01 +0000 (14:16 -0800)

Merge branch 'mk/asciidoctor-bq-workaround'

* mk/asciidoctor-bq-workaround:
Documentation: remove unnecessary backslashes

Merge branch 'dg/subtree-test'Junio C Hamano Wed, 3 Feb 2016 22:16:00 +0000 (14:16 -0800)

Merge branch 'dg/subtree-test'

* dg/subtree-test:
contrib/subtree: Make testing easier

Merge branch 'tg/ls-remote-symref'Junio C Hamano Wed, 3 Feb 2016 22:16:00 +0000 (14:16 -0800)

Merge branch 'tg/ls-remote-symref'

"ls-remote" learned an option to show which branch the remote
repository advertises as its primary by pointing its HEAD at.

* tg/ls-remote-symref:
ls-remote: add support for showing symrefs
ls-remote: use parse-options api
ls-remote: fix synopsis
ls-remote: document --refs option
ls-remote: document --quiet option

Merge branch 'tb/ls-files-eol'Junio C Hamano Wed, 3 Feb 2016 22:15:59 +0000 (14:15 -0800)

Merge branch 'tb/ls-files-eol'

"git ls-files" learned a new "--eol" option to help diagnose
end-of-line problems.

* tb/ls-files-eol:
ls-files: add eol diagnostics

Merge branch 'jk/notes-merge-from-anywhere'Junio C Hamano Wed, 3 Feb 2016 22:15:59 +0000 (14:15 -0800)

Merge branch 'jk/notes-merge-from-anywhere'

"git notes merge" used to limit the source of the merged notes tree
to somewhere under refs/notes/ hierarchy, which was too limiting
when inventing a workflow to exchange notes with remote
repositories using remote-tracking notes trees (located in e.g.
refs/remote-notes/ or somesuch).

* jk/notes-merge-from-anywhere:
notes: allow merging from arbitrary references

Merge branch 'jc/peace-with-crlf'Junio C Hamano Wed, 3 Feb 2016 22:15:58 +0000 (14:15 -0800)

Merge branch 'jc/peace-with-crlf'

Many commands that read files that are expected to contain text
that is generated (or can be edited) by the end user to control
their behaviour (e.g. "git grep -f <filename>") have been updated
to be more tolerant to lines that are terminated with CRLF (they
used to treat such a line to contain payload that ends with CR,
which is usually not what the users expect).

* jc/peace-with-crlf:
test-sha1-array: read command stream with strbuf_getline()
grep: read -f file with strbuf_getline()
send-pack: read list of refs with strbuf_getline()
column: read lines with strbuf_getline()
cat-file: read batch stream with strbuf_getline()
transport-helper: read helper response with strbuf_getline()
clone/sha1_file: read info/alternates with strbuf_getline()
remote.c: read $GIT_DIR/remotes/* with strbuf_getline()
ident.c: read /etc/mailname with strbuf_getline()
rev-parse: read parseopt spec with strbuf_getline()
revision: read --stdin with strbuf_getline()
hash-object: read --stdin-paths with strbuf_getline()

Getting closer to 2.7.1Junio C Hamano Mon, 1 Feb 2016 23:17:29 +0000 (15:17 -0800)

Getting closer to 2.7.1

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

Merge branch 'jk/list-tag-2.7-regression'Junio C Hamano Mon, 1 Feb 2016 23:14:24 +0000 (15:14 -0800)

Merge branch 'jk/list-tag-2.7-regression'

"git tag" started listing a tag "foo" as "tags/foo" when a branch
named "foo" exists in the same repository; remove this unnecessary
disambiguation, which is a regression introduced in v2.7.0.

* jk/list-tag-2.7-regression:
tag: do not show ambiguous tag names as "tags/foo"
t6300: use test_atom for some un-modern tests

Merge branch 'ew/svn-1.9.0-auth'Junio C Hamano Mon, 1 Feb 2016 23:14:23 +0000 (15:14 -0800)

Merge branch 'ew/svn-1.9.0-auth'

* ew/svn-1.9.0-auth:
git-svn: fix auth parameter handling on SVN 1.9.0+

Fourth batch for 2.8.cycleJunio C Hamano Fri, 29 Jan 2016 00:14:25 +0000 (16:14 -0800)

Fourth batch for 2.8.cycle

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

Merge branch 'jk/shortlog'Junio C Hamano Fri, 29 Jan 2016 00:10:14 +0000 (16:10 -0800)

Merge branch 'jk/shortlog'

"git shortlog" used to accumulate various pieces of information
regardless of what was asked to be shown in the final output. It
has been optimized by noticing what need not to be collected
(e.g. there is no need to collect the log messages when showing
only the number of changes).

* jk/shortlog:
shortlog: don't warn on empty author
shortlog: optimize out useless string list
shortlog: optimize out useless "<none>" normalization
shortlog: optimize "--summary" mode
shortlog: replace hand-parsing of author with pretty-printer
shortlog: use strbufs to read from stdin
shortlog: match both "Author:" and "author" on stdin

Merge branch 'jc/strbuf-getline'Junio C Hamano Fri, 29 Jan 2016 00:10:14 +0000 (16:10 -0800)

Merge branch 'jc/strbuf-getline'

The preliminary clean-up for jc/peace-with-crlf topic.

* jc/strbuf-getline:
strbuf: give strbuf_getline() to the "most text friendly" variant
checkout-index: there are only two possible line terminations
update-index: there are only two possible line terminations
check-ignore: there are only two possible line terminations
check-attr: there are only two possible line terminations
mktree: there are only two possible line terminations
strbuf: introduce strbuf_getline_{lf,nul}()
strbuf: make strbuf_getline_crlf() global
strbuf: miniscule style fix

Merge branch 'js/msys2'Junio C Hamano Fri, 29 Jan 2016 00:10:13 +0000 (16:10 -0800)

Merge branch 'js/msys2'

Beginning of the upstreaming process of Git for Windows effort.

* js/msys2:
mingw: uglify (a, 0) definitions to shut up warnings
mingw: squash another warning about a cast
mingw: avoid warnings when casting HANDLEs to int
mingw: avoid redefining S_* constants
compat/winansi: support compiling with MSys2
compat/mingw: support MSys2-based MinGW build
nedmalloc: allow compiling with MSys2's compiler
config.mak.uname: supporting 64-bit MSys2
config.mak.uname: support MSys2

Merge branch 'tk/interpret-trailers-in-place'Junio C Hamano Fri, 29 Jan 2016 00:10:13 +0000 (16:10 -0800)

Merge branch 'tk/interpret-trailers-in-place'

"interpret-trailers" has been taught to optionally update a file in
place, instead of always writing the result to the standard output.

* tk/interpret-trailers-in-place:
interpret-trailers: add option for in-place editing
trailer: allow to write to files other than stdout

Merge branch 'jk/sanity'Junio C Hamano Fri, 29 Jan 2016 00:10:13 +0000 (16:10 -0800)

Merge branch 'jk/sanity'

The description for SANITY prerequisite the test suite uses has
been clarified both in the comment and in the implementation.

* jk/sanity:
test-lib: clarify and tighten SANITY

Merge branch 'jk/filter-branch-no-index'Junio C Hamano Fri, 29 Jan 2016 00:10:12 +0000 (16:10 -0800)

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

A recent optimization to filter-branch in v2.7.0 introduced a
regression when --prune-empty filter is used, which has been
corrected.

* jk/filter-branch-no-index:
filter-branch: resolve $commit^{tree} in no-index case

t7063: add tests for core.untrackedCacheChristian Couder Wed, 27 Jan 2016 06:58:07 +0000 (07:58 +0100)

t7063: add tests for core.untrackedCache

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

test-dump-untracked-cache: don't modify the untracked... Christian Couder Wed, 27 Jan 2016 06:58:06 +0000 (07:58 +0100)

test-dump-untracked-cache: don't modify the untracked cache

To correctly perform its testing function,
test-dump-untracked-cache should not change the state of the
untracked cache in the index.

As a previous patch makes read_index_from() change the state of
the untracked cache and as test-dump-untracked-cache indirectly
calls this function, we need a mechanism to prevent
read_index_from() from changing the untracked cache state when
it's called from test-dump-untracked-cache.

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

config: add core.untrackedCacheChristian Couder Wed, 27 Jan 2016 06:58:05 +0000 (07:58 +0100)

config: add core.untrackedCache

When we know that mtime on directory as given by the environment
is usable for the purpose of untracked cache, we may want the
untracked cache to be always used without any mtime test or
kernel name check being performed.

Also when we know that mtime is not usable for the purpose of
untracked cache, for example because the repo is shared over a
network file system, we may want the untracked-cache to be
automatically removed from the index.

Allow the user to express such preference by setting the
'core.untrackedCache' configuration variable, which can take
'keep', 'false', or 'true' and default to 'keep'.

When read_index_from() is called, it now adds or removes the
untracked cache in the index to respect the value of this
variable. So it does nothing if the value is `keep` or if the
variable is unset; it adds the untracked cache if the value is
`true`; and it removes the cache if the value is `false`.

`git update-index --[no-|force-]untracked-cache` still adds the
untracked cache to, or removes it, from the index, but this
shows a warning if it goes against the value of
core.untrackedCache, because the next time the index is read
the untracked cache will be added or removed if the
configuration is set to do so.

Also `--untracked-cache` used to check that the underlying
operating system and file system change `st_mtime` field of a
directory if files are added or deleted in that directory. But
because those tests take a long time, `--untracked-cache` no
longer performs them. Instead, there is now
`--test-untracked-cache` to perform the tests. This change
makes `--untracked-cache` the same as `--force-untracked-cache`.

This last change is backward incompatible and should be
mentioned in the release notes.

Helped-by: Duy Nguyen <pclouds@gmail.com>
Helped-by: Torsten Bögershausen <tboegi@web.de>
Helped-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
read-cache: Duy'sfixup

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

merge-file: ensure that conflict sections match eol... Johannes Schindelin Wed, 27 Jan 2016 16:37:40 +0000 (17:37 +0100)

merge-file: ensure that conflict sections match eol style

In the previous patch, we made sure that the conflict markers themselves
match the end-of-line style of the input files. However, this still left
out the conflicting text itself: if it lacks a trailing newline, we
add one, and should add a carriage return when appropriate, too.

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

merge-file: let conflict markers match end-of-line... Johannes Schindelin Wed, 27 Jan 2016 16:37:36 +0000 (17:37 +0100)

merge-file: let conflict markers match end-of-line style of the context

When merging files with CR/LF line endings, the conflict markers should
match those, lest the output file has mixed line endings.

This is particularly of interest on Windows, where some editors get
*really* confused by mixed line endings.

The original version of this patch by Beat Bolli respected core.eol, and
a subsequent improvement by this developer also respected gitattributes.
This approach was suboptimal, though: `git merge-file` was invented as a
drop-in replacement for GNU merge and as such has no problem operating
outside of any repository at all!

Another problem with the original approach was pointed out by Junio
Hamano: legacy repositories might have their text files committed using
CR/LF line endings (and core.eol and the gitattributes would give us a
false impression there). Therefore, the much superior approach is to
simply match the context's line endings, if any.

We actually do not have to look at the *entire* context at all: if the
files are all LF-only, or if they all have CR/LF line endings, it is
sufficient to look at just a *single* line to match that style. And if
the line endings are mixed anyway, it is *still* okay to imitate just a
single line's eol: we will just add to the pile of mixed line endings,
and there is nothing we can do about that.

So what we do is: we look at the line preceding the conflict, falling
back to the line preceding that in case it was the last line and had no
line ending, falling back to the first line, first in the first
post-image, then the second post-image, and finally the pre-image.
If we find consistent CR/LF (or undecided) end-of-line style, we match
that, otherwise we use LF-only line endings for the conflict markers.

Note that while it is true that there have to be at least two lines we
can look at (otherwise there would be no conflict), the same is not true
for line *endings*: the three files in question could all consist of a
single line without any line ending, each. In this case we fall back to
using LF-only.

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

git-svn: fix auth parameter handling on SVN 1.9.0+Eric Wong Sat, 16 Jan 2016 10:17:19 +0000 (10:17 +0000)

git-svn: fix auth parameter handling on SVN 1.9.0+

For users with "store-passwords = no" set in the "[auth]" section of
their ~/.subversion/config, SVN 1.9.0+ would fail with the
following message when attempting to call svn_auth_set_parameter:

Value is not a string (or undef) at Git/SVN/Ra.pm

Ironically, this breakage was caused by r1553823 in subversion:

"Make svn_auth_set_parameter() usable from Perl bindings."

Since 2007 (602015e0e6ec), git-svn has used a workaround to make
svn_auth_set_parameter usable internally. However this workaround
breaks under SVN 1.9+, which deals properly with the type mapping
and fails to recognize our workaround.

For pre-1.9.0 SVN, we continue to use the existing workaround for
the lack of proper type mapping in the bindings.

Tested under subversion 1.6.17 and 1.9.3.

I've also verified r1553823 was not backported to SVN 1.8.x:

BRANCH=http://svn.apache.org/repos/asf/subversion/branches/1.8.x
svn log -v $BRANCH/subversion/bindings/swig/core.i

ref: https://bugs.debian.org/797705
Cc: 797705@bugs.debian.org
Reported-by: Thierry Vignaud <thierry.vignaud@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Tested-by: Thierry Vignaud <thierry.vignaud@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Third batch for 2.8 cycleJunio C Hamano Tue, 26 Jan 2016 23:41:04 +0000 (15:41 -0800)

Third batch for 2.8 cycle

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

Merge branch 'jk/symbolic-ref'Junio C Hamano Tue, 26 Jan 2016 23:40:30 +0000 (15:40 -0800)

Merge branch 'jk/symbolic-ref'

The low-level code that is used to create symbolic references has
been updated to share more code with the code that deals with
normal references.

* jk/symbolic-ref:
lock_ref_sha1_basic: handle REF_NODEREF with invalid refs
lock_ref_sha1_basic: always fill old_oid while holding lock
checkout,clone: check return value of create_symref
create_symref: write reflog while holding lock
create_symref: use existing ref-lock code
create_symref: modernize variable names

Merge branch 'ak/format-patch-odir-config'Junio C Hamano Tue, 26 Jan 2016 23:40:30 +0000 (15:40 -0800)

Merge branch 'ak/format-patch-odir-config'

"git format-patch" learned to notice format.outputDirectory
configuration variable. This allows "-o <dir>" option to be
omitted on the command line if you always use the same directory in
your workflow.

* ak/format-patch-odir-config:
format-patch: introduce format.outputDirectory configuration

Merge branch 'rp/p4-filetype-change'Junio C Hamano Tue, 26 Jan 2016 23:40:29 +0000 (15:40 -0800)

Merge branch 'rp/p4-filetype-change'

* rp/p4-filetype-change:
git-p4.py: add support for filetype change

Merge branch 'js/close-packs-before-gc'Junio C Hamano Tue, 26 Jan 2016 23:40:29 +0000 (15:40 -0800)

Merge branch 'js/close-packs-before-gc'

Many codepaths that run "gc --auto" before exiting kept packfiles
mapped and left the file descriptors to them open, which was not
friendly to systems that cannot remove files that are open. They
now close the packs before doing so.

* js/close-packs-before-gc:
receive-pack: release pack files before garbage-collecting
merge: release pack files before garbage-collecting
am: release pack files before garbage-collecting
fetch: release pack files before garbage-collecting

Merge branch 'jk/ok-to-fail-gc-auto-in-rebase'Junio C Hamano Tue, 26 Jan 2016 23:40:29 +0000 (15:40 -0800)

Merge branch 'jk/ok-to-fail-gc-auto-in-rebase'

"git rebase", unlike all other callers of "gc --auto", did not
ignore the exit code from "gc --auto".

* jk/ok-to-fail-gc-auto-in-rebase:
rebase: ignore failures from "gc --auto"

Merge branch 'js/pull-rebase-i'Junio C Hamano Tue, 26 Jan 2016 23:40:28 +0000 (15:40 -0800)

Merge branch 'js/pull-rebase-i'

"git pull --rebase" has been extended to allow invoking
"rebase -i".

* js/pull-rebase-i:
completion: add missing branch.*.rebase values
remote: handle the config setting branch.*.rebase=interactive
pull: allow interactive rebase with --rebase=interactive

tag: do not show ambiguous tag names as "tags/foo"Jeff King Tue, 26 Jan 2016 03:00:05 +0000 (22:00 -0500)

tag: do not show ambiguous tag names as "tags/foo"

Since b7cc53e9 (tag.c: use 'ref-filter' APIs, 2015-07-11),
git-tag has started showing tags with ambiguous names (i.e.,
when both "heads/foo" and "tags/foo" exists) as "tags/foo"
instead of just "foo". This is both:

- pointless; the output of "git tag" includes only
refs/tags, so we know that "foo" means the one in
"refs/tags".

and

- ambiguous; in the original output, we know that the line
"foo" means that "refs/tags/foo" exists. In the new
output, it is unclear whether we mean "refs/tags/foo" or
"refs/tags/tags/foo".

The reason this happens is that commit b7cc53e9 switched
git-tag to use ref-filter's "%(refname:short)" output
formatting, which was adapted from for-each-ref. This more
general code does not know that we care only about tags, and
uses shorten_unambiguous_ref to get the short-name. We need
to tell it that we care only about "refs/tags/", and it
should shorten with respect to that value.

In theory, the ref-filter code could figure this out by us
passing FILTER_REFS_TAGS. But there are two complications
there:

1. The handling of refname:short is deep in formatting
code that does not even have our ref_filter struct, let
alone the arguments to the filter_ref struct.

2. In git v2.7.0, we expose the formatting language to the
user. If we follow this path, it will mean that
"%(refname:short)" behaves differently for "tag" versus
"for-each-ref" (including "for-each-ref refs/tags/"),
which can lead to confusion.

Instead, let's add a new modifier to the formatting
language, "strip", to remove a specific set of prefix
components. This fixes "git tag", and lets users invoke the
same behavior from their own custom formats (for "tag" or
"for-each-ref") while leaving ":short" with its same
consistent meaning in all places.

We introduce a test in t7004 for "git tag", which fails
without this patch. We also add a similar test in t3203 for
"git branch", which does not actually fail. But since it is
likely that "branch" will eventually use the same formatting
code, the test helps defend against future regressions.

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

http: use credential API to handle proxy authenticationKnut Franke Tue, 26 Jan 2016 13:02:48 +0000 (13:02 +0000)

http: use credential API to handle proxy authentication

Currently, the only way to pass proxy credentials to curl is by including them
in the proxy URL. Usually, this means they will end up on disk unencrypted, one
way or another (by inclusion in ~/.gitconfig, shell profile or history). Since
proxy authentication often uses a domain user, credentials can be security
sensitive; therefore, a safer way of passing credentials is desirable.

If the configured proxy contains a username but not a password, query the
credential API for one. Also, make sure we approve/reject proxy credentials
properly.

For consistency reasons, add parsing of http_proxy/https_proxy/all_proxy
environment variables, which would otherwise be evaluated as a fallback by curl.
Without this, we would have different semantics for git configuration and
environment variables.

Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Helped-by: Elia Pinto <gitter.spiros@gmail.com>
Signed-off-by: Knut Franke <k.franke@science-computing.de>
Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http: allow selection of proxy authentication methodKnut Franke Tue, 26 Jan 2016 13:02:47 +0000 (13:02 +0000)

http: allow selection of proxy authentication method

CURLAUTH_ANY does not work with proxies which answer unauthenticated requests
with a 307 redirect to an error page instead of a 407 listing supported
authentication methods. Therefore, allow the authentication method to be set
using the environment variable GIT_HTTP_PROXY_AUTHMETHOD or configuration
variables http.proxyAuthmethod and remote.<name>.proxyAuthmethod (in analogy
to http.proxy and remote.<name>.proxy).

The following values are supported:

* anyauth (default)
* basic
* digest
* negotiate
* ntlm

Signed-off-by: Knut Franke <k.franke@science-computing.de>
Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Helped-by: Elia Pinto <gitter.spiros@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

travis-ci: explicity use container-based infrastructureLars Schneider Tue, 26 Jan 2016 09:53:43 +0000 (10:53 +0100)

travis-ci: explicity use container-based infrastructure

Set `sudo: false` to explicitly use the (faster) container-based
infrastructure for the Travis-CI Linux build.

More info:
https://docs.travis-ci.com/user/ci-environment/#Virtualization-environments

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

travis-ci: run previously failed tests first, then... Lars Schneider Tue, 26 Jan 2016 09:53:42 +0000 (10:53 +0100)

travis-ci: run previously failed tests first, then slowest to fastest

The Travis-CI machines are in a clean state in the beginning of every run
(transient by default). Use the Travis-CI cache feature to make the prove
state persistent across consecutive Travis-CI runs on the same branch.
This allows to run previously failed tests first and run remaining tests
in slowest to fastest order. As a result it is less likely that Travis-CI
needs to wait for a single test at the end which speeds up the test suite
execution by ~2 min.

Travis-CI can only cache entire directories. Prove stores the .prove file
always in the t/ directory but we don't want to cache the entire t/ directory.
Therefore we create a symlink from $HOME/travis-cache/.prove to t/.prove and
cache the $HOME/travis-cache directory.

Unfortunately the cache feature is only available (for free) on the
Travis-CI Linux environment.

Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: update completion arguments for stashPaul Wagland Tue, 26 Jan 2016 09:37:19 +0000 (10:37 +0100)

completion: update completion arguments for stash

Add --all and --include-untracked to the git stash save completions.
Add --quiet to the git stash drop completions.
Update git stash branch so that the first argument expands out to the
possible branch names, and the other arguments expand to the stash
names.

Signed-off-by: Paul Wagland <paul@kungfoocoder.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: complete show-branch "--date-order"Paul Wagland Sat, 23 Jan 2016 01:25:54 +0000 (02:25 +0100)

completion: complete show-branch "--date-order"

Signed-off-by: Paul Wagland <paul@kungfoocoder.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: add missing git-rebase optionsJohn Keeping Thu, 21 Jan 2016 20:52:24 +0000 (20:52 +0000)

completion: add missing git-rebase options

This adds the --no-* variants where those are documented in
git-rebase(1).

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mingw: avoid linking to the C library's isalpha()Johannes Sixt Mon, 25 Jan 2016 21:47:56 +0000 (22:47 +0100)

mingw: avoid linking to the C library's isalpha()

The implementation of mingw_skip_dos_drive_prefix() calls isalpha() via
has_dos_drive_prefix(). Since the definition occurs long before isalpha()
is defined in git-compat-util.h, my build environment reports:

CC alloc.o
In file included from git-compat-util.h:186,
from cache.h:4,
from alloc.c:12:
compat/mingw.h: In function 'mingw_skip_dos_drive_prefix':
compat/mingw.h:365: warning: implicit declaration of function 'isalpha'

Dscho does not see a similar warning in his build and suspects that
ctype.h is included somehow behind the scenes. This implies that his build
links to the C library's isalpha() and does not use git's isalpha().

To fix both the warning in my build and the inconsistency in Dscho's
build, move the function definition to mingw.c. Then it picks up git's
isalpha() because git-compat-util.h is included at the top of the file.

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

dir: simplify untracked cache "ident" fieldChristian Couder Sun, 24 Jan 2016 15:28:21 +0000 (16:28 +0100)

dir: simplify untracked cache "ident" field

It is not a good idea to compare kernel versions and disable
the untracked cache if it changes, as people may upgrade and
still want the untracked cache to work. So let's just
compare work tree locations and kernel name to decide if we
should disable it.

Also storing many locations in the ident field and comparing
to any of them can be dangerous if GIT_WORK_TREE is used with
different values. So let's just store one location, the
location of the current work tree.

The downside is that untracked cache can only be used by one
type of OS for now. Exporting a git repo to different clients
via a network to e.g. Linux and Windows means that only one
can use the untracked cache.

If the location changed in the ident field and we still want
an untracked cache, let's delete the cache and recreate it.

Note that if an untracked cache has been created by a
previous Git version, then the kernel version is stored in
the ident field. As we now compare with just the kernel
name the comparison will fail and the untracked cache will
be disabled until it's recreated.

Helped-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir: add remove_untracked_cache()Christian Couder Sun, 24 Jan 2016 15:28:20 +0000 (16:28 +0100)

dir: add remove_untracked_cache()

Factor out code into remove_untracked_cache(), which will be used
in a later commit.

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

dir: add {new,add}_untracked_cache()Christian Couder Sun, 24 Jan 2016 15:28:19 +0000 (16:28 +0100)

dir: add {new,add}_untracked_cache()

Factor out code into new_untracked_cache() and
add_untracked_cache(), which will be used
in later commits.

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

update-index: move 'uc' var declarationChristian Couder Sun, 24 Jan 2016 15:28:18 +0000 (16:28 +0100)

update-index: move 'uc' var declaration

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

update-index: add untracked cache notificationsChristian Couder Sun, 24 Jan 2016 15:28:17 +0000 (16:28 +0100)

update-index: add untracked cache notifications

Attempting to flip the untracked-cache feature on for a random index
file with

cd /random/unrelated/place
git --git-dir=/somewhere/else/.git update-index --untracked-cache

would not work as you might expect. Because flipping the feature on
in the index also records the location of the corresponding working
tree (/random/unrelated/place in the above example), when the index
is subsequently used to keep track of files in the working tree in
/somewhere/else, the feature is disabled.

With this patch "git update-index --[test-]untracked-cache" tells the
user in which directory tests are performed. This makes it easy to
spot any problem.

Also in verbose mode, let's tell the user when the cache is enabled
or disabled.

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

update-index: add --test-untracked-cacheChristian Couder Sun, 24 Jan 2016 15:28:16 +0000 (16:28 +0100)

update-index: add --test-untracked-cache

It is nice to just be able to test if untracked cache is
supported without enabling it.

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

update-index: use enum for untracked cache optionsChristian Couder Sun, 24 Jan 2016 15:28:15 +0000 (16:28 +0100)

update-index: use enum for untracked cache options

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

t6300: use test_atom for some un-modern testsJeff King Sun, 24 Jan 2016 23:08:18 +0000 (18:08 -0500)

t6300: use test_atom for some un-modern tests

Because this script has to test so many formatters, we have
the nice "test_atom" helper, but we don't use it
consistently. Let's do so. This is shorter, gets rid of some
tests that have their "expected" setup outside of a
test_expect_success block, and lets us organize the changes
better (e.g., putting "refname:short" near "refname").

We also expand the "%(push)" tests a little to match the
"%(upstream)" ones.

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

resolve_gitlink_ref: ignore non-repository pathsJeff King Fri, 22 Jan 2016 22:29:30 +0000 (17:29 -0500)

resolve_gitlink_ref: ignore non-repository paths

When we want to look up a submodule ref, we use
get_ref_cache(path) to find or auto-create its ref cache.
But if we feed a path that isn't actually a git repository,
we blindly create the ref cache, and then may die deeper in
the code when we try to access it. This is a problem because
many callers speculatively feed us a path that looks vaguely
like a repository, and expect us to tell them when it is
not.

This patch teaches resolve_gitlink_ref to reject
non-repository paths without creating a ref_cache. This
avoids the die(), and also performs better if you have a
large number of these faux-submodule directories (because
the ref_cache lookup is linear, under the assumption that
there won't be a large number of submodules).

To accomplish this, we also break get_ref_cache into two
pieces: the lookup and auto-creation (the latter is lumped
into create_ref_cache). This lets us first cheaply ask our
cache "is it a submodule we know about?" If so, we can avoid
repeating our filesystem lookup. So lookups of real
submodules are not penalized; they examine the submodule's
.git directory only once.

The test in t3000 demonstrates a case where this improves
correctness (we used to just die). The new perf case in
p7300 shows off the speed improvement in an admittedly
pathological repository:

Test HEAD^ HEAD
----------------------------------------------------------------
7300.4: ls-files -o 66.97(66.15+0.87) 0.33(0.08+0.24) -99.5%

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

clean: make is_git_repository a public functionJeff King Fri, 22 Jan 2016 22:27:33 +0000 (17:27 -0500)

clean: make is_git_repository a public function

We have always had is_git_directory(), for looking at a
specific directory to see if it contains a git repo. In
0179ca7 (clean: improve performance when removing lots of
directories, 2015-06-15), we added is_git_repository() which
checks for a non-bare repository by looking at its ".git"
entry.

However, the fix in 0179ca7 needs to be applied other
places, too. Let's make this new helper globally available.
We need to give it a better name, though, to avoid confusion
with is_git_directory(). This patch does that, documents
both functions with a comment to reduce confusion, and
removes the clean-specific references in the comments.

Based-on-a-patch-by: Andreas Krey <a.krey@gmx.de>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

worktree: stop supporting moving worktrees manuallyNguyễn Thái Ngọc Duy Fri, 22 Jan 2016 08:35:49 +0000 (15:35 +0700)

worktree: stop supporting moving worktrees manually

The current update_linked_gitdir() has a bug that can create "gitdir"
file in non-multi-worktree setup. Worse, sometimes it can write relative
path to "gitdir" file, which will not work (e.g. "git worktree list"
will display the worktree's location incorrectly)

Instead of fixing this, we step back a bit. The original design was
probably not well thought out. For now, if the user manually moves a
worktree, they have to fix up "gitdir" file manually or the worktree
will get pruned.

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

Merge branch 'ep/shell-command-substitution-style'Junio C Hamano Fri, 22 Jan 2016 21:08:46 +0000 (13:08 -0800)

Merge branch 'ep/shell-command-substitution-style'

A shell script style update to change `command substitution` into
$(command substitution). Coverts contrib/ and much of the t/
directory contents.

* ep/shell-command-substitution-style: (92 commits)
t9901-git-web--browse.sh: use the $( ... ) construct for command substitution
t9501-gitweb-standalone-http-status.sh: use the $( ... ) construct for command substitution
t9350-fast-export.sh: use the $( ... ) construct for command substitution
t9300-fast-import.sh: use the $( ... ) construct for command substitution
t9150-svk-mergetickets.sh: use the $( ... ) construct for command substitution
t9145-git-svn-master-branch.sh: use the $( ... ) construct for command substitution
t9138-git-svn-authors-prog.sh: use the $( ... ) construct for command substitution
t9137-git-svn-dcommit-clobber-series.sh: use the $( ... ) construct for command substitution
t9132-git-svn-broken-symlink.sh: use the $( ... ) construct for command substitution
t9130-git-svn-authors-file.sh: use the $( ... ) construct for command substitution
t9129-git-svn-i18n-commitencoding.sh: use the $( ... ) construct for command substitution
t9119-git-svn-info.sh: use the $( ... ) construct for command substitution
t9118-git-svn-funky-branch-names.sh: use the $( ... ) construct for command substitution
t9114-git-svn-dcommit-merge.sh: use the $( ... ) construct for command substitution
t9110-git-svn-use-svm-props.sh: use the $( ... ) construct for command substitution
t9109-git-svn-multi-glob.sh: use the $( ... ) construct for command substitution
t9108-git-svn-glob.sh: use the $( ... ) construct for command substitution
t9107-git-svn-migrate.sh: use the $( ... ) construct for command substitution
t9105-git-svn-commit-diff.sh: use the $( ... ) construct for command substitution
t9104-git-svn-follow-parent.sh: use the $( ... ) construct for command substitution
...