git
8 years agoMerge branch 'maint'
Junio C Hamano [Wed, 17 Feb 2016 18:14:39 +0000 (10:14 -0800)] 
Merge branch 'maint'

* maint:
  Start preparing for 2.7.2
  git-cvsserver.perl: fix typo

8 years agoSeventh batch for the 2.8 cycle
Junio C Hamano [Wed, 17 Feb 2016 18:13:57 +0000 (10:13 -0800)] 
Seventh batch for the 2.8 cycle

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'dw/mergetool-vim-window-shuffle'
Junio C Hamano [Wed, 17 Feb 2016 18:13:34 +0000 (10:13 -0800)] 
Merge branch 'dw/mergetool-vim-window-shuffle'

The vimdiff backend for "git mergetool" has been tweaked to arrange
and number buffers in the order that would match the expectation of
majority of people who read left to right, then top down and assign
buffers 1 2 3 4 "mentally" to local base remote merge windows based
on that order.

* dw/mergetool-vim-window-shuffle:
  mergetool: reorder vim/gvim buffers in three-way diffs

8 years agoMerge branch 'ah/stripspace-optstring'
Junio C Hamano [Wed, 17 Feb 2016 18:13:33 +0000 (10:13 -0800)] 
Merge branch 'ah/stripspace-optstring'

* ah/stripspace-optstring:
  stripspace: call U+0020 a "space" instead of a "blank"

8 years agoMerge branch 'mm/clean-doc-fix'
Junio C Hamano [Wed, 17 Feb 2016 18:13:33 +0000 (10:13 -0800)] 
Merge branch 'mm/clean-doc-fix'

The documentation for "git clean" has been corrected; it mentioned
that .git/modules/* are removed by giving two "-f", which has never
been the case.

* mm/clean-doc-fix:
  Documentation/git-clean.txt: don't mention deletion of .git/modules/*

8 years agoMerge branch 'jk/rerere-xsnprintf'
Junio C Hamano [Wed, 17 Feb 2016 18:13:33 +0000 (10:13 -0800)] 
Merge branch 'jk/rerere-xsnprintf'

Some calls to strcpy(3) triggers a false warning from static
analysers that are less intelligent than humans, and reducing the
number of these false hits helps us notice real issues.  A few
calls to strcpy(3) in "git rerere" that are already safe has been
rewritten to avoid false wanings.

* jk/rerere-xsnprintf:
  rerere: replace strcpy with xsnprintf

8 years agoMerge branch 'jk/test-path-utils-xsnprintf'
Junio C Hamano [Wed, 17 Feb 2016 18:13:32 +0000 (10:13 -0800)] 
Merge branch 'jk/test-path-utils-xsnprintf'

Some calls to strcpy(3) triggers a false warning from static
analysers that are less intelligent than humans, and reducing the
number of these false hits helps us notice real issues.  A few
calls to strcpy(3) in test-path-utils that are already safe has
been rewritten to avoid false wanings.

* jk/test-path-utils-xsnprintf:
  test-path-utils: use xsnprintf in favor of strcpy

8 years agoMerge branch 'da/user-useconfigonly'
Junio C Hamano [Wed, 17 Feb 2016 18:13:31 +0000 (10:13 -0800)] 
Merge branch 'da/user-useconfigonly'

The "user.useConfigOnly" configuration variable can be used to
force the user to always set user.email & user.name configuration
variables, serving as a reminder for those who work on multiple
projects and do not want to put these in their $HOME/.gitconfig.

* da/user-useconfigonly:
  ident: add user.useConfigOnly boolean for when ident shouldn't be guessed
  fmt_ident: refactor strictness checks

8 years agoMerge branch 'nd/clear-gitenv-upon-use-of-alias'
Junio C Hamano [Wed, 17 Feb 2016 18:13:31 +0000 (10:13 -0800)] 
Merge branch 'nd/clear-gitenv-upon-use-of-alias'

The automatic typo correction applied to an alias was broken
with a recent change already in 'master'.

* nd/clear-gitenv-upon-use-of-alias:
  restore_env(): free the saved environment variable once we are done
  git: simplify environment save/restore logic
  git: protect against unbalanced calls to {save,restore}_env()
  git: remove an early return from save_env_before_alias()

8 years agoMerge branch 'mg/mingw-test-fix'
Junio C Hamano [Wed, 17 Feb 2016 18:13:29 +0000 (10:13 -0800)] 
Merge branch 'mg/mingw-test-fix'

An earlier adjustment of test mistakenly used write_script
to prepare a file whose exact content matters for the test;
reverting that part fixes the breakage for those who use
SHELL_PATH that is different from /bin/sh.

* mg/mingw-test-fix:
  t9100: fix breakage when SHELL_PATH is not /bin/sh

8 years agoMerge branch 'js/mingw-tests'
Junio C Hamano [Wed, 17 Feb 2016 18:13:28 +0000 (10:13 -0800)] 
Merge branch 'js/mingw-tests'

Test scripts have been updated to remove assumptions that are not
portable between Git for POSIX and Git for Windows, or to skip ones
with expectations that are not satisfiable on Git for Windows.

* js/mingw-tests: (21 commits)
  gitignore: ignore generated test-fake-ssh executable
  mingw: do not bother to test funny file names
  mingw: skip a test in t9130 that cannot pass on Windows
  mingw: handle the missing POSIXPERM prereq in t9124
  mingw: avoid illegal filename in t9118
  mingw: mark t9100's test cases with appropriate prereqs
  t0008: avoid absolute path
  mingw: work around pwd issues in the tests
  mingw: fix t9700's assumption about directory separators
  mingw: skip test in t1508 that fails due to path conversion
  tests: turn off git-daemon tests if FIFOs are not available
  mingw: disable mkfifo-based tests
  mingw: accomodate t0060-path-utils for MSYS2
  mingw: fix t5601-clone.sh
  mingw: let lstat() fail with errno == ENOTDIR when appropriate
  mingw: try to delete target directory before renaming
  mingw: prepare the TMPDIR environment variable for shell scripts
  mingw: factor out Windows specific environment setup
  Git.pm: stop assuming that absolute paths start with a slash
  mingw: do not trust MSYS2's MinGW gettext.sh
  ...

8 years agoMerge branch 'jk/drop-rsync-transport'
Junio C Hamano [Wed, 17 Feb 2016 18:13:28 +0000 (10:13 -0800)] 
Merge branch 'jk/drop-rsync-transport'

It turns out "git clone" over rsync transport has been broken when
the source repository has packed references for a long time, and
nobody noticed nor complained about it.

* jk/drop-rsync-transport:
  transport: drop support for git-over-rsync

8 years agoStart preparing for 2.7.2
Junio C Hamano [Wed, 17 Feb 2016 18:05:44 +0000 (10:05 -0800)] 
Start preparing for 2.7.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'js/test-lib-windows-emulated-yes' into maint
Junio C Hamano [Wed, 17 Feb 2016 18:03:41 +0000 (10:03 -0800)] 
Merge branch 'js/test-lib-windows-emulated-yes' into maint

The emulated "yes" command used in our test scripts has been
tweaked not to spend too much time generating unnecessary output
that is not used, to help those who test on Windows where it would
not stop until it fills the pipe buffer due to lack of SIGPIPE.

* js/test-lib-windows-emulated-yes:
  test-lib: limit the output of the yes utility

8 years agoMerge branch 'aw/push-force-with-lease-reporting' into maint
Junio C Hamano [Wed, 17 Feb 2016 18:03:40 +0000 (10:03 -0800)] 
Merge branch 'aw/push-force-with-lease-reporting' into maint

"git push --force-with-lease" has been taught to report if the push
needed to force (or fast-forwarded).

* aw/push-force-with-lease-reporting:
  push: fix ref status reporting for --force-with-lease

8 years agoMerge branch 'nd/do-not-move-worktree-manually' into maint
Junio C Hamano [Wed, 17 Feb 2016 18:03:40 +0000 (10:03 -0800)] 
Merge branch 'nd/do-not-move-worktree-manually' into maint

"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

8 years agoMerge branch 'js/xmerge-marker-eol' into maint
Junio C Hamano [Wed, 17 Feb 2016 18:03:39 +0000 (10:03 -0800)] 
Merge branch 'js/xmerge-marker-eol' into maint

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

8 years agogit-cvsserver.perl: fix typo
GyuYong Jung [Wed, 17 Feb 2016 02:14:58 +0000 (11:14 +0900)] 
git-cvsserver.perl: fix typo

Signed-off-by: GyuYong Jung <obliviscence@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agomergetool: reorder vim/gvim buffers in three-way diffs
Dickson Wong [Fri, 29 Jan 2016 02:18:14 +0000 (18:18 -0800)] 
mergetool: reorder vim/gvim buffers in three-way diffs

When invoking default (g)vimdiff three-way merge, the merged file is
loaded as the first buffer but moved to the bottom as the fourth window.
This causes a disconnect between vim commands that operate on window
positions (e.g. CTRL-W_w) and those that operate on buffer index (e.g.
do/dp).

This change reorders the buffers to have the same index as windows while
keeping the cursor default to the merged result as the bottom window.

Signed-off-by: Dickson Wong <dicksonwong@gmail.com>
Tested-by: Michael J Gruber <git@drmicha.warpmail.net>
Acked-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoSixth batch for the 2.8 cycle
Junio C Hamano [Wed, 10 Feb 2016 22:24:14 +0000 (14:24 -0800)] 
Sixth batch for the 2.8 cycle

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'js/test-lib-windows-emulated-yes'
Junio C Hamano [Wed, 10 Feb 2016 22:20:10 +0000 (14:20 -0800)] 
Merge branch 'js/test-lib-windows-emulated-yes'

The emulated "yes" command used in our test scripts has been
tweaked not to spend too much time generating unnecessary output
that is not used, to help those who test on Windows where it would
not stop until it fills the pipe buffer due to lack of SIGPIPE.

* js/test-lib-windows-emulated-yes:
  test-lib: limit the output of the yes utility

8 years agoMerge branch 'wp/sha1-name-negative-match'
Junio C Hamano [Wed, 10 Feb 2016 22:20:10 +0000 (14:20 -0800)] 
Merge branch 'wp/sha1-name-negative-match'

A new "<branch>^{/!-<pattern>}" notation can be used to name a
commit that is reachable from <branch> that does not match the
given <pattern>.

* wp/sha1-name-negative-match:
  object name: introduce '^{/!-<negative pattern>}' notation
  test for '!' handling in rev-parse's named commits

8 years agoMerge branch 'jk/options-cleanup'
Junio C Hamano [Wed, 10 Feb 2016 22:20:08 +0000 (14:20 -0800)] 
Merge branch 'jk/options-cleanup'

Various clean-ups to the command line option parsing.

* jk/options-cleanup:
  apply, ls-files: simplify "-z" parsing
  checkout-index: disallow "--no-stage" option
  checkout-index: handle "--no-index" option
  checkout-index: handle "--no-prefix" option
  checkout-index: simplify "-z" option parsing
  give "nbuf" strbuf a more meaningful name

8 years agoMerge branch 'aw/push-force-with-lease-reporting'
Junio C Hamano [Wed, 10 Feb 2016 22:20:08 +0000 (14:20 -0800)] 
Merge branch 'aw/push-force-with-lease-reporting'

"git push --force-with-lease" has been taught to report if the push
needed to force (or fast-forwarded).

* aw/push-force-with-lease-reporting:
  push: fix ref status reporting for --force-with-lease

8 years agoMerge branch 'ls/clean-smudge-override-in-config'
Junio C Hamano [Wed, 10 Feb 2016 22:20:07 +0000 (14:20 -0800)] 
Merge branch 'ls/clean-smudge-override-in-config'

Clean/smudge filters defined in a configuration file of lower
precedence can now be overridden to be a pass-through no-op by
setting the variable to an empty string.

* ls/clean-smudge-override-in-config:
  convert: treat an empty string for clean/smudge filters as "cat"

8 years agoMerge branch 'ew/connect-verbose'
Junio C Hamano [Wed, 10 Feb 2016 22:20:07 +0000 (14:20 -0800)] 
Merge branch 'ew/connect-verbose'

There were a few "now I am doing this thing" progress messages in
the TCP connection code that can be triggered by setting a verbose
option internally in the code, but "git fetch -v" and friends never
passed the verbose option down to that codepath.

There was a brief discussion about the impact on the end-user
experience by not limiting this to "fetch -v -v", but I think the
conclusion is that this is OK to enable with a single "-v" as it is
not too noisy.

* ew/connect-verbose:
  pass transport verbosity down to git_connect

8 years agoMerge 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

8 years agoMerge 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

8 years agoMerge 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

8 years agoDocumentation/git-clean.txt: don't mention deletion of .git/modules/*
Matt McCutchen [Sat, 6 Feb 2016 20:25:41 +0000 (15:25 -0500)] 
Documentation/git-clean.txt: don't mention deletion of .git/modules/*

The latter half of this sentence, the removal of the submodules, was
never done with (or without) double -f back when it was written, and
we still do not do so.

Signed-off-by: Matt McCutchen <matt@mattmccutchen.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agorerere: replace strcpy with xsnprintf
Jeff King [Mon, 8 Feb 2016 22:25:01 +0000 (17:25 -0500)] 
rerere: replace strcpy with xsnprintf

This shouldn't overflow, as we are copying a sha1 hex into a
41-byte buffer. But it does not hurt to use a bound-checking
function, which protects us and makes auditing for overflows
easier.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agot9100: fix breakage when SHELL_PATH is not /bin/sh
Michael J Gruber [Sun, 7 Feb 2016 19:11:37 +0000 (20:11 +0100)] 
t9100: fix breakage when SHELL_PATH is not /bin/sh

bcb11f1 (mingw: mark t9100's test cases with appropriate prereqs, 2016-01-27)
replaced "/bin/sh" in exec.sh by the shell specified in SHELL_PATH, but
that breaks the subtest which checks for a specific checksum of a tree
containing.

Revert that change that was not explained in the commit message anyways
(exec.sh is never executed).

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agotest-path-utils: use xsnprintf in favor of strcpy
Jeff King [Mon, 8 Feb 2016 22:21:55 +0000 (17:21 -0500)] 
test-path-utils: use xsnprintf in favor of strcpy

This strcpy will never overflow because it's copying from
baked-in test data. But we would prefer to avoid strcpy
entirely, as it makes it harder to audit for real security
bugs.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agogitignore: ignore generated test-fake-ssh executable
Johannes Schindelin [Sat, 6 Feb 2016 14:42:49 +0000 (15:42 +0100)] 
gitignore: ignore generated test-fake-ssh executable

In "mingw: fix t5601-clone.sh", this developer introduced a new test
executable, test-fake-ssh but forgot to update the .gitignore file
accordingly. Fix that.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoident: add user.useConfigOnly boolean for when ident shouldn't be guessed
Dan Aloni [Sat, 6 Feb 2016 06:23:36 +0000 (08:23 +0200)] 
ident: add user.useConfigOnly boolean for when ident shouldn't be guessed

It used to be that:

   git config --global user.email "(none)"

was a viable way for people to force themselves to set user.email in
each repository.  This was helpful for people with more than one
email address, targeting different email addresses for different
clones, as it barred git from creating a commit unless the user.email
config was set in the per-repo config to the correct email address.

A recent change, 19ce497c (ident: keep a flag for bogus
default_email, 2015-12-10), however, declared that an explicitly
configured user.email is not bogus, no matter what its value is, so
this hack no longer works.

Provide the same functionality by adding a new configuration
variable user.useConfigOnly; when this variable is set, the
user must explicitly set user.email configuration.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Dan Aloni <alonid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoSync with 2.7.1
Junio C Hamano [Fri, 5 Feb 2016 23:24:02 +0000 (15:24 -0800)] 
Sync with 2.7.1

8 years agoGit 2.7.1 v2.7.1
Junio 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>
8 years agoMerge branch 'lv/add-doc-working-tree' into maint
Junio 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

8 years agoMerge branch 'ss/clone-depth-single-doc' into maint
Junio 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

8 years agoMerge branch 'sg/t6050-failing-editor-test-fix' into maint
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

8 years agoMerge branch 'ew/for-each-ref-doc' into maint
Junio 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

8 years agoMerge branch 'ss/user-manual' into maint
Junio 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

8 years agoMerge branch 'jk/ref-cache-non-repository-optim' into maint
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

8 years agoMerge branch 'js/dirname-basename' into maint
Junio 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

8 years agoMerge branch 'tb/complete-word-diff-regex' into maint
Junio 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="

8 years agoMerge branch 'pw/completion-stash' into maint
Junio 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

8 years agoMerge branch 'pw/completion-show-branch' into maint
Junio 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"

8 years agoMerge branch 'jk/completion-rebase' into maint
Junio 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

8 years agoMerge branch 'nd/diff-with-path-params' into maint
Junio 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

8 years agoMerge branch 'dw/subtree-split-do-not-drop-merge' into maint
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

8 years agoMerge branch 'ew/svn-1.9.0-auth' into maint
Junio 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+

8 years agoMerge branch 'jk/list-tag-2.7-regression' into maint
Junio 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

8 years agoMerge branch 'jk/sanity' into maint
Junio 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

8 years agoMerge branch 'jk/filter-branch-no-index' into maint
Junio 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

8 years agoMerge branch 'js/close-packs-before-gc' into maint
Junio 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

8 years agoMerge branch 'jk/ok-to-fail-gc-auto-in-rebase' into maint
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"

8 years agoMerge branch 'ho/gitweb-squelch-undef-warning' into maint
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

8 years agoMerge branch 'js/fopen-harder' into maint
Junio 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

8 years agoMerge branch 'nd/exclusion-regression-fix' into maint
Junio 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"

8 years agoMerge branch 'dk/reflog-walk-with-non-commit' into maint
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

8 years agoMerge branch 'dw/signoff-doc' into maint
Junio 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

8 years agoMerge branch 'jk/clang-pedantic' into maint
Junio 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

8 years agoMerge branch 'ew/send-email-mutt-alias-fix' into maint
Junio 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

8 years agoMerge branch 'nd/dir-exclude-cleanup' into maint
Junio 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()

8 years agoMerge branch 'nd/stop-setenv-work-tree' into maint
Junio 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"

8 years agofmt_ident: refactor strictness checks
Jeff King [Thu, 4 Feb 2016 09:12:38 +0000 (11:12 +0200)] 
fmt_ident: refactor strictness checks

This function has evolved quite a bit over time, and as a
result, the logic for "is this an OK ident" has been
sprinkled throughout. This ends up with a lot of redundant
conditionals, like checking want_name repeatedly. Worse,
we want to know in many cases whether we are using the
"default" ident, and we do so by comparing directly to the
global strbuf, which violates the abstraction of the
ident_default_* functions.

Let's reorganize the function into a hierarchy of
conditionals to handle similar cases together. The only
case that doesn't just work naturally for this is that of an
empty name, where our advice is different based on whether
we came from ident_default_name() or not. We can use a
simple flag to cover this case.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoFifth batch for 2.8 cycle
Junio 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>
8 years agoMerge 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

8 years agoMerge 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

8 years agoMerge 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

8 years agoMerge 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

8 years agoMerge 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

8 years agoMerge 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

8 years agoMerge 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"

8 years agoMerge 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

8 years agoMerge 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

8 years agoMerge 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

8 years agoMerge 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

8 years agoMerge 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="

8 years agoMerge 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

8 years agoMerge 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

8 years agoMerge 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

8 years agoMerge 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

8 years agoMerge 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

8 years agoMerge 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()

8 years agorestore_env(): free the saved environment variable once we are done
Junio C Hamano [Tue, 2 Feb 2016 23:42:59 +0000 (15:42 -0800)] 
restore_env(): free the saved environment variable once we are done

Just like we free orig_cwd, which is the value of the original
working directory saved in save_env_before_alias(), once we are
done with it, the contents of orig_env[] array, saved in the
save_env_before_alias() function should be freed; otherwise,
the second and subsequent calls to save/restore pair will leak
the memory allocated in save_env_before_alias().

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agotest-lib: limit the output of the yes utility
Johannes Schindelin [Tue, 2 Feb 2016 18:15:53 +0000 (19:15 +0100)] 
test-lib: limit the output of the yes utility

On Windows, there is no SIGPIPE. A consequence of this is that the
upstream process of a pipe does not notice the death of the downstream
process until the pipe buffer is full and writing more data returns an
error. This behavior is the reason for an annoying delay during the
execution of t7610-mergetool.sh: There are a number of test cases where
'yes' is invoked upstream. Since the utility is basically an endless
loop it runs, on Windows, until the pipe buffer is full. This does take
a few seconds.

The test suite has its own implementation of 'yes'. Modify it to produce
only a limited amount of output that is sufficient for the test suite.
The amount chosen should be sufficiently high for any test case, assuming
that future test cases will not exaggerate their demands of input from
an upstream 'yes' invocation.

[j6t: commit message]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoGetting closer to 2.7.1
Junio 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>
8 years agoMerge 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

8 years agoMerge 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+

8 years agopush: fix ref status reporting for --force-with-lease
Andrew Wheeler [Fri, 29 Jan 2016 23:18:42 +0000 (17:18 -0600)] 
push: fix ref status reporting for --force-with-lease

The --force--with-lease push option leads to less
detailed status information than --force. In particular,
the output indicates that a reference was fast-forwarded,
even when it was force-updated.

Modify the --force-with-lease ref status logic to leverage
the --force ref status logic when the "lease" conditions
are met.

Also, enhance tests to validate output status reporting.

Signed-off-by: Andrew Wheeler <awheeler@motorola.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoapply, ls-files: simplify "-z" parsing
Jeff King [Sun, 31 Jan 2016 11:35:46 +0000 (06:35 -0500)] 
apply, ls-files: simplify "-z" parsing

As a short option, we cannot handle negation. Thus a callback
handling "unset" is overkill, and we can just use OPT_SET_INT
instead to handle setting the option.

Anybody who adds "--nul" synonym to this later would need to be
careful not to break "--no-nul", which should mean that lines are
terminated with LF at the end.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agocheckout-index: disallow "--no-stage" option
Jeff King [Mon, 1 Feb 2016 03:18:24 +0000 (22:18 -0500)] 
checkout-index: disallow "--no-stage" option

We do not really expect people to use "--no-stage", but if
they do, git currently segfaults. We could instead have it
undo the effects of a previous "--stage", but this gets
tricky around the "to_tempfile" flag. We cannot simply reset
it to 0, because we don't know if it was set by a previous
"--stage=all" or an explicit "--temp" option.

We could solve this by setting a flag and resolving
to_tempfile later, but it's not worth the effort. Nobody
actually wants to use "--no-stage"; we are just trying to
fix a potential segfault here.

While we're in the area, let's improve the user-facing
messages for this option. The error string should be
translatable, and we should give some hint in the "-h"
output about what can go in the argument field.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agocheckout-index: handle "--no-index" option
Jeff King [Sun, 31 Jan 2016 11:29:36 +0000 (06:29 -0500)] 
checkout-index: handle "--no-index" option

The parsing of "--index" is done in a callback, but it does
not handle an "unset" option. We don't necessarily expect
anyone to use this, but the current behavior is to treat it
exactly like "--index", which would probably be surprising.

Instead, let's just turn it into an OPT_BOOL, and handle it
after we're done parsing. This makes "--no-index" just work
(it cancels a previous "--index").

As a bonus, this makes the logic easier to follow. The old
code opened the index during the option parsing, leaving the
reader to wonder if there was some timing issue (there
isn't; none of the other options care that we've opened it).
And then if we found that "--prefix" had been given, we had
to rollback the index. Now we can simply avoid opening it in
the first place.

Note that it might make more sense for checkout-index to
complain when "--index --prefix=foo" is given (rather than
silently ignoring "--index"), but since it has been that way
since 415e96c ([PATCH] Implement git-checkout-cache -u to
update stat information in the cache., 2005-05-15), it's
safer to leave it as-is.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agocheckout-index: handle "--no-prefix" option
Jeff King [Sun, 31 Jan 2016 11:26:16 +0000 (06:26 -0500)] 
checkout-index: handle "--no-prefix" option

We use a custom callback to parse "--prefix", but it does
not handle the "unset" case. As a result, passing
"--no-prefix" will cause a segfault.

We can fix this by switching it to an OPT_STRING, which
makes "--no-prefix" counteract a previous "--prefix". Note
that this assigns NULL, so we bump our default-case
initialization to lower in the main function.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agocheckout-index: simplify "-z" option parsing
Jeff King [Sun, 31 Jan 2016 11:25:43 +0000 (06:25 -0500)] 
checkout-index: simplify "-z" option parsing

Now that we act as a simple bool, there's no need to use a
custom callback.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agogive "nbuf" strbuf a more meaningful name
Jeff King [Sun, 31 Jan 2016 11:25:26 +0000 (06:25 -0500)] 
give "nbuf" strbuf a more meaningful name

It's a common pattern in our code to read paths from stdin,
separated either by newlines or NULs, and unquote as
necessary. In each of these five cases we use "nbuf" to
temporarily store the unquoted value. Let's give it the more
meaningful name "unquoted", which makes it easier to
understand the purpose of the variable.

While we're at it, let's also static-initialize all of our
strbufs. It's not wrong to call strbuf_init, but it
increases the cognitive load on the reader, who might wonder
"do we sometimes avoid initializing them?  why?".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoobject name: introduce '^{/!-<negative pattern>}' notation
Will Palmer [Sun, 31 Jan 2016 00:06:01 +0000 (17:06 -0700)] 
object name: introduce '^{/!-<negative pattern>}' notation

To name a commit, you can now use the :/!-<negative pattern> regex
style, and consequentially, say

    $ git rev-parse HEAD^{/!-foo}

and it will return the hash of the first commit reachable from HEAD,
whose commit message does not contain "foo". This is the opposite of the
existing <rev>^{/<pattern>} syntax.

The specific use-case this is intended for is to perform an operation,
excluding the most-recent commits containing a particular marker. For
example, if you tend to make "work in progress" commits, with messages
beginning with "WIP", you work, then it could be useful to diff against
"the most recent commit which was not a WIP commit". That sort of thing
now possible, via commands such as:

    $ git diff @^{/!-^WIP}

The leader '/!-', rather than simply '/!', to denote a negative match,
is chosen to leave room for additional modifiers in the future.

Signed-off-by: Will Palmer <wmpalmer@gmail.com>
Signed-off-by: Stephen P. Smith <ischis2@cox.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agotransport: drop support for git-over-rsync
Jeff King [Sat, 30 Jan 2016 07:21:26 +0000 (02:21 -0500)] 
transport: drop support for git-over-rsync

The git-over-rsync protocol is inefficient and broken, and
has been for a long time. It transfers way more objects than
it needs (grabbing all of the remote's "objects/",
regardless of which objects we need). It does its own ad-hoc
parsing of loose and packed refs from the remote, but
doesn't properly override packed refs with loose ones,
leading to garbage results (e.g., expecting the other side
to have an object pointed to by a stale packed-refs entry,
or complaining that the other side has two copies of the
refs[1]).

This latter breakage means that nobody could have
successfully pulled from a moderately active repository
since cd547b4 (fetch/push: readd rsync support, 2007-10-01).

We never made an official deprecation notice in the release
notes for git's rsync protocol, but the tutorial has marked
it as such since 914328a (Update tutorial., 2005-08-30).
And on the mailing list as far back as Oct 2005, we can find
Junio mentioning it as having "been deprecated for quite
some time."[2,3,4]. So it was old news then; cogito had
deprecated the transport in July of 2005[5] (though it did
come back briefly when Linus broke git-http-pull!).

Of course some people professed their love of rsync through
2006, but Linus clarified in his usual gentle manner[6]:

  > Thanks!  This is why I still use rsync, even though
  > everybody and their mother tells me "Linus says rsync is
  > deprecated."

  No. You're using rsync because you're actively doing
  something _wrong_.

The deprecation sentiment was reinforced in 2008, with a
mention that cloning via rsync is broken (with no fix)[7].

Even the commit porting rsync over to C from shell (cd547b4)
lists it as deprecated! So between the 10 years of informal
warnings, and the fact that it has been severely broken
since 2007, it's probably safe to simply remove it without
further deprecation warnings.

[1] http://article.gmane.org/gmane.comp.version-control.git/285101
[2] http://article.gmane.org/gmane.comp.version-control.git/10093
[3] http://article.gmane.org/gmane.comp.version-control.git/17734
[4] http://article.gmane.org/gmane.comp.version-control.git/18911
[5] http://article.gmane.org/gmane.comp.version-control.git/5617
[6] http://article.gmane.org/gmane.comp.version-control.git/19354
[7] http://article.gmane.org/gmane.comp.version-control.git/103635

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agostripspace: call U+0020 a "space" instead of a "blank"
Alex Henrie [Fri, 29 Jan 2016 03:10:56 +0000 (20:10 -0700)] 
stripspace: call U+0020 a "space" instead of a "blank"

I couldn't find any other examples of people referring to this
character as a "blank".

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>