gitweb.git
Merge branch 'sb/pathspec-errors'Junio C Hamano Wed, 18 Jan 2017 23:12:15 +0000 (15:12 -0800)

Merge branch 'sb/pathspec-errors'

Running "git add a/b" when "a" is a submodule correctly errored
out, but without a meaningful error message.

* sb/pathspec-errors:
pathspec: give better message for submodule related pathspec error

Merge branch 'pb/test-must-fail-is-for-git'Junio C Hamano Wed, 18 Jan 2017 23:12:15 +0000 (15:12 -0800)

Merge branch 'pb/test-must-fail-is-for-git'

Test cleanup.

* pb/test-must-fail-is-for-git:
t9813: avoid using pipes
don't use test_must_fail with grep

Merge branch 'bw/pathspec-cleanup'Junio C Hamano Wed, 18 Jan 2017 23:12:14 +0000 (15:12 -0800)

Merge branch 'bw/pathspec-cleanup'

Code clean-up in the pathspec API.

* bw/pathspec-cleanup:
pathspec: rename prefix_pathspec to init_pathspec_item
pathspec: small readability changes
pathspec: create strip submodule slash helpers
pathspec: create parse_element_magic helper
pathspec: create parse_long_magic function
pathspec: create parse_short_magic function
pathspec: factor global magic into its own function
pathspec: simpler logic to prefix original pathspec elements
pathspec: always show mnemonic and name in unsupported_magic
pathspec: remove unused variable from unsupported_magic
pathspec: copy and free owned memory
pathspec: remove the deprecated get_pathspec function
ls-tree: convert show_recursive to use the pathspec struct interface
dir: convert fill_directory to use the pathspec struct interface
dir: remove struct path_simplify
mv: remove use of deprecated 'get_pathspec()'

Merge branch 'js/mingw-test-push-unc-path'Junio C Hamano Wed, 18 Jan 2017 23:12:14 +0000 (15:12 -0800)

Merge branch 'js/mingw-test-push-unc-path'

"git push \\server\share\dir" has recently regressed and then
fixed. A test has retroactively been added for this breakage.

* js/mingw-test-push-unc-path:
mingw: add a regression test for pushing to UNC paths

Merge branch 'sb/submodule-cleanup-export-git-dir-env'Junio C Hamano Wed, 18 Jan 2017 23:12:14 +0000 (15:12 -0800)

Merge branch 'sb/submodule-cleanup-export-git-dir-env'

Code cleanup.

* sb/submodule-cleanup-export-git-dir-env:
submodule.c: use GIT_DIR_ENVIRONMENT consistently

Merge branch 'km/branch-get-push-while-detached'Junio C Hamano Wed, 18 Jan 2017 23:12:14 +0000 (15:12 -0800)

Merge branch 'km/branch-get-push-while-detached'

"git <cmd> @{push}" on a detached HEAD used to segfault; it has
been corrected to error out with a message.

* km/branch-get-push-while-detached:
branch_get_push: do not segfault when HEAD is detached

Merge branch 'jk/rebase-i-squash-count-fix'Junio C Hamano Wed, 18 Jan 2017 23:12:13 +0000 (15:12 -0800)

Merge branch 'jk/rebase-i-squash-count-fix'

"git rebase -i" with a recent update started showing an incorrect
count when squashing more than 10 commits.

* jk/rebase-i-squash-count-fix:
rebase--interactive: count squash commits above 10 correctly

Merge branch 'jk/blame-fixes'Junio C Hamano Wed, 18 Jan 2017 23:12:13 +0000 (15:12 -0800)

Merge branch 'jk/blame-fixes'

"git blame --porcelain" misidentified the "previous" <commit, path>
pair (aka "source") when contents came from two or more files.

* jk/blame-fixes:
blame: output porcelain "previous" header for each file
blame: handle --no-abbrev
blame: fix alignment with --abbrev=40

Merge branch 'jk/archive-zip-userdiff-config'Junio C Hamano Wed, 18 Jan 2017 23:12:12 +0000 (15:12 -0800)

Merge branch 'jk/archive-zip-userdiff-config'

"git archive" did not read the standard configuration files, and
failed to notice a file that is marked as binary via the userdiff
driver configuration.

* jk/archive-zip-userdiff-config:
archive-zip: load userdiff config

Merge branch 'dt/disable-bitmap-in-auto-gc'Junio C Hamano Wed, 18 Jan 2017 23:12:12 +0000 (15:12 -0800)

Merge branch 'dt/disable-bitmap-in-auto-gc'

It is natural that "git gc --auto" may not attempt to pack
everything into a single pack, and there is no point in warning
when the user has configured the system to use the pack bitmap,
leading to disabling further "gc".

* dt/disable-bitmap-in-auto-gc:
repack: die on incremental + write-bitmap-index
auto gc: don't write bitmaps for incremental repacks

Merge branch 'ls/p4-retry-thrice'Junio C Hamano Wed, 18 Jan 2017 23:12:12 +0000 (15:12 -0800)

Merge branch 'ls/p4-retry-thrice'

A recent updates to "git p4" was not usable for older p4 but it
could be made to work with minimum changes. Do so.

* ls/p4-retry-thrice:
git-p4: do not pass '-r 0' to p4 commands

Merge branch 'sb/submodule-rm-absorb'Junio C Hamano Wed, 18 Jan 2017 23:12:11 +0000 (15:12 -0800)

Merge branch 'sb/submodule-rm-absorb'

"git rm" used to refuse to remove a submodule when it has its own
git repository embedded in its working tree. It learned to move
the repository away to $GIT_DIR/modules/ of the superproject
instead, and allow the submodule to be deleted (as long as there
will be no loss of local modifications, that is).

* sb/submodule-rm-absorb:
rm: absorb a submodules git dir before deletion
submodule: rename and add flags to ok_to_remove_submodule
submodule: modernize ok_to_remove_submodule to use argv_array
submodule.h: add extern keyword to functions

Merge branch 'bw/grep-recurse-submodules'Junio C Hamano Wed, 18 Jan 2017 23:12:11 +0000 (15:12 -0800)

Merge branch 'bw/grep-recurse-submodules'

"git grep" has been taught to optionally recurse into submodules.

* bw/grep-recurse-submodules:
grep: search history of moved submodules
grep: enable recurse-submodules to work on <tree> objects
grep: optionally recurse into submodules
grep: add submodules as a grep source type
submodules: load gitmodules file from commit sha1
submodules: add helper to determine if a submodule is initialized
submodules: add helper to determine if a submodule is populated
real_path: canonicalize directory separators in root parts
real_path: have callers use real_pathdup and strbuf_realpath
real_path: create real_pathdup
real_path: convert real_path_internal to strbuf_realpath
real_path: resolve symlinks by hand

Merge git://ozlabs.org/~paulus/gitkJunio C Hamano Wed, 18 Jan 2017 18:27:59 +0000 (10:27 -0800)

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

* 'master' of git://ozlabs.org/~paulus/gitk:
gitk: Remove translated message from comments
gitk: ru.po: Update Russian translation
gitk: Update copyright notice to 2016
gitk: Clear array 'commitinfo' on reload
gitk: Remove closed file descriptors from $blobdifffd
gitk: Turn off undo manager in the text widget
gitk: Fix Japanese translation for "marked commit"
gitk: Fix missing commits when using -S or -G
gitk: Use explicit RGB green instead of "lime"
gitk: Add Portuguese translation
gitk: Makefile: create install bin directory
gitk: Include commit title in branch dialog
gitk: Allow checking out a remote branch
gitk: Add a 'rename' option to the branch context menu

gitk: Remove translated message from commentsDavid Aguilar Wed, 18 Jan 2017 03:52:45 +0000 (19:52 -0800)

gitk: Remove translated message from comments

"make update-po" fails because a previously untranslated string
has now been translated:

Updating po/sv.po
po/sv.po:1388: duplicate message definition...
po/sv.po:380: ...this is the location of the first definition

Remove the duplicate message definition.

Reported-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>

RelNotes: drop merge-later comments for maintJunio C Hamano Tue, 17 Jan 2017 23:27:13 +0000 (15:27 -0800)

RelNotes: drop merge-later comments for maint

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

Merge branch 'maint'Junio C Hamano Tue, 17 Jan 2017 23:20:01 +0000 (15:20 -0800)

Merge branch 'maint'

Almost ready for 2.11.1Junio C Hamano Tue, 17 Jan 2017 22:48:44 +0000 (14:48 -0800)

Almost ready for 2.11.1

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

Merge branch 'mm/gc-safety-doc' into maintJunio C Hamano Tue, 17 Jan 2017 23:19:11 +0000 (15:19 -0800)

Merge branch 'mm/gc-safety-doc' into maint

Doc update.

* mm/gc-safety-doc:
git-gc.txt: expand discussion of races with other processes

Merge branch 'mm/push-social-engineering-attack-doc... Junio C Hamano Tue, 17 Jan 2017 23:19:10 +0000 (15:19 -0800)

Merge branch 'mm/push-social-engineering-attack-doc' into maint

Doc update on fetching and pushing.

* mm/push-social-engineering-attack-doc:
doc: mention transfer data leaks in more places

Merge branch 'jt/fetch-no-redundant-tag-fetch-map'... Junio C Hamano Tue, 17 Jan 2017 23:19:09 +0000 (15:19 -0800)

Merge branch 'jt/fetch-no-redundant-tag-fetch-map' into maint

Code cleanup to avoid using redundant refspecs while fetching with
the --tags option.

* jt/fetch-no-redundant-tag-fetch-map:
fetch: do not redundantly calculate tag refmap

Merge branch 'ls/filter-process' into maintJunio C Hamano Tue, 17 Jan 2017 23:19:08 +0000 (15:19 -0800)

Merge branch 'ls/filter-process' into maint

Doc update.

* ls/filter-process:
t0021: fix flaky test
docs: warn about possible '=' in clean/smudge filter process values

Merge branch 'kh/tutorial-grammofix' into maintJunio C Hamano Tue, 17 Jan 2017 23:19:08 +0000 (15:19 -0800)

Merge branch 'kh/tutorial-grammofix' into maint

* kh/tutorial-grammofix:
doc: omit needless "for"
doc: make the intent of sentence clearer
doc: add verb in front of command to run
doc: add articles (grammar)

Merge branch 'lr/doc-fix-cet' into maintJunio C Hamano Tue, 17 Jan 2017 23:19:07 +0000 (15:19 -0800)

Merge branch 'lr/doc-fix-cet' into maint

* lr/doc-fix-cet:
date-formats.txt: Typo fix

Merge branch 'sb/t3600-cleanup' into maintJunio C Hamano Tue, 17 Jan 2017 23:19:06 +0000 (15:19 -0800)

Merge branch 'sb/t3600-cleanup' into maint

Code cleanup.

* sb/t3600-cleanup:
t3600: slightly modernize style
t3600: remove useless redirect

Merge branch 'jk/readme-gmane-is-no-more' into maintJunio C Hamano Tue, 17 Jan 2017 23:19:05 +0000 (15:19 -0800)

Merge branch 'jk/readme-gmane-is-no-more' into maint

* jk/readme-gmane-is-no-more:
README: replace gmane link with public-inbox

Merge branch 'sb/unpack-trees-grammofix' into maintJunio C Hamano Tue, 17 Jan 2017 23:19:05 +0000 (15:19 -0800)

Merge branch 'sb/unpack-trees-grammofix' into maint

* sb/unpack-trees-grammofix:
unpack-trees: fix grammar for untracked files in directories

Merge branch 'ls/t0021-fixup' into maintJunio C Hamano Tue, 17 Jan 2017 23:19:04 +0000 (15:19 -0800)

Merge branch 'ls/t0021-fixup' into maint

* ls/t0021-fixup:
t0021: minor filter process test cleanup

Merge branch 'ak/lazy-prereq-mktemp' into maintJunio C Hamano Tue, 17 Jan 2017 23:19:04 +0000 (15:19 -0800)

Merge branch 'ak/lazy-prereq-mktemp' into maint

Test code clean-up.

* ak/lazy-prereq-mktemp:
t7610: clean up foo.XXXXXX tmpdir

Merge branch 'nd/qsort-in-merge-recursive' into maintJunio C Hamano Tue, 17 Jan 2017 23:19:03 +0000 (15:19 -0800)

Merge branch 'nd/qsort-in-merge-recursive' into maint

Code simplification.

* nd/qsort-in-merge-recursive:
merge-recursive.c: use string_list_sort instead of qsort

Merge branch 'dt/smart-http-detect-server-going-away... Junio C Hamano Tue, 17 Jan 2017 23:19:03 +0000 (15:19 -0800)

Merge branch 'dt/smart-http-detect-server-going-away' into maint

When the http server gives an incomplete response to a smart-http
rpc call, it could lead to client waiting for a full response that
will never come. Teach the client side to notice this condition
and abort the transfer.

An improvement counterproposal has failed.
cf. <20161114194049.mktpsvgdhex2f4zv@sigill.intra.peff.net>

* dt/smart-http-detect-server-going-away:
upload-pack: optionally allow fetching any sha1
remote-curl: don't hang when a server dies before any output

Merge branch 'mk/mingw-winansi-ttyname-termination... Junio C Hamano Tue, 17 Jan 2017 23:19:03 +0000 (15:19 -0800)

Merge branch 'mk/mingw-winansi-ttyname-termination-fix' into maint

A potential but unlikely buffer overflow in Windows port has been
fixed.

* mk/mingw-winansi-ttyname-termination-fix:
mingw: consider that UNICODE_STRING::Length counts bytes

Merge branch 'gv/p4-multi-path-commit-fix' into maintJunio C Hamano Tue, 17 Jan 2017 23:19:02 +0000 (15:19 -0800)

Merge branch 'gv/p4-multi-path-commit-fix' into maint

"git p4" that tracks multile p4 paths imported a single changelist
that touches files in these multiple paths as one commit, followed
by many empty commits. This has been fixed.

* gv/p4-multi-path-commit-fix:
git-p4: fix multi-path changelist empty commits

Merge branch 'jk/difftool-in-subdir' into maintJunio C Hamano Tue, 17 Jan 2017 23:11:08 +0000 (15:11 -0800)

Merge branch 'jk/difftool-in-subdir' into maint

Even though an fix was attempted in Git 2.9.3 days, but running
"git difftool --dir-diff" from a subdirectory never worked. This
has been fixed.

* jk/difftool-in-subdir:
difftool: rename variables for consistency
difftool: chdir as early as possible
difftool: sanitize $workdir as early as possible
difftool: fix dir-diff index creation when in a subdirectory

Merge branch 'ld/p4-compare-dir-vs-symlink' into maintJunio C Hamano Tue, 17 Jan 2017 23:11:07 +0000 (15:11 -0800)

Merge branch 'ld/p4-compare-dir-vs-symlink' into maint

"git p4" misbehaved when swapping a directory and a symbolic link.

* ld/p4-compare-dir-vs-symlink:
git-p4: avoid crash adding symlinked directory

Merge branch 'jc/push-default-explicit' into maintJunio C Hamano Tue, 17 Jan 2017 23:11:07 +0000 (15:11 -0800)

Merge branch 'jc/push-default-explicit' into maint

A lazy "git push" without refspec did not internally use a fully
specified refspec to perform 'current', 'simple', or 'upstream'
push, causing unnecessary "ambiguous ref" errors.

* jc/push-default-explicit:
push: test pushing ambiguously named branches
push: do not use potentially ambiguous default refspec

Merge branch 'jt/mailinfo-fold-in-body-headers' into... Junio C Hamano Tue, 17 Jan 2017 23:11:06 +0000 (15:11 -0800)

Merge branch 'jt/mailinfo-fold-in-body-headers' into maint

Fix for NDEBUG builds.

* jt/mailinfo-fold-in-body-headers:
mailinfo.c: move side-effects outside of assert

Merge branch 'jk/index-pack-wo-repo-from-stdin' into... Junio C Hamano Tue, 17 Jan 2017 23:11:06 +0000 (15:11 -0800)

Merge branch 'jk/index-pack-wo-repo-from-stdin' into maint

"git index-pack --stdin" needs an access to an existing repository,
but "git index-pack file.pack" to generate an .idx file that
corresponds to a packfile does not.

* jk/index-pack-wo-repo-from-stdin:
index-pack: skip collision check when not in repository
t: use nongit() function where applicable
index-pack: complain when --stdin is used outside of a repo
t5000: extract nongit function to test-lib-functions.sh

Merge branch 'jk/parseopt-usage-msg-opt' into maintJunio C Hamano Tue, 17 Jan 2017 23:11:06 +0000 (15:11 -0800)

Merge branch 'jk/parseopt-usage-msg-opt' into maint

The function usage_msg_opt() has been updated to say "fatal:"
before the custom message programs give, when they want to die
with a message about wrong command line options followed by the
standard usage string.

* jk/parseopt-usage-msg-opt:
parse-options: print "fatal:" before usage_msg_opt()

Merge branch 'jk/quote-env-path-list-component' into... Junio C Hamano Tue, 17 Jan 2017 23:11:06 +0000 (15:11 -0800)

Merge branch 'jk/quote-env-path-list-component' into maint

A recent update to receive-pack to make it easier to drop garbage
objects made it clear that GIT_ALTERNATE_OBJECT_DIRECTORIES cannot
have a pathname with a colon in it (no surprise!), and this in turn
made it impossible to push into a repository at such a path. This
has been fixed by introducing a quoting mechanism used when
appending such a path to the colon-separated list.

* jk/quote-env-path-list-component:
t5615-alternate-env: double-quotes in file names do not work on Windows
t5547-push-quarantine: run the path separator test on Windows, too
tmp-objdir: quote paths we add to alternates
alternates: accept double-quoted paths

Merge branch 'nd/shallow-fixup' into maintJunio C Hamano Tue, 17 Jan 2017 23:11:05 +0000 (15:11 -0800)

Merge branch 'nd/shallow-fixup' into maint

Code cleanup in shallow boundary computation.

* nd/shallow-fixup:
shallow.c: remove useless code
shallow.c: bit manipulation tweaks
shallow.c: avoid theoretical pointer wrap-around
shallow.c: make paint_alloc slightly more robust
shallow.c: stop abusing COMMIT_SLAB_SIZE for paint_info's memory pools
shallow.c: rename fields in paint_info to better express their purposes

Merge branch 'sb/sequencer-abort-safety' into maintJunio C Hamano Tue, 17 Jan 2017 23:11:05 +0000 (15:11 -0800)

Merge branch 'sb/sequencer-abort-safety' into maint

Unlike "git am --abort", "git cherry-pick --abort" moved HEAD back
to where cherry-pick started while picking multiple changes, when
the cherry-pick stopped to ask for help from the user, and the user
did "git reset --hard" to a different commit in order to re-attempt
the operation.

* sb/sequencer-abort-safety:
Revert "sequencer: remove useless get_dir() function"
sequencer: remove useless get_dir() function
sequencer: make sequencer abort safer
t3510: test that cherry-pick --abort does not unsafely change HEAD
am: change safe_to_abort()'s not rewinding error into a warning
am: fix filename in safe_to_abort() error message

Merge branch 'da/mergetool-xxdiff-hotkey' into maintJunio C Hamano Tue, 17 Jan 2017 23:11:05 +0000 (15:11 -0800)

Merge branch 'da/mergetool-xxdiff-hotkey' into maint

The way to specify hotkeys to "xxdiff" that is used by "git
mergetool" has been modernized to match recent versions of xxdiff.

* da/mergetool-xxdiff-hotkey:
mergetools: fix xxdiff hotkeys

Merge branch 'jc/pull-rebase-ff' into maintJunio C Hamano Tue, 17 Jan 2017 23:11:04 +0000 (15:11 -0800)

Merge branch 'jc/pull-rebase-ff' into maint

"git pull --rebase", when there is no new commits on our side since
we forked from the upstream, should be able to fast-forward without
invoking "git rebase", but it didn't.

* jc/pull-rebase-ff:
pull: fast-forward "pull --rebase=true"

Merge branch 'js/normalize-path-copy-ceil' into maintJunio C Hamano Tue, 17 Jan 2017 23:11:03 +0000 (15:11 -0800)

Merge branch 'js/normalize-path-copy-ceil' into maint

A pathname that begins with "//" or "\\" on Windows is special but
path normalization logic was unaware of it.

* js/normalize-path-copy-ceil:
normalize_path_copy(): fix pushing to //server/share/dir on Windows

Merge branch 'ak/commit-only-allow-empty' into maintJunio C Hamano Tue, 17 Jan 2017 23:11:03 +0000 (15:11 -0800)

Merge branch 'ak/commit-only-allow-empty' into maint

"git commit --allow-empty --only" (no pathspec) with dirty index
ought to be an acceptable way to create a new commit that does not
change any paths, but it was forbidden, perhaps because nobody
needed it so far.

* ak/commit-only-allow-empty:
commit: remove 'Clever' message for --only --amend
commit: make --only --allow-empty work without paths

Merge branch 'da/difftool-dir-diff-fix' into maintJunio C Hamano Tue, 17 Jan 2017 22:49:30 +0000 (14:49 -0800)

Merge branch 'da/difftool-dir-diff-fix' into maint

"git difftool --dir-diff" had a minor regression when started from
a subdirectory, which has been fixed.

* da/difftool-dir-diff-fix:
difftool: fix dir-diff index creation when in a subdirectory

Merge branch 'jb/diff-no-index-no-abbrev' into maintJunio C Hamano Tue, 17 Jan 2017 22:49:30 +0000 (14:49 -0800)

Merge branch 'jb/diff-no-index-no-abbrev' into maint

"git diff --no-index" did not take "--no-abbrev" option.

* jb/diff-no-index-no-abbrev:
diff: handle --no-abbrev in no-index case

Merge branch 'jk/stash-disable-renames-internally'... Junio C Hamano Tue, 17 Jan 2017 22:49:30 +0000 (14:49 -0800)

Merge branch 'jk/stash-disable-renames-internally' into maint

When diff.renames configuration is on (and with Git 2.9 and later,
it is enabled by default, which made it worse), "git stash"
misbehaved if a file is removed and another file with a very
similar content is added.

* jk/stash-disable-renames-internally:
stash: prefer plumbing over git-diff

Merge branch 'jk/http-walker-limit-redirect' into maintJunio C Hamano Tue, 17 Jan 2017 22:49:29 +0000 (14:49 -0800)

Merge branch 'jk/http-walker-limit-redirect' into maint

Update the error messages from the dumb-http client when it fails
to obtain loose objects; we used to give sensible error message
only upon 404 but we now forbid unexpected redirects that needs to
be reported with something sensible.

* jk/http-walker-limit-redirect:
http-walker: complain about non-404 loose object errors
http: treat http-alternates like redirects
http: make redirects more obvious
remote-curl: rename shadowed options variable
http: always update the base URL for redirects
http: simplify update_url_from_redirect

Merge branch 'jc/renormalize-merge-kill-safer-crlf... Junio C Hamano Tue, 17 Jan 2017 22:49:28 +0000 (14:49 -0800)

Merge branch 'jc/renormalize-merge-kill-safer-crlf' into maint

Fix a corner case in merge-recursive regression that crept in
during 2.10 development cycle.

* jc/renormalize-merge-kill-safer-crlf:
convert: git cherry-pick -Xrenormalize did not work
merge-recursive: handle NULL in add_cacheinfo() correctly
cherry-pick: demonstrate a segmentation fault

Merge branch 'ls/p4-empty-file-on-lfs' into maintJunio C Hamano Tue, 17 Jan 2017 22:49:27 +0000 (14:49 -0800)

Merge branch 'ls/p4-empty-file-on-lfs' into maint

"git p4" LFS support was broken when LFS stores an empty blob.

* ls/p4-empty-file-on-lfs:
git-p4: fix empty file processing for large file system backend GitLFS

Merge branch 'da/mergetool-trust-exit-code' into maintJunio C Hamano Tue, 17 Jan 2017 22:49:27 +0000 (14:49 -0800)

Merge branch 'da/mergetool-trust-exit-code' into maint

mergetool.<tool>.trustExitCode configuration variable did not apply
to built-in tools, but now it does.

* da/mergetool-trust-exit-code:
mergetools/vimdiff: trust Vim's exit code
mergetool: honor mergetool.$tool.trustExitCode for built-in tools

Merge branch 'nd/worktree-list-fixup' into maintJunio C Hamano Tue, 17 Jan 2017 22:49:27 +0000 (14:49 -0800)

Merge branch 'nd/worktree-list-fixup' into maint

The output from "git worktree list" was made in readdir() order,
and was unstable.

* nd/worktree-list-fixup:
worktree list: keep the list sorted
worktree.c: get_worktrees() takes a new flag argument
get_worktrees() must return main worktree as first item even on error
worktree: reorder an if statement
worktree.c: zero new 'struct worktree' on allocation

Merge branch 'bw/push-dry-run' into maintJunio C Hamano Tue, 17 Jan 2017 22:49:27 +0000 (14:49 -0800)

Merge branch 'bw/push-dry-run' into maint

"git push --dry-run --recurse-submodule=on-demand" wasn't
"--dry-run" in the submodules.

* bw/push-dry-run:
push: fix --dry-run to not push submodules
push: --dry-run updates submodules when --recurse-submodules=on-demand

Merge branch 'hv/submodule-not-yet-pushed-fix' into... Junio C Hamano Tue, 17 Jan 2017 22:49:26 +0000 (14:49 -0800)

Merge branch 'hv/submodule-not-yet-pushed-fix' into maint

The code in "git push" to compute if any commit being pushed in the
superproject binds a commit in a submodule that hasn't been pushed
out was overly inefficient, making it unusable even for a small
project that does not have any submodule but have a reasonable
number of refs.

* hv/submodule-not-yet-pushed-fix:
submodule_needs_pushing(): explain the behaviour when we cannot answer
batch check whether submodule needs pushing into one call
serialize collection of refs that contain submodule changes
serialize collection of changed submodules

Merge branch 'dt/empty-submodule-in-merge' into maintJunio C Hamano Tue, 17 Jan 2017 22:49:26 +0000 (14:49 -0800)

Merge branch 'dt/empty-submodule-in-merge' into maint

An empty directory in a working tree that can simply be nuked used
to interfere while merging or cherry-picking a change to create a
submodule directory there, which has been fixed..

* dt/empty-submodule-in-merge:
submodules: allow empty working-tree dirs in merge/cherry-pick

Merge branch 'jk/rev-parse-symbolic-parents-fix' into... Junio C Hamano Tue, 17 Jan 2017 22:49:26 +0000 (14:49 -0800)

Merge branch 'jk/rev-parse-symbolic-parents-fix' into maint

"git rev-parse --symbolic" failed with a more recent notation like
"HEAD^-1" and "HEAD^!".

* jk/rev-parse-symbolic-parents-fix:
rev-parse: fix parent shorthands with --symbolic

Merge branch 'js/mingw-isatty' into maintJunio C Hamano Tue, 17 Jan 2017 22:49:25 +0000 (14:49 -0800)

Merge branch 'js/mingw-isatty' into maint

Update the isatty() emulation for Windows by updating the previous
hack that depended on internals of (older) MSVC runtime.

* js/mingw-isatty:
mingw: replace isatty() hack
mingw: fix colourization on Cygwin pseudo terminals
mingw: adjust is_console() to work with stdin
mingw: intercept isatty() to handle /dev/null as Git expects it

Merge branch 'bb/unicode-9.0' into maintJunio C Hamano Tue, 17 Jan 2017 22:49:25 +0000 (14:49 -0800)

Merge branch 'bb/unicode-9.0' into maint

The character width table has been updated to match Unicode 9.0

* bb/unicode-9.0:
unicode_width.h: update the width tables to Unicode 9.0
update_unicode.sh: remove the plane filter
update_unicode.sh: automatically download newer definition files
update_unicode.sh: pin the uniset repo to a known good commit
update_unicode.sh: remove an unnecessary subshell level
update_unicode.sh: move it into contrib/update-unicode

Merge branch 'ls/travis-update-p4-and-lfs' into maintJunio C Hamano Tue, 17 Jan 2017 22:49:24 +0000 (14:49 -0800)

Merge branch 'ls/travis-update-p4-and-lfs' into maint

The default Travis-CI configuration specifies newer P4 and GitLFS.

* ls/travis-update-p4-and-lfs:
travis-ci: update P4 to 16.2 and GitLFS to 1.5.2 in Linux build

Fifth batch 2.12Junio C Hamano Tue, 10 Jan 2017 23:25:46 +0000 (15:25 -0800)

Fifth batch 2.12

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

Merge branch 'sb/submodule-embed-gitdir'Junio C Hamano Tue, 10 Jan 2017 23:24:27 +0000 (15:24 -0800)

Merge branch 'sb/submodule-embed-gitdir'

A new submodule helper "git submodule embedgitdirs" to make it
easier to move embedded .git/ directory for submodules in a
superproject to .git/modules/ (and point the latter with the former
that is turned into a "gitdir:" file) has been added.

* sb/submodule-embed-gitdir:
worktree: initialize return value for submodule_uses_worktrees
submodule: add absorb-git-dir function
move connect_work_tree_and_git_dir to dir.h
worktree: check if a submodule uses worktrees
test-lib-functions.sh: teach test_commit -C <dir>
submodule helper: support super prefix
submodule: use absolute path for computing relative path connecting

Merge branch 'jc/retire-compaction-heuristics'Junio C Hamano Tue, 10 Jan 2017 23:24:27 +0000 (15:24 -0800)

Merge branch 'jc/retire-compaction-heuristics'

"git diff" and its family had two experimental heuristics to shift
the contents of a hunk to make the patch easier to read. One of
them turns out to be better than the other, so leave only the
"--indent-heuristic" option and remove the other one.

* jc/retire-compaction-heuristics:
diff: retire "compaction" heuristics

Merge branch 'nd/config-misc-fixes'Junio C Hamano Tue, 10 Jan 2017 23:24:27 +0000 (15:24 -0800)

Merge branch 'nd/config-misc-fixes'

Leakage of lockfiles in the config subsystem has been fixed.

* nd/config-misc-fixes:
config.c: handle lock file in error case in git_config_rename_...
config.c: rename label unlock_and_out
config.c: handle error case for fstat() calls

Merge branch 'jc/abbrev-autoscale-config'Junio C Hamano Tue, 10 Jan 2017 23:24:26 +0000 (15:24 -0800)

Merge branch 'jc/abbrev-autoscale-config'

Recent update to the default abbreviation length that auto-scales
lacked documentation update, which has been corrected.

* jc/abbrev-autoscale-config:
config.abbrev: document the new default that auto-scales

Merge branch 'mh/fast-import-notes-fix-new'Junio C Hamano Tue, 10 Jan 2017 23:24:26 +0000 (15:24 -0800)

Merge branch 'mh/fast-import-notes-fix-new'

"git fast-import" sometimes mishandled while rebalancing notes
tree, which has been fixed.

* mh/fast-import-notes-fix-new:
fast-import: properly fanout notes when tree is imported

Merge branch 'jc/git-open-cloexec'Junio C Hamano Tue, 10 Jan 2017 23:24:26 +0000 (15:24 -0800)

Merge branch 'jc/git-open-cloexec'

The codeflow of setting NOATIME and CLOEXEC on file descriptors Git
opens has been simplified.
We may want to drop the tip one, but we'll see.

* jc/git-open-cloexec:
sha1_file: stop opening files with O_NOATIME
git_open_cloexec(): use fcntl(2) w/ FD_CLOEXEC fallback
git_open(): untangle possible NOATIME and CLOEXEC interactions

Merge branch 'jc/compression-config'Junio C Hamano Tue, 10 Jan 2017 23:24:25 +0000 (15:24 -0800)

Merge branch 'jc/compression-config'

Compression setting for producing packfiles were spread across
three codepaths, one of which did not honor any configuration.
Unify these so that all of them honor core.compression and
pack.compression variables the same way.

* jc/compression-config:
compression: unify pack.compression configuration parsing

Merge branch 'dt/smart-http-detect-server-going-away'Junio C Hamano Tue, 10 Jan 2017 23:24:25 +0000 (15:24 -0800)

Merge branch 'dt/smart-http-detect-server-going-away'

When the http server gives an incomplete response to a smart-http
rpc call, it could lead to client waiting for a full response that
will never come. Teach the client side to notice this condition
and abort the transfer.

An improvement counterproposal has failed.
cf. <20161114194049.mktpsvgdhex2f4zv@sigill.intra.peff.net>

* dt/smart-http-detect-server-going-away:
upload-pack: optionally allow fetching any sha1
remote-curl: don't hang when a server dies before any output

Merge branch 'mm/gc-safety-doc'Junio C Hamano Tue, 10 Jan 2017 23:24:25 +0000 (15:24 -0800)

Merge branch 'mm/gc-safety-doc'

Doc update.

* mm/gc-safety-doc:
git-gc.txt: expand discussion of races with other processes

Merge branch 'mm/push-social-engineering-attack-doc'Junio C Hamano Tue, 10 Jan 2017 23:24:24 +0000 (15:24 -0800)

Merge branch 'mm/push-social-engineering-attack-doc'

Doc update on fetching and pushing.

* mm/push-social-engineering-attack-doc:
doc: mention transfer data leaks in more places

Merge branch 'jt/fetch-no-redundant-tag-fetch-map'Junio C Hamano Tue, 10 Jan 2017 23:24:23 +0000 (15:24 -0800)

Merge branch 'jt/fetch-no-redundant-tag-fetch-map'

Code cleanup to avoid using redundant refspecs while fetching with
the --tags option.

* jt/fetch-no-redundant-tag-fetch-map:
fetch: do not redundantly calculate tag refmap

Merge branch 'jc/latin-1'Junio C Hamano Tue, 10 Jan 2017 23:24:22 +0000 (15:24 -0800)

Merge branch 'jc/latin-1'

Some platforms no longer understand "latin-1" that is still seen in
the wild in e-mail headers; replace them with "iso-8859-1" that is
more widely known when conversion fails from/to it.

* jc/latin-1:
utf8: accept "latin-1" as ISO-8859-1
utf8: refactor code to decide fallback encoding

pathspec: give better message for submodule related... Stefan Beller Mon, 9 Jan 2017 23:16:50 +0000 (15:16 -0800)

pathspec: give better message for submodule related pathspec error

Every once in a while someone complains to the mailing list to have
run into this weird assertion[1]. The usual response from the mailing
list is link to old discussions[2], and acknowledging the problem
stating it is known.

This patch accomplishes two things:

1. Switch assert() to die("BUG") to give a more readable message.

2. Take one of the cases where we hit a BUG and turn it into a normal
"there was something wrong with the input" message.

This assertion triggered for cases where there wasn't a programming
bug, but just bogus input. In particular, if the user asks for a
pathspec that is inside a submodule, we shouldn't assert() or
die("BUG"); we should tell the user their request is bogus.

The only reason we did not check for it, is the expensive nature
of such a check, so callers avoid setting the flag
PATHSPEC_STRIP_SUBMODULE_SLASH_EXPENSIVE. However when we die due
to bogus input, the expense of CPU cycles spent outweighs the user
wondering what went wrong, so run that check unconditionally before
dying with a more generic error message.

Note: There is a case (e.g. "git -C submodule add .") in which we call
strip_submodule_slash_expensive, as git-add requests it via the flag
PATHSPEC_STRIP_SUBMODULE_SLASH_EXPENSIVE, but the assert used to
trigger nevertheless, because the flag PATHSPEC_LITERAL was not set,
such that we executed

if (item->nowildcard_len < prefixlen)
item->nowildcard_len = prefixlen;

and prefixlen was not adapted (e.g. it was computed from "submodule/")
So in the die_inside_submodule_path function we also need handle paths,
that were stripped before, i.e. are the exact submodule path. This
is why the conditions in die_inside_submodule_path are slightly
different than in strip_submodule_slash_expensive.

[1] https://www.google.com/search?q=item-%3Enowildcard_len
[2] http://git.661346.n2.nabble.com/assert-failed-in-submodule-edge-case-td7628687.html
https://www.spinics.net/lists/git/msg249473.html

Helped-by: Jeff King <peff@peff.net>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t9813: avoid using pipesPranit Bauva Tue, 3 Jan 2017 19:57:08 +0000 (01:27 +0530)

t9813: avoid using pipes

The exit code of the upstream in a pipe is ignored thus we should avoid
using it. By writing out the output of the git command to a file, we can
test the exit codes of both the commands.

Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
Acked-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pathspec: rename prefix_pathspec to init_pathspec_itemBrandon Williams Wed, 4 Jan 2017 18:04:11 +0000 (10:04 -0800)

pathspec: rename prefix_pathspec to init_pathspec_item

Give a more relevant name to the prefix_pathspec function as it does
more than just prefix a pathspec element.

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

pathspec: small readability changesBrandon Williams Wed, 4 Jan 2017 18:04:10 +0000 (10:04 -0800)

pathspec: small readability changes

A few small changes to improve readability. This is done by grouping related
assignments, adding blank lines, ensuring lines are <80 characters, and
adding additional comments.

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

pathspec: create strip submodule slash helpersBrandon Williams Wed, 4 Jan 2017 18:04:09 +0000 (10:04 -0800)

pathspec: create strip submodule slash helpers

Factor out the logic responsible for stripping the trailing slash on
pathspecs referencing submodules into its own function.

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

pathspec: create parse_element_magic helperBrandon Williams Wed, 4 Jan 2017 18:04:08 +0000 (10:04 -0800)

pathspec: create parse_element_magic helper

Factor out the logic responsible for the magic in a pathspec element
into its own function.

Also avoid calling into the parsing functions when
`PATHSPEC_LITERAL_PATH` is specified since it causes magic to be
ignored and all paths to be treated as literals.

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

pathspec: create parse_long_magic functionBrandon Williams Wed, 4 Jan 2017 18:04:07 +0000 (10:04 -0800)

pathspec: create parse_long_magic function

Factor out the logic responsible for parsing long magic into its own
function. As well as hoist the prefix check logic outside of the inner
loop as there isn't anything that needs to be done after matching
"prefix:".

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

pathspec: create parse_short_magic functionBrandon Williams Wed, 4 Jan 2017 18:04:06 +0000 (10:04 -0800)

pathspec: create parse_short_magic function

Factor out the logic responsible for parsing short magic into its own
function.

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

pathspec: factor global magic into its own functionBrandon Williams Wed, 4 Jan 2017 18:04:05 +0000 (10:04 -0800)

pathspec: factor global magic into its own function

Create helper functions to read the global magic environment variables
in additon to factoring out the global magic gathering logic into its
own function.

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

pathspec: simpler logic to prefix original pathspec... Brandon Williams Wed, 4 Jan 2017 18:04:04 +0000 (10:04 -0800)

pathspec: simpler logic to prefix original pathspec elements

The logic used to prefix an original pathspec element with 'prefix'
magic is more general purpose and can be used for more than just short
magic. Remove the extra code paths and rename 'prefix_short_magic' to
'prefix_magic' to better indicate that it can be used in more general
situations.

Also, slightly change the logic which decides when to prefix the
original element in order to prevent a pathspec of "." from getting
converted to "" (empty string).

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

pathspec: always show mnemonic and name in unsupported_... Brandon Williams Wed, 4 Jan 2017 18:04:03 +0000 (10:04 -0800)

pathspec: always show mnemonic and name in unsupported_magic

For better clarity, always show the mnemonic and name of the unsupported
magic being used. This lets users have a more clear understanding of
what magic feature isn't supported. And if they supplied a mnemonic,
the user will be told what its corresponding name is which will allow
them to more easily search the man pages for that magic type.

This also avoids passing an extra parameter around the pathspec
initialization code.

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

pathspec: remove unused variable from unsupported_magicBrandon Williams Wed, 4 Jan 2017 18:04:02 +0000 (10:04 -0800)

pathspec: remove unused variable from unsupported_magic

Removed unused variable 'n' from the 'unsupported_magic()' function.

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

pathspec: copy and free owned memoryBrandon Williams Wed, 4 Jan 2017 18:04:01 +0000 (10:04 -0800)

pathspec: copy and free owned memory

The 'original' string entry in a pathspec_item is only duplicated some
of the time, instead always make a copy of the original and take
ownership of the memory.

Since both 'match' and 'original' string entries in a pathspec_item are
owned by the pathspec struct, they need to be freed when clearing the
pathspec struct (in 'clear_pathspec()') and duplicated when copying the
pathspec struct (in 'copy_pathspec()').

Also change the type of 'match' and 'original' to 'char *' in order to
more explicitly show the ownership of the memory.

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

pathspec: remove the deprecated get_pathspec functionBrandon Williams Wed, 4 Jan 2017 18:04:00 +0000 (10:04 -0800)

pathspec: remove the deprecated get_pathspec function

Now that all callers of the old 'get_pathspec' interface have been
migrated to use the new pathspec struct interface it can be removed
from the codebase.

Since there are no more users of the '_raw' field in the pathspec struct
it can also be removed. This patch also removes the old functionality
of modifying the const char **argv array that was passed into
parse_pathspec. Instead the constructed 'match' string (which is a
pathspec element with the prefix prepended) is only stored in its
corresponding pathspec_item entry.

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

ls-tree: convert show_recursive to use the pathspec... Brandon Williams Wed, 4 Jan 2017 18:03:59 +0000 (10:03 -0800)

ls-tree: convert show_recursive to use the pathspec struct interface

Convert 'show_recursive()' to use the pathspec struct interface from
using the '_raw' entry in the pathspec struct.

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

dir: convert fill_directory to use the pathspec struct... Brandon Williams Wed, 4 Jan 2017 18:03:58 +0000 (10:03 -0800)

dir: convert fill_directory to use the pathspec struct interface

Convert 'fill_directory()' to use the pathspec struct interface from
using the '_raw' entry in the pathspec struct.

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

dir: remove struct path_simplifyBrandon Williams Wed, 4 Jan 2017 18:03:57 +0000 (10:03 -0800)

dir: remove struct path_simplify

Teach simplify_away() and exclude_matches_pathspec() to handle struct
pathspec directly, eliminating the need for the struct path_simplify.

Also renamed the len parameter to pathlen in exclude_matches_pathspec()
to match the parameter names used in simplify_away().

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

mv: remove use of deprecated 'get_pathspec()'Brandon Williams Wed, 4 Jan 2017 18:03:56 +0000 (10:03 -0800)

mv: remove use of deprecated 'get_pathspec()'

Convert the 'internal_copy_pathspec()' function to 'prefix_path()'
instead of using the deprecated 'get_pathspec()' interface. Also,
rename 'internal_copy_pathspec()' to 'internal_prefix_pathspec()' to be
more descriptive of what the funciton is actually doing.

In addition to this, fix a memory leak caused by only duplicating some
of the pathspec elements. Instead always duplicate all of the the
pathspec elements as an intermediate step (with modificationed based on
the passed in flags). This way the intermediate strings can then be
freed after getting the result from 'prefix_path()'.

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

blame: output porcelain "previous" header for each... Jeff King Fri, 6 Jan 2017 04:20:51 +0000 (23:20 -0500)

blame: output porcelain "previous" header for each file

It's possible for content currently found in one file to
have originated in two separate files, each of which may
have been modified in some single older commit. The
--porcelain output generates an incorrect "previous" header
in this case, whereas --line-porcelain gets it right. The
problem is that the porcelain output tries to omit repeated
details of commits, and treats "previous" as a property of
the commit, when it is really a property of the blamed block
of lines.

Let's look at an example. In a case like this, you might see
this output from --line-porcelain:

SOME_SHA1 1 1 1
author ...
committer ...
previous SOME_SHA1^ file_one
filename file_one
...some line content...
SOME_SHA1 2 1 1
author ...
committer ...
previous SOME_SHA1^ file_two
filename file_two
...some different content....

The "filename" fields tell us that the two lines are from
two different files. But notice that the filename also
appears in the "previous" field, which tells us where to
start a re-blame. The second content line never appeared in
file_one at all, so we would obviously need to re-blame from
file_two (or possibly even some other file, if had just been
renamed to file_two in SOME_SHA1).

So far so good. Now here's what --porcelain looks like:

SOME_SHA1 1 1 1
author ...
committer ...
previous SOME_SHA1^ file_one
filename file_one
...some line content...
SOME_SHA1 2 1 1
filename file_two
...some different content....

We've dropped the author and committer fields from the
second line, as they would just be repeats. But we can't
omit "filename", because it depends on the actual block of
blamed lines, not just the commit. This is handled by
emit_porcelain_details(), which will show the filename
either if it is the first mention of the commit _or_ if the
commit has multiple paths in it.

But we don't give "previous" the same handling. It's written
inside emit_one_suspect_detail(), which bails early if we've
already seen that commit. And so the output above is wrong;
a reader would assume that the correct place to re-blame
line two is from file_one, but that's obviously nonsense.

Let's treat "previous" the same as "filename", and show it
fresh whenever we know we are in a confusing case like this.

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

blame: handle --no-abbrevJeff King Fri, 6 Jan 2017 04:18:08 +0000 (23:18 -0500)

blame: handle --no-abbrev

You can already ask blame for full sha1s with "-l" or with
"--abbrev=40". But for consistency with other parts of Git,
we should support "--no-abbrev".

Worse, blame already accepts --no-abbrev, but it's totally
broken. When we see --no-abbrev, the abbrev variable is set
to 0, which is then used as a printf precision. For regular
sha1s, that means we print nothing at all (which is very
wrong). For boundary commits we decrement it to "-1", which
printf interprets as "no limit" (which is almost correct,
except it misses the 39-length magic explained in the
previous commit).

Let's detect --no-abbrev and behave as if --abbrev=40 was
given.

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

blame: fix alignment with --abbrev=40Jeff King Fri, 6 Jan 2017 04:17:40 +0000 (23:17 -0500)

blame: fix alignment with --abbrev=40

The blame command internally adds 1 to any requested sha1
abbreviation length, and then subtracts it when outputting a
boundary commit. This lets regular and boundary sha1s line
up visually, but it misses one corner case.

When the requested length is 40, we bump the value to 41.
But since we only have 40 characters, that's all we can show
(fortunately the truncation is done by a printf precision
field, so it never tries to read past the end of the
buffer). So a normal sha1 shows 40 hex characters, and a
boundary sha1 shows "^" plus 40 hex characters. The result
is misaligned.

The "-l" option to show long sha1s gets around this by
skipping the "abbrev" variable entirely and just always
using GIT_SHA1_HEXSZ. This avoids the "+1" issue, but it
does mean that boundary commits only have 39 characters
printed. This is somewhat odd, but it does look good
visually: the results are aligned and left-justified. The
alternative would be to allocate an extra column that would
contain either an extra space or the "^" boundary marker.

As this is by definition the human-readable view, it's
probably not that big a deal either way (and of course
--porcelain, etc, correctly produce correct 40-hex sha1s).
But for consistency, this patch teaches --abbrev=40 to
produce the same output as "-l" (always left-aligned, with
40-hex for normal sha1s, and "^" plus 39-hex for
boundaries).

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

rebase--interactive: count squash commits above 10... Jeff King Sat, 7 Jan 2017 08:23:19 +0000 (03:23 -0500)

rebase--interactive: count squash commits above 10 correctly

We generate the squash commit message incrementally running
a sed script once for each commit. It parses "This is
a combination of <N> commits" from the first line of the
existing message, adds one to <N>, and uses the result as
the number of our current message.

Since f2d17068fd (i18n: rebase-interactive: mark comments of
squash for translation, 2016-06-17), the first line may be
localized, and sed uses a pretty liberal regex, looking for:

/^#.*([0-9][0-9]*)/

The "[0-9][0-9]*" tries to match double digits, but it
doesn't quite work. The first ".*" is greedy, so if you
have:

This is a combination of 10 commits.

it will eat up "This is a combination of 1", leaving "0" to
match the first "[0-9]" digit, and then skipping the
optional match of "[0-9]*".

As a result, the count resets every 10 commits, and a
15-commit squash would end up as:

# This is a combination of 5 commits.
# This is the 1st commit message:
...
# This is the commit message #2:
... and so on ..
# This is the commit message #10:
...
# This is the commit message #1:
...
# This is the commit message #2:
... etc, up to 5 ...

We can fix this by making the ".*" less greedy. Instead of
depending on ".*?" working portably, we can just limit the
match to non-digit characters, which accomplishes the same
thing.

Reported-by: Brandon Tolsch <btolsch@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

branch_get_push: do not segfault when HEAD is detachedKyle Meyer Sat, 7 Jan 2017 01:12:15 +0000 (20:12 -0500)

branch_get_push: do not segfault when HEAD is detached

Move the detached HEAD check from branch_get_push_1() to
branch_get_push() to avoid setting branch->push_tracking_ref when
branch is NULL.

Signed-off-by: Kyle Meyer <kyle@kyleam.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

archive-zip: load userdiff configJeff King Mon, 2 Jan 2017 22:25:09 +0000 (17:25 -0500)

archive-zip: load userdiff config

Since 4aff646d17 (archive-zip: mark text files in archives,
2015-03-05), the zip archiver will look at the userdiff
driver to decide whether a file is text or binary. This
usually doesn't need to look any further than the attributes
themselves (e.g., "-diff", etc). But if the user defines a
custom driver like "diff=foo", we need to look at
"diff.foo.binary" in the config. Prior to this patch, we
didn't actually load it.

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mingw: add a regression test for pushing to UNC pathsJohannes Schindelin Mon, 2 Jan 2017 10:40:20 +0000 (11:40 +0100)

mingw: add a regression test for pushing to UNC paths

On Windows, there are "UNC paths" to access network (AKA shared)
folders, of the form \\server\sharename\directory. This provides a
convenient way for Windows developers to share their Git repositories
without having to have a dedicated server.

Git for Windows v2.11.0 introduced a regression where pushing to said
UNC paths no longer works, although fetching and cloning still does, as
reported here: https://github.com/git-for-windows/git/issues/979

This regression was fixed in 7814fbe3f1 (normalize_path_copy(): fix
pushing to //server/share/dir on Windows, 2016-12-14).

Let's make sure that it does not regress again, by introducing a test
that uses so-called "administrative shares": disk volumes are
automatically shared under certain circumstances, e.g. the C: drive is
shared as \\localhost\c$. The test needs to be skipped if the current
directory is inaccessible via said administrative share, of course.

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

don't use test_must_fail with grepPranit Bauva Tue, 3 Jan 2017 19:57:07 +0000 (01:27 +0530)

don't use test_must_fail with grep

test_must_fail should only be used for testing git commands. To test the
failure of other commands use `!`.

Reported-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>