git
9 years agoMerge branch 'sb/t1020-cleanup' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:14 +0000 (12:00 -0700)] 
Merge branch 'sb/t1020-cleanup' into maint

There was a commented-out (instead of being marked to expect
failure) test that documented a breakage that was fixed since the
test was written; turn it into a proper test.

* sb/t1020-cleanup:
  subdirectory tests: code cleanup, uncomment test

9 years agoMerge branch 'jc/gitignore-precedence' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:12 +0000 (12:00 -0700)] 
Merge branch 'jc/gitignore-precedence' into maint

core.excludesfile (defaulting to $XDG_HOME/git/ignore) is supposed
to be overridden by repository-specific .git/info/exclude file, but
the order was swapped from the beginning. This belatedly fixes it.

* jc/gitignore-precedence:
  ignore: info/exclude should trump core.excludesfile

9 years agoMerge branch 'bc/connect-plink' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:11 +0000 (12:00 -0700)] 
Merge branch 'bc/connect-plink' into maint

The connection initiation code for "ssh" transport tried to absorb
differences between the stock "ssh" and Putty-supplied "plink" and
its derivatives, but the logic to tell that we are using "plink"
variants were too loose and falsely triggered when "plink" appeared
anywhere in the path (e.g. "/home/me/bin/uplink/ssh").

* bc/connect-plink:
  connect: improve check for plink to reduce false positives
  t5601: fix quotation error leading to skipped tests
  connect: simplify SSH connection code path

9 years agoMerge branch 'ph/rebase-i-redo' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:10 +0000 (12:00 -0700)] 
Merge branch 'ph/rebase-i-redo' into maint

"git rebase -i" moved the "current" command from "todo" to "done" a
bit too prematurely, losing a step when a "pick" did not even start.

* ph/rebase-i-redo:
  rebase -i: redo tasks that die during cherry-pick

9 years agoMerge branch 'jk/add-e-kill-editor' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:09 +0000 (12:00 -0700)] 
Merge branch 'jk/add-e-kill-editor' into maint

"git add -e" did not allow the user to abort the operation by
killing the editor.

* jk/add-e-kill-editor:
  add: check return value of launch_editor

9 years agoMerge branch 'mh/clone-verbosity-fix' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:08 +0000 (12:00 -0700)] 
Merge branch 'mh/clone-verbosity-fix' into maint

Git 2.4 broke setting verbosity and progress levels on "git clone"
with native transports.

* mh/clone-verbosity-fix:
  clone: call transport_set_verbosity before anything else on the newly created transport

9 years agoMerge branch 'jk/sha1-file-reduce-useless-warnings' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:07 +0000 (12:00 -0700)] 
Merge branch 'jk/sha1-file-reduce-useless-warnings' into maint

* jk/sha1-file-reduce-useless-warnings:
  sha1_file: squelch "packfile cannot be accessed" warnings

9 years agoMerge branch 'tb/blame-resurrect-convert-to-git' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:06 +0000 (12:00 -0700)] 
Merge branch 'tb/blame-resurrect-convert-to-git' into maint

Some time ago, "git blame" (incorrectly) lost the convert_to_git()
call when synthesizing a fake "tip" commit that represents the
state in the working tree, which broke folks who record the history
with LF line ending to make their project portabile across
platforms while terminating lines in their working tree files with
CRLF for their platform.

* tb/blame-resurrect-convert-to-git:
  blame: CRLF in the working tree and LF in the repo

9 years agoMerge branch 'jc/plug-fmt-merge-msg-leak' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:05 +0000 (12:00 -0700)] 
Merge branch 'jc/plug-fmt-merge-msg-leak' into maint

* jc/plug-fmt-merge-msg-leak:
  fmt-merge-msg: plug small leak of commit buffer

9 years agoMerge branch 'pt/xdg-config-path' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:03 +0000 (12:00 -0700)] 
Merge branch 'pt/xdg-config-path' into maint

Code clean-up for xdg configuration path support.

* pt/xdg-config-path:
  path.c: remove home_config_paths()
  git-config: replace use of home_config_paths()
  git-commit: replace use of home_config_paths()
  credential-store.c: replace home_config_paths() with xdg_config_home()
  dir.c: replace home_config_paths() with xdg_config_home()
  attr.c: replace home_config_paths() with xdg_config_home()
  path.c: implement xdg_config_home()
  t0302: "unreadable" test needs POSIXPERM
  t0302: test credential-store support for XDG_CONFIG_HOME
  git-credential-store: support XDG_CONFIG_HOME
  git-credential-store: support multiple credential files

9 years agoGit 2.4.2 v2.4.2
Junio C Hamano [Tue, 26 May 2015 20:49:59 +0000 (13:49 -0700)] 
Git 2.4.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'jk/still-interesting' into maint
Junio C Hamano [Tue, 26 May 2015 20:49:26 +0000 (13:49 -0700)] 
Merge branch 'jk/still-interesting' into maint

"git rev-list --objects $old --not --all" to see if everything that
is reachable from $old is already connected to the existing refs
was very inefficient.

* jk/still-interesting:
  limit_list: avoid quadratic behavior from still_interesting

9 years agoMerge branch 'jc/hash-object' into maint
Junio C Hamano [Tue, 26 May 2015 20:49:24 +0000 (13:49 -0700)] 
Merge branch 'jc/hash-object' into maint

"hash-object --literally" introduced in v2.2 was not prepared to
take a really long object type name.

* jc/hash-object:
  write_sha1_file(): do not use a separate sha1[] array
  t1007: add hash-object --literally tests
  hash-object --literally: fix buffer overrun with extra-long object type
  git-hash-object.txt: document --literally option

9 years agoMerge branch 'jk/rebase-quiet-noop' into maint
Junio C Hamano [Tue, 26 May 2015 20:49:23 +0000 (13:49 -0700)] 
Merge branch 'jk/rebase-quiet-noop' into maint

"git rebase --quiet" was not quite quiet when there is nothing to
do.

* jk/rebase-quiet-noop:
  rebase: silence "git checkout" for noop rebase

9 years agoMerge branch 'sg/complete-decorate-full-not-long' into maint
Junio C Hamano [Tue, 26 May 2015 20:49:22 +0000 (13:49 -0700)] 
Merge branch 'sg/complete-decorate-full-not-long' into maint

The completion for "log --decorate=" parameter value was incorrect.

* sg/complete-decorate-full-not-long:
  completion: fix and update 'git log --decorate=' options

9 years agoMerge branch 'jk/filter-branch-use-of-sed-on-incomplete-line' into maint
Junio C Hamano [Tue, 26 May 2015 20:49:20 +0000 (13:49 -0700)] 
Merge branch 'jk/filter-branch-use-of-sed-on-incomplete-line' into maint

"filter-branch" corrupted commit log message that ends with an
incomplete line on platforms with some "sed" implementations that
munge such a line.  Work it around by avoiding to use "sed".

* jk/filter-branch-use-of-sed-on-incomplete-line:
  filter-branch: avoid passing commit message through sed

9 years agoMerge branch 'jc/daemon-no-ipv6-for-2.4.1' into maint
Junio C Hamano [Tue, 26 May 2015 20:49:19 +0000 (13:49 -0700)] 
Merge branch 'jc/daemon-no-ipv6-for-2.4.1' into maint

"git daemon" fails to build from the source under NO_IPV6
configuration (regression in 2.4).

* jc/daemon-no-ipv6-for-2.4.1:
  daemon: unbreak NO_IPV6 build regression

9 years agoMerge branch 'jk/stash-require-clean-index' into maint
Junio C Hamano [Tue, 26 May 2015 20:49:19 +0000 (13:49 -0700)] 
Merge branch 'jk/stash-require-clean-index' into maint

"git stash pop/apply" forgot to make sure that not just the working
tree is clean but also the index is clean. The latter is important
as a stash application can conflict and the index will be used for
conflict resolution.

* jk/stash-require-clean-index:
  stash: require a clean index to apply
  t3903: avoid applying onto dirty index
  t3903: stop hard-coding commit sha1s

9 years agoMerge branch 'jk/git-no-more-argv0-path-munging' into maint
Junio C Hamano [Tue, 26 May 2015 20:49:18 +0000 (13:49 -0700)] 
Merge branch 'jk/git-no-more-argv0-path-munging' into maint

We have prepended $GIT_EXEC_PATH and the path "git" is installed in
(typically "/usr/bin") to $PATH when invoking subprograms and hooks
for almost eternity, but the original use case the latter tried to
support was semi-bogus (i.e. install git to /opt/foo/git and run it
without having /opt/foo on $PATH), and more importantly it has
become less and less relevant as Git grew more mainstream (i.e. the
users would _want_ to have it on their $PATH).  Stop prepending the
path in which "git" is installed to users' $PATH, as that would
interfere the command search order people depend on (e.g. they may
not like versions of programs that are unrelated to Git in /usr/bin
and want to override them by having different ones in /usr/local/bin
and have the latter directory earlier in their $PATH).

* jk/git-no-more-argv0-path-munging:
  stop putting argv[0] dirname at front of PATH

9 years agoclone: call transport_set_verbosity before anything else on the newly created transport
Mike Hommey [Tue, 12 May 2015 04:30:16 +0000 (13:30 +0900)] 
clone: call transport_set_verbosity before anything else on the newly created transport

Commit 2879bc3 made the progress and verbosity options sent to remote helper
earlier than they previously were. But nothing else after that would send
updates if the value is changed later on with transport_set_verbosity.

While for fetch and push, transport_set_verbosity is the first thing that
is done after creating the transport, it was not the case for clone. So
commit 2879bc3 broke changing progress and verbosity for clone, for urls
requiring a remote helper only (so, not git:// urls, for instance).

Moving transport_set_verbosity to just after the transport is created
works around the issue.

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agosubdirectory tests: code cleanup, uncomment test
Stefan Beller [Mon, 18 May 2015 21:10:26 +0000 (14:10 -0700)] 
subdirectory tests: code cleanup, uncomment test

Back when these tests were written, we wanted to make sure that Git
notices it is in a bare repository and "git show -s HEAD" would
refrain from complaining that HEAD might mean a file it sees in its
current working directory (because it does not).  But the version of
Git back then didn't behave well, without (doubly) being told that
it is inside a bare repository by exporting "GIT_DIR=.".  The form
of the test we originally wanted to have was left commented out as
a reminder.

Nowadays the test as originally intended works, so add it to the
test suite.  We'll keep the old test that explicitly sets GIT_DIR=.
to make sure that use case will not regress.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoGit 2.4.1 v2.4.1
Junio C Hamano [Wed, 13 May 2015 21:11:43 +0000 (14:11 -0700)] 
Git 2.4.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'sb/line-log-plug-pairdiff-leak' into maint
Junio C Hamano [Wed, 13 May 2015 21:05:56 +0000 (14:05 -0700)] 
Merge branch 'sb/line-log-plug-pairdiff-leak' into maint

* sb/line-log-plug-pairdiff-leak:
  line-log.c: fix a memleak

9 years agoMerge branch 'sb/test-bitmap-free-at-end' into maint
Junio C Hamano [Wed, 13 May 2015 21:05:55 +0000 (14:05 -0700)] 
Merge branch 'sb/test-bitmap-free-at-end' into maint

* sb/test-bitmap-free-at-end:
  pack-bitmap.c: fix a memleak

9 years agoMerge branch 'nd/t1509-chroot-test' into maint
Junio C Hamano [Wed, 13 May 2015 21:05:55 +0000 (14:05 -0700)] 
Merge branch 'nd/t1509-chroot-test' into maint

Correct test bitrot.

* nd/t1509-chroot-test:
  t1509: update prepare script to be able to run t1509 in chroot again

9 years agoMerge branch 'jk/type-from-string-gently' into maint
Junio C Hamano [Wed, 13 May 2015 21:05:54 +0000 (14:05 -0700)] 
Merge branch 'jk/type-from-string-gently' into maint

"git cat-file bl $blob" failed to barf even though there is no
object type that is "bl".

* jk/type-from-string-gently:
  type_from_string_gently: make sure length matches

9 years agoMerge branch 'ep/fix-test-lib-functions-report' into maint
Junio C Hamano [Wed, 13 May 2015 21:05:52 +0000 (14:05 -0700)] 
Merge branch 'ep/fix-test-lib-functions-report' into maint

* ep/fix-test-lib-functions-report:
  test-lib-functions.sh: fix the second argument to some helper functions

9 years agoMerge branch 'cn/bom-in-gitignore' into maint
Junio C Hamano [Wed, 13 May 2015 21:05:51 +0000 (14:05 -0700)] 
Merge branch 'cn/bom-in-gitignore' into maint

Teach the codepaths that read .gitignore and .gitattributes files
that these files encoded in UTF-8 may have UTF-8 BOM marker at the
beginning; this makes it in line with what we do for configuration
files already.

* cn/bom-in-gitignore:
  attr: skip UTF8 BOM at the beginning of the input file
  config: use utf8_bom[] from utf.[ch] in git_parse_source()
  utf8-bom: introduce skip_utf8_bom() helper
  add_excludes_from_file: clarify the bom skipping logic
  dir: allow a BOM at the beginning of exclude files

9 years agoMerge branch 'jk/prune-mtime' into maint
Junio C Hamano [Wed, 13 May 2015 21:05:50 +0000 (14:05 -0700)] 
Merge branch 'jk/prune-mtime' into maint

Access to objects in repositories that borrow from another one on a
slow NFS server unnecessarily got more expensive due to recent code
becoming more cautious in a naive way not to lose objects to pruning.

* jk/prune-mtime:
  sha1_file: only freshen packs once per run
  sha1_file: freshen pack objects before loose
  reachable: only mark local objects as recent

9 years agoMerge branch 'jk/init-core-worktree-at-root' into maint
Junio C Hamano [Wed, 13 May 2015 21:05:49 +0000 (14:05 -0700)] 
Merge branch 'jk/init-core-worktree-at-root' into maint

We avoid setting core.worktree when the repository location is the
".git" directory directly at the top level of the working tree, but
the code misdetected the case in which the working tree is at the
root level of the filesystem (which arguably is a silly thing to
do, but still valid).

* jk/init-core-worktree-at-root:
  init: don't set core.worktree when initializing /.git

9 years agoadd: check return value of launch_editor
Jeff King [Wed, 13 May 2015 01:21:58 +0000 (21:21 -0400)] 
add: check return value of launch_editor

When running "add -e", if launching the editor fails, we do
not notice and continue as if the output is what the user
asked for. The likely case is that the editor did not touch
the contents at all, and we end up adding everything.

Reported-by: Russ Cox <rsc@golang.org>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoSync with 2.3.8
Junio C Hamano [Mon, 11 May 2015 21:39:28 +0000 (14:39 -0700)] 
Sync with 2.3.8

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoGit 2.3.8 v2.3.8
Junio C Hamano [Mon, 11 May 2015 21:36:31 +0000 (14:36 -0700)] 
Git 2.3.8

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'mm/usage-log-l-can-take-regex' into maint-2.3
Junio C Hamano [Mon, 11 May 2015 21:34:01 +0000 (14:34 -0700)] 
Merge branch 'mm/usage-log-l-can-take-regex' into maint-2.3

Documentation fix.

* mm/usage-log-l-can-take-regex:
  log -L: improve error message on malformed argument
  Documentation: change -L:<regex> to -L:<funcname>

9 years agoMerge branch 'jc/diff-no-index-d-f' into maint-2.3
Junio C Hamano [Mon, 11 May 2015 21:34:00 +0000 (14:34 -0700)] 
Merge branch 'jc/diff-no-index-d-f' into maint-2.3

The usual "git diff" when seeing a file turning into a directory
showed a patchset to remove the file and create all files in the
directory, but "git diff --no-index" simply refused to work.  Also,
when asked to compare a file and a directory, imitate POSIX "diff"
and compare the file with the file with the same name in the
directory, instead of refusing to run.

* jc/diff-no-index-d-f:
  diff-no-index: align D/F handling with that of normal Git
  diff-no-index: DWIM "diff D F" into "diff D/F F"

9 years agoMerge branch 'oh/fix-config-default-user-name-section' into maint-2.3
Junio C Hamano [Mon, 11 May 2015 21:33:59 +0000 (14:33 -0700)] 
Merge branch 'oh/fix-config-default-user-name-section' into maint-2.3

The default $HOME/.gitconfig file created upon "git config --global"
that edits it had incorrectly spelled user.name and user.email
entries in it.

* oh/fix-config-default-user-name-section:
  config: fix settings in default_user_config template

9 years agoMerge branch 'jc/epochtime-wo-tz' into maint-2.3
Junio C Hamano [Mon, 11 May 2015 21:33:58 +0000 (14:33 -0700)] 
Merge branch 'jc/epochtime-wo-tz' into maint-2.3

"git commit --date=now" or anything that relies on approxidate lost
the daylight-saving-time offset.

* jc/epochtime-wo-tz:
  parse_date_basic(): let the system handle DST conversion
  parse_date_basic(): return early when given a bogus timestamp

9 years agopath.c: remove home_config_paths()
Paul Tan [Wed, 6 May 2015 08:01:04 +0000 (16:01 +0800)] 
path.c: remove home_config_paths()

home_config_paths() combines distinct functionality already implemented
by expand_user_path() and xdg_config_home(), and it also hard-codes the
path ~/.gitconfig, which makes it unsuitable to use for other home
config file paths. Since its use will just add unnecessary complexity to
the code, remove it.

Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agogit-config: replace use of home_config_paths()
Paul Tan [Wed, 6 May 2015 08:01:03 +0000 (16:01 +0800)] 
git-config: replace use of home_config_paths()

Since home_config_paths() combines distinct functionality already
implemented by expand_user_path() and xdg_config_home(), and hides the
home config file path ~/.gitconfig. Make the code more explicit by
replacing the use of home_config_paths() with expand_user_path() and
xdg_config_home().

Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agogit-commit: replace use of home_config_paths()
Paul Tan [Wed, 6 May 2015 08:01:02 +0000 (16:01 +0800)] 
git-commit: replace use of home_config_paths()

Since home_config_paths() combines two distinct functionality already
implemented by expand_user_path() and xdg_config_home(), and hides the
home config file path ~/.gitconfig. Make the code more explicit by
replacing the use of home_config_paths() with expand_user_path() and
xdg_config_home().

Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agocredential-store.c: replace home_config_paths() with xdg_config_home()
Paul Tan [Wed, 6 May 2015 08:01:01 +0000 (16:01 +0800)] 
credential-store.c: replace home_config_paths() with xdg_config_home()

Since only the xdg credentials file path is required, and
home_config_paths() is unable to construct the path ~/.git-credentials,
simplify the code by replacing home_config_paths() with
xdg_config_home().

Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agodir.c: replace home_config_paths() with xdg_config_home()
Paul Tan [Wed, 6 May 2015 08:01:00 +0000 (16:01 +0800)] 
dir.c: replace home_config_paths() with xdg_config_home()

Since only the xdg excludes file path is required, simplify the code by
replacing use of home_config_paths() with xdg_config_home().

Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoattr.c: replace home_config_paths() with xdg_config_home()
Paul Tan [Wed, 6 May 2015 08:00:59 +0000 (16:00 +0800)] 
attr.c: replace home_config_paths() with xdg_config_home()

Since only the xdg attributes file path is required, simplify the code
by using xdg_config_home() instead of home_config_paths().

Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agopath.c: implement xdg_config_home()
Paul Tan [Tue, 21 Apr 2015 04:06:27 +0000 (12:06 +0800)] 
path.c: implement xdg_config_home()

The XDG base dir spec[1] specifies that configuration files be stored in
a subdirectory in $XDG_CONFIG_HOME. To construct such a configuration
file path, home_config_paths() can be used. However, home_config_paths()
combines distinct functionality:

1. Retrieve the home git config file path ~/.gitconfig

2. Construct the XDG config path of the file specified by `file`.

This function was introduced in commit 21cf3227 ("read (but not write)
from $XDG_CONFIG_HOME/git/config file").  While the intention of the
function was to allow the home directory configuration file path and the
xdg directory configuration file path to be retrieved with one function
call, the hard-coding of the path ~/.gitconfig prevents it from being
used for other configuration files. Furthermore, retrieving a file path
relative to the user's home directory can be done with
expand_user_path(). Hence, it can be seen that home_config_paths()
introduces unnecessary complexity, especially if a user just wants to
retrieve the xdg config file path.

As such, implement a simpler function xdg_config_home() for constructing
the XDG base dir spec configuration file path. This function, together
with expand_user_path(), can replace all uses of home_config_paths().

[1] http://standards.freedesktop.org/basedir-spec/basedir-spec-0.7.html

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agodaemon: unbreak NO_IPV6 build regression
Junio C Hamano [Tue, 5 May 2015 18:03:24 +0000 (11:03 -0700)] 
daemon: unbreak NO_IPV6 build regression

When 01cec54e (daemon: deglobalize hostname information, 2015-03-07)
wrapped the global variables such as hostname inside a struct, it
forgot to convert one location that spelled "hostname" that needs to
be updated to "hi->hostname".

This was inside NO_IPV6 block, and was not caught by anybody.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agowrite_sha1_file(): do not use a separate sha1[] array
Junio C Hamano [Mon, 4 May 2015 18:08:10 +0000 (11:08 -0700)] 
write_sha1_file(): do not use a separate sha1[] array

In the beginning, write_sha1_file() did not have a way to tell the
caller the name of the object it wrote to the caller.  This was
changed in d6d3f9d0 (This implements the new "recursive tree"
write-tree., 2005-04-09) by adding the "returnsha1" parameter to the
function so that the callers who are interested in the value can
optionally pass a pointer to receive it.

It turns out that all callers do want to know the name of the object
it just has written.  Nobody passes a NULL to this parameter, hence
it is not necessary to use a separate sha1[] array to receive the
result from  write_sha1_file_prepare(), and copy the result to the
returnsha1 supplied by the caller.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agot1007: add hash-object --literally tests
Eric Sunshine [Mon, 4 May 2015 07:25:14 +0000 (03:25 -0400)] 
t1007: add hash-object --literally tests

git-hash-object learned a --literally option in 5ba9a93
(hash-object: add --literally option, 2014-09-11). Check that
--literally allows object creation with a bogus type, with two
type strings whose length is reasonably short and very long.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agohash-object --literally: fix buffer overrun with extra-long object type
Eric Sunshine [Mon, 4 May 2015 07:25:15 +0000 (03:25 -0400)] 
hash-object --literally: fix buffer overrun with extra-long object type

"hash-object" learned in 5ba9a93 (hash-object: add --literally
option, 2014-09-11) to allow crafting a corrupt/broken object of
unknown type.

When the user-provided type is particularly long, however, it can
overflow the relatively small stack-based character array handed to
write_sha1_file_prepare() by hash_sha1_file() and write_sha1_file(),
leading to stack corruption (and crash).  Introduce a custom helper
to allow arbitrarily long typenames just for "hash-object --literally".

[jc: Eric's original used a strbuf in the more common codepaths, and
I rewrote it to avoid penalizing the non-literally code. Bugs are mine]

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agogit-hash-object.txt: document --literally option
Eric Sunshine [Mon, 4 May 2015 07:25:13 +0000 (03:25 -0400)] 
git-hash-object.txt: document --literally option

Document the git-hash-object --literally option added by 5ba9a93
(hash-object: add --literally option, 2014-09-11).

While here, also correct a minor typesetting oversight.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agocompletion: fix and update 'git log --decorate=' options
SZEDER Gábor [Fri, 1 May 2015 17:21:00 +0000 (19:21 +0200)] 
completion: fix and update 'git log --decorate=' options

'git log --decorate=' understands the 'full', 'short' and 'no' options.
From these the completion script only offered 'short' and it offered
'long' instead of 'full'.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoblame: CRLF in the working tree and LF in the repo
Torsten Bögershausen [Sun, 3 May 2015 16:38:01 +0000 (18:38 +0200)] 
blame: CRLF in the working tree and LF in the repo

A typical setup under Windows is to set core.eol to CRLF, and text
files are marked as "text" in .gitattributes, or core.autocrlf is
set to true.

After 4d4813a5 "git blame" no longer works as expected for such a
set-up.  Every line is annotated as "Not Committed Yet", even though
the working directory is clean.  This is because the commit removed
the conversion in blame.c for all files, with or without CRLF in the
repo.

Having files with CRLF in the repo and core.autocrlf=input is a
temporary situation, and the files, if committed as is, will be
normalized in the repo, which _will_ be a notable change.  Blaming
them with "Not Committed Yet" is the right result.  Revert commit
4d4813a5 which was a misguided attempt to "solve" a non-problem.

Add two test cases in t8003 to verify the correct CRLF conversion.

Suggested-By: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoGit 2.4 v2.4.0
Junio C Hamano [Thu, 30 Apr 2015 18:25:06 +0000 (11:25 -0700)] 
Git 2.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agofilter-branch: avoid passing commit message through sed
Jeff King [Wed, 29 Apr 2015 15:48:58 +0000 (11:48 -0400)] 
filter-branch: avoid passing commit message through sed

On some systems (like OS X), if sed encounters input without
a trailing newline, it will silently add it. As a result,
"git filter-branch" on such systems may silently rewrite
commit messages that omit a trailing newline. Even though
this is not something we generate ourselves with "git
commit", it's better for filter-branch to preserve the
original data as closely as possible.

We're using sed here only to strip the header fields from
the commit object. We can accomplish the same thing with a
shell loop. Since shell "read" calls are slow (usually one
syscall per byte), we use "cat" once we've skipped past the
header. Depending on the size of your commit messages, this
is probably faster (you pay the cost to fork, but then read
the data in saner-sized chunks). This idea is shamelessly
stolen from Junio.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agorebase -i: redo tasks that die during cherry-pick
Phil Hord [Tue, 28 Apr 2015 22:55:20 +0000 (18:55 -0400)] 
rebase -i: redo tasks that die during cherry-pick

When rebase--interactive processes a task, it removes the item from
the todo list and appends it to another list of executed tasks. If a
pick (this includes squash and fixup) fails before the index has
recorded the changes, take the corresponding item and put it on the todo
list again. Otherwise, the changes introduced by the scheduled commit
would be lost.

That kind of decision is possible since the cherry-pick command
signals why it failed to apply the changes of the given commit. Either
the changes are recorded in the index using a conflict (return value 1)
and rebase does not continue until they are resolved or the changes
are not recorded in the index (return value neither 0 nor 1) and
rebase has to try again with the same task.

Add a test cases for regression testing to the "rebase-interactive"
test suite.

Signed-off-by: Fabian Ruch <bafain@gmail.com>
Signed-off-by: Phil Hord <hordp@cisco.com>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoconnect: improve check for plink to reduce false positives
brian m. carlson [Sun, 26 Apr 2015 20:30:12 +0000 (20:30 +0000)] 
connect: improve check for plink to reduce false positives

The git_connect function has code to handle plink and tortoiseplink
specially, as they require different command line arguments from
OpenSSH (-P instead of -p for ports; tortoiseplink additionally requires
-batch).  However, the match was done by checking for "plink" anywhere
in the string, which led to a GIT_SSH value containing "uplink" being
treated as an invocation of putty's plink.

Improve the check by looking for "plink" or "tortoiseplink" (or those
names suffixed with ".exe") only in the final component of the path.
This has the downside that a program such as "plink-0.63" would no
longer be recognized, but the increased robustness is likely worth it.
Add tests to cover these cases to avoid regressions.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agot5601: fix quotation error leading to skipped tests
brian m. carlson [Sun, 26 Apr 2015 20:30:11 +0000 (20:30 +0000)] 
t5601: fix quotation error leading to skipped tests

One of the tests in t5601 used single quotes to delimit an argument
containing spaces.  However, this caused test_expect_success to be
passed three arguments instead of two, which in turn caused the test
name to be treated as a prerequisite instead of a test name.  As there
was no prerequisite called "bracketed hostnames are still ssh", the test
was always skipped.

Because this test was always skipped, the fact that it passed the
arguments in the wrong order was obscured.  Use double quotes inside the
test and reorder the arguments so that the test runs and properly
reflects the arguments that are passed to ssh.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoconnect: simplify SSH connection code path
brian m. carlson [Sun, 26 Apr 2015 20:30:10 +0000 (20:30 +0000)] 
connect: simplify SSH connection code path

The code path used in git_connect pushed the majority of the SSH
connection code into an else block, even though the if block returns.
Simplify the code by eliminating the else block, as it is unneeded.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'mh/multimail-renewal'
Junio C Hamano [Tue, 28 Apr 2015 20:01:29 +0000 (13:01 -0700)] 
Merge branch 'mh/multimail-renewal'

* mh/multimail-renewal:
  Update git-multimail to version 1.0.2

9 years agoMerge branch 'mg/show-notes-doc'
Junio C Hamano [Tue, 28 Apr 2015 20:00:20 +0000 (13:00 -0700)] 
Merge branch 'mg/show-notes-doc'

Documentation fix.

* mg/show-notes-doc:
  rev-list-options.txt: complete sentence about notes matching

9 years agoMerge branch 'nd/versioncmp-prereleases'
Junio C Hamano [Tue, 28 Apr 2015 20:00:19 +0000 (13:00 -0700)] 
Merge branch 'nd/versioncmp-prereleases'

* nd/versioncmp-prereleases:
  git tag: mention versionsort.prereleaseSuffix in manpage

9 years agoMerge branch 'mg/status-v-v'
Junio C Hamano [Tue, 28 Apr 2015 20:00:18 +0000 (13:00 -0700)] 
Merge branch 'mg/status-v-v'

* mg/status-v-v:
  status: document the -v/--verbose option

9 years agorebase: silence "git checkout" for noop rebase
Jeff King [Tue, 28 Apr 2015 05:17:37 +0000 (01:17 -0400)] 
rebase: silence "git checkout" for noop rebase

When the branch to be rebased is already up to date, we
"git checkout" the branch, print an "up to date" message,
and end the rebase early. However, our checkout may print
"Switched to branch 'foo'" or "Already on 'foo'", even if
the user has asked for "--quiet".

We should avoid printing these messages at all, "--quiet" or
no. Since the rebase is a noop, this checkout can be seen as
optimizing out these other two checkout operations (that
happen in a real rebase):

  1. Moving to the detached HEAD to start the rebase; we
     always feed "-q" to checkout there, and instead rely on
     our own custom message (which respects --quiet).

  2. Finishing a rebase, where we move to the final branch.
     Here we actually use update-ref rather than
     git-checkout, and produce no messages.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoUpdate git-multimail to version 1.0.2
Michael Haggerty [Mon, 27 Apr 2015 11:17:25 +0000 (13:17 +0200)] 
Update git-multimail to version 1.0.2

The only changes are to the README files, most notably the list of
maintainers and the project URL.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoSync with 2.3.7
Junio C Hamano [Mon, 27 Apr 2015 19:26:21 +0000 (12:26 -0700)] 
Sync with 2.3.7

9 years agoGit 2.3.7 v2.3.7
Junio C Hamano [Mon, 27 Apr 2015 19:25:36 +0000 (12:25 -0700)] 
Git 2.3.7

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'tb/connect-ipv6-parse-fix' into maint
Junio C Hamano [Mon, 27 Apr 2015 19:23:53 +0000 (12:23 -0700)] 
Merge branch 'tb/connect-ipv6-parse-fix' into maint

An earlier update to the parser that disects a URL broke an
address, followed by a colon, followed by an empty string (instead
of the port number), e.g. ssh://example.com:/path/to/repo.

* tb/connect-ipv6-parse-fix:
  connect.c: ignore extra colon after hostname

9 years agoMerge branch 'ma/bash-completion-leaking-x' into maint
Junio C Hamano [Mon, 27 Apr 2015 19:23:51 +0000 (12:23 -0700)] 
Merge branch 'ma/bash-completion-leaking-x' into maint

The completion script (in contrib/) contaminated global namespace
and clobbered on a shell variable $x.

* ma/bash-completion-leaking-x:
  completion: fix global bash variable leak on __gitcompappend

9 years agoMerge branch 'jc/push-cert' into maint
Junio C Hamano [Mon, 27 Apr 2015 19:23:47 +0000 (12:23 -0700)] 
Merge branch 'jc/push-cert' into maint

The "git push --signed" protocol extension did not limit what the
"nonce" that is a server-chosen string can contain or how long it
can be, which was unnecessarily lax.  Limit both the length and the
alphabet to a reasonably small space that can still have enough
entropy.

* jc/push-cert:
  push --signed: tighten what the receiving end can ask to sign

9 years agostatus: document the -v/--verbose option
Michael Haggerty [Thu, 23 Apr 2015 12:27:46 +0000 (14:27 +0200)] 
status: document the -v/--verbose option

Document `git status -v`, including its new doubled `-vv` form.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoRelNotes: wordsmithing
Michael Haggerty [Thu, 23 Apr 2015 12:27:50 +0000 (14:27 +0200)] 
RelNotes: wordsmithing

Make many textual tweaks to the 2.4.0 release notes.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoRelNotes: refer to the rebase -i "todo list", not "insn sheet"
Michael Haggerty [Thu, 23 Apr 2015 12:27:49 +0000 (14:27 +0200)] 
RelNotes: refer to the rebase -i "todo list", not "insn sheet"

"Todo list" is the name that is used in the user-facing documentation.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoRelNotes: correct name of versionsort.prereleaseSuffix
Michael Haggerty [Thu, 23 Apr 2015 12:27:48 +0000 (14:27 +0200)] 
RelNotes: correct name of versionsort.prereleaseSuffix

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agogit tag: mention versionsort.prereleaseSuffix in manpage
Michael Haggerty [Thu, 23 Apr 2015 12:27:47 +0000 (14:27 +0200)] 
git tag: mention versionsort.prereleaseSuffix in manpage

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoignore: info/exclude should trump core.excludesfile
Junio C Hamano [Wed, 22 Apr 2015 21:31:49 +0000 (14:31 -0700)] 
ignore: info/exclude should trump core.excludesfile

$GIT_DIR/info/exclude and core.excludesfile (which falls back to
$XDG_HOME/git/ignore) are both ways to override the ignore pattern
lists given by the project in .gitignore files.  The former, which
is per-repository personal preference, should take precedence over
the latter, which is a personal preference default across different
repositories that are accessed from that machine.  The existing
documentation also agrees.

However, the precedence order was screwed up between these two from
the very beginning when 896bdfa2 (add: Support specifying an
excludes file with a configuration variable, 2007-02-27) introduced
core.excludesfile variable.

Noticed-by: Yohei Endo <yoheie@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoGit 2.4.0-rc3 v2.4.0-rc3
Junio C Hamano [Wed, 22 Apr 2015 20:52:43 +0000 (13:52 -0700)] 
Git 2.4.0-rc3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agostop putting argv[0] dirname at front of PATH
Jeff King [Wed, 22 Apr 2015 18:14:02 +0000 (14:14 -0400)] 
stop putting argv[0] dirname at front of PATH

When the "git" wrapper is invoked, we prepend the baked-in
exec-path to our PATH, so that any sub-processes we exec
will all find the git-foo commands that match the wrapper
version.

If you invoke git with an absolute path, like:

  /usr/bin/git foo

we also prepend "/usr/bin" to the PATH. This was added long
ago by by 231af83 (Teach the "git" command to handle some
commands internally, 2006-02-26), with the intent that
things would just work if you did something like:

  cd /opt
  tar xzf premade-git-package.tar.gz
  alias git=/opt/git/bin/git

as we would then find all of the related external commands
in /opt/git/bin. I.e., it made git runtime-relocatable,
since at the time of 231af83, we installed all of the git
commands into $(bindir). But these days, that is not enough.
Since f28ac70 (Move all dashed-form commands to libexecdir,
2007-11-28), we do not put commands into $(bindir), and you
actually need to convert "/usr/bin" into "/usr/libexec". And
not just for finding binaries; we want to find $(sharedir),
etc, the same way.  The RUNTIME_PREFIX build knob does this
the right way, by assuming a sane hierarchy rooted at
"$prefix" when we run "$prefix/bin/git", and inferring
"$prefix/libexec/git-core", etc.

So this feature (prepending the argv[0] dirname to the PATH)
is broken for providing a runtime prefix, and has been for
many years. Does it do anything for other cases?

For the "git" wrapper itself, as well as any commands
shipped by "git", the answer is no. Those are already in
git's exec-path, which is consulted first. For third-party
commands which you've dropped into the same directory, it
does include them. So if you do

  cd /opt
  tar xzf git-built-specifically-for-opt-git.tar.gz
  cp third-party/git-foo /opt/git/bin/git-foo
  alias git=/opt/git/bin/git

it does mean that we will find the third-party "git-foo",
even if you do not put /opt/git/bin into your $PATH. But
the flipside of this is that we will bump the precedence of
_other_ third-party tools that happen to be in the same
directory as git. For example, consider this setup:

  1. Git is installed by the system in /usr/bin. There are
     other system utilities in /usr/bin. E.g., a system
     "vi".

  2. The user installs tools they prefer in /usr/local/bin.
     E.g., vim with a "vi" symlink. They set their PATH to
     /usr/local/bin:/usr/bin to prefer their custom tools.

  3. Running /usr/bin/git puts "/usr/bin" at the front of
     their PATH. When git invokes the editor on behalf of
     the user, they get the system vi, not their normal vim.

There are other variants of this, including overriding
system ruby and python (which is quite common using tools
like "rvm" and "virtualenv", which use relocatable
hierarchies and $PATH settings to get a consistent
environment).

Given that the main motivation for git placing the argv[0]
dirname into the PATH has been broken for years, that the
remaining cases are obscure and unlikely (and easily fixed
by the user just setting up their $PATH sanely), and that
the behavior is hurting real, reasonably common use cases,
it's not worth continuing to do so.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agostash: require a clean index to apply
Jeff King [Wed, 22 Apr 2015 19:31:02 +0000 (15:31 -0400)] 
stash: require a clean index to apply

If you have staged contents in your index and run "stash
apply", we may hit a conflict and put new entries into the
index. Recovering to your original state is difficult at
that point, because tools like "git reset --keep" will blow
away anything staged.  We can make this safer by refusing to
apply when there are staged changes.

It's possible we could provide better tooling here, as "git
stash apply" should be writing only conflicts to the index
(so we know that any stage-0 entries are potentially
precious). But it is the odd duck; most "mergy" commands
will update the index for cleanly merged entries, and it is
not worth updating our tooling to support this use case
which is unlikely to be of interest (besides which, we would
still need to block a dirty index for "stash apply --index",
since that case _would_ be ambiguous).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agot3903: avoid applying onto dirty index
Jeff King [Wed, 22 Apr 2015 19:30:58 +0000 (15:30 -0400)] 
t3903: avoid applying onto dirty index

One of the tests in t3903 wants to make sure that applying a
stash that touches only "file" can still happen even if there
are working tree changes to "other-file". To do so, it adds
"other-file" to the index (since otherwise it is an
untracked file, voiding the purpose of the test).

But as we are about to refactor the dirty-index handling,
and as this test does not actually care about having a dirty
index (only a dirty working tree), let's bump the tracking
of "other-file" into the setup phase, so we can have _just_
a dirty working tree here.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agot3903: stop hard-coding commit sha1s
Jeff King [Wed, 22 Apr 2015 19:30:52 +0000 (15:30 -0400)] 
t3903: stop hard-coding commit sha1s

When testing the diff output of "git stash list", we look
for the stash's subject of "WIP on master: $sha1", even
though it's not relevant to the diff output. This makes the
test brittle to refactoring, as any changes to earlier tests
may impact the commit sha1.

Since we don't care about the commit subject here, we can
simply ask stash not to print it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoSync with maint
Junio C Hamano [Tue, 21 Apr 2015 19:58:50 +0000 (12:58 -0700)] 
Sync with maint

9 years agoGit 2.3.6 v2.3.6
Junio C Hamano [Tue, 21 Apr 2015 19:17:09 +0000 (12:17 -0700)] 
Git 2.3.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'jk/colors' into maint
Junio C Hamano [Tue, 21 Apr 2015 19:12:25 +0000 (12:12 -0700)] 
Merge branch 'jk/colors' into maint

"diff-highlight" (in contrib/) used to show byte-by-byte
differences, which meant that multi-byte characters can be chopped
in the middle.  It learned to pay attention to character boundaries
(assuming the UTF-8 payload).

* jk/colors:
  diff-highlight: do not split multibyte characters

9 years agoMerge branch 'jk/test-annoyances' into maint
Junio C Hamano [Tue, 21 Apr 2015 19:12:24 +0000 (12:12 -0700)] 
Merge branch 'jk/test-annoyances' into maint

Test fixes.

* jk/test-annoyances:
  t5551: make EXPENSIVE test cheaper
  t5541: move run_with_cmdline_limit to test-lib.sh
  t: pass GIT_TRACE through Apache
  t: redirect stderr GIT_TRACE to descriptor 4
  t: translate SIGINT to an exit

9 years agoMerge branch 'pt/enter-repo-comment-fix' into maint
Junio C Hamano [Tue, 21 Apr 2015 19:12:23 +0000 (12:12 -0700)] 
Merge branch 'pt/enter-repo-comment-fix' into maint

Documentation update.

* pt/enter-repo-comment-fix:
  enter_repo(): fix docs to match code

9 years agoMerge branch 'jz/gitweb-conf-doc-fix' into maint
Junio C Hamano [Tue, 21 Apr 2015 19:12:22 +0000 (12:12 -0700)] 
Merge branch 'jz/gitweb-conf-doc-fix' into maint

Documentation update.

* jz/gitweb-conf-doc-fix:
  gitweb.conf.txt: say "build-time", not "built-time"

9 years agoMerge branch 'jk/cherry-pick-docfix' into maint
Junio C Hamano [Tue, 21 Apr 2015 19:12:21 +0000 (12:12 -0700)] 
Merge branch 'jk/cherry-pick-docfix' into maint

* jk/cherry-pick-docfix:
  cherry-pick: fix docs describing handling of empty commits

9 years agoMerge branch 'iu/fix-parse-options-h-comment' into maint
Junio C Hamano [Tue, 21 Apr 2015 19:12:20 +0000 (12:12 -0700)] 
Merge branch 'iu/fix-parse-options-h-comment' into maint

* iu/fix-parse-options-h-comment:
  parse-options.h: OPTION_{BIT,SET_INT} do not store pointer to defval

9 years agoMerge branch 'jg/cguide-we-cannot-count' into maint
Junio C Hamano [Tue, 21 Apr 2015 19:12:19 +0000 (12:12 -0700)] 
Merge branch 'jg/cguide-we-cannot-count' into maint

* jg/cguide-we-cannot-count:
  CodingGuidelines: update 'rough' rule count

9 years agoMerge branch 'jk/pack-corruption-post-mortem' into maint
Junio C Hamano [Tue, 21 Apr 2015 19:12:18 +0000 (12:12 -0700)] 
Merge branch 'jk/pack-corruption-post-mortem' into maint

Documentation update.

* jk/pack-corruption-post-mortem:
  howto: document more tools for recovery corruption

9 years agoMerge branch 'jn/doc-fast-import-no-16-octopus-limit' into maint
Junio C Hamano [Tue, 21 Apr 2015 19:12:17 +0000 (12:12 -0700)] 
Merge branch 'jn/doc-fast-import-no-16-octopus-limit' into maint

Documentation update.

* jn/doc-fast-import-no-16-octopus-limit:
  fast-import doc: remove suggested 16-parent limit

9 years agoRelNotes: "merge --quiet" change has been reverted
Junio C Hamano [Tue, 21 Apr 2015 18:09:19 +0000 (11:09 -0700)] 
RelNotes: "merge --quiet" change has been reverted

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoHopefully the last batch for 2.4
Junio C Hamano [Mon, 20 Apr 2015 22:30:13 +0000 (15:30 -0700)] 
Hopefully the last batch for 2.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'ps/grep-help-all-callback-arg'
Junio C Hamano [Mon, 20 Apr 2015 22:28:34 +0000 (15:28 -0700)] 
Merge branch 'ps/grep-help-all-callback-arg'

Code clean-up.

* ps/grep-help-all-callback-arg:
  grep: correctly initialize help-all option

9 years agoMerge branch 'tb/connect-ipv6-parse-fix'
Junio C Hamano [Mon, 20 Apr 2015 22:28:33 +0000 (15:28 -0700)] 
Merge branch 'tb/connect-ipv6-parse-fix'

An earlier update to the parser that disects an address broke an
address, followed by a colon, followed by an empty string (instead
of the port number).

* tb/connect-ipv6-parse-fix:
  connect.c: ignore extra colon after hostname

9 years agoMerge branch 'va/fix-git-p4-tests'
Junio C Hamano [Mon, 20 Apr 2015 22:28:32 +0000 (15:28 -0700)] 
Merge branch 'va/fix-git-p4-tests'

Test fixes for git-p4.

* va/fix-git-p4-tests:
  t9814: guarantee only one source exists in git-p4 copy tests
  git-p4: fix copy detection test
  t9814: fix broken shell syntax in git-p4 rename test

9 years agoMerge branch 'jc/push-cert'
Junio C Hamano [Mon, 20 Apr 2015 22:28:31 +0000 (15:28 -0700)] 
Merge branch 'jc/push-cert'

The "git push --signed" protocol extension did not limit what the
"nonce" that is a server-chosen string can contain or how long it
can be, which was unnecessarily lax.  Limit both the length and the
alphabet to a reasonably small space that can still have enough
entropy.

* jc/push-cert:
  push --signed: tighten what the receiving end can ask to sign

9 years agoMerge branch 'ma/bash-completion-leaking-x'
Junio C Hamano [Mon, 20 Apr 2015 22:28:29 +0000 (15:28 -0700)] 
Merge branch 'ma/bash-completion-leaking-x'

The completion script (in contrib/) contaminated global namespace
and clobbered on a shell variable $x.

* ma/bash-completion-leaking-x:
  completion: fix global bash variable leak on __gitcompappend

9 years agofmt-merge-msg: plug small leak of commit buffer
Junio C Hamano [Wed, 15 Apr 2015 21:18:37 +0000 (14:18 -0700)] 
fmt-merge-msg: plug small leak of commit buffer

A broken or badly formatted commit might not record author or
committer lines or we may not find a valid name on them.  The
function record_person() returned after calling get_commit_buffer()
without calling unuse_commit_buffer() on the memory it obtained in
such cases, potentially leaking it.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agosha1_file: only freshen packs once per run
Jeff King [Mon, 20 Apr 2015 19:55:00 +0000 (15:55 -0400)] 
sha1_file: only freshen packs once per run

Since 33d4221 (write_sha1_file: freshen existing objects,
2014-10-15), we update the mtime of existing objects that we
would have written out (had they not existed). For the
common case in which many objects are packed, we may update
the mtime on a single packfile repeatedly. This can result
in a noticeable performance problem if calling utime() is
expensive (e.g., because your storage is on NFS).

We can fix this by keeping a per-pack flag that lets us
freshen only once per program invocation.

An alternative would be to keep the packed_git.mtime flag up
to date as we freshen, and freshen only once every N
seconds. In practice, it's not worth the complexity. We are
racing against prune expiration times here, which inherently
must be set to accomodate reasonable program running times
(because they really care about the time between an object
being written and it becoming referenced, and the latter is
typically the last step a program takes).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agosha1_file: freshen pack objects before loose
Jeff King [Mon, 20 Apr 2015 19:54:03 +0000 (15:54 -0400)] 
sha1_file: freshen pack objects before loose

When writing out an object file, we first check whether it
already exists and if so optimize out the write. Prior to
33d4221, we did this by calling has_sha1_file(), which will
check for packed objects followed by loose. Since that
commit, we check loose objects first.

For the common case of a repository whose objects are mostly
packed, this means we will make a lot of extra access()
system calls checking for loose objects. We should follow
the same packed-then-loose order that all of our other
lookups use.

Reported-by: Stefan Saasen <ssaasen@atlassian.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>