OSDN Git Service

git-core/git.git
8 years agoMerge branch 'mg/cherry-pick-multi-on-unborn'
Junio C Hamano [Mon, 27 Jun 2016 16:56:53 +0000 (09:56 -0700)]
Merge branch 'mg/cherry-pick-multi-on-unborn'

"git cherry-pick A" worked on an unborn branch, but "git
cherry-pick A..B" didn't.

* mg/cherry-pick-multi-on-unborn:
  cherry-pick: allow to pick to unborn branches

8 years agoMerge branch 'lf/receive-pack-auto-gc-to-client'
Junio C Hamano [Mon, 27 Jun 2016 16:56:52 +0000 (09:56 -0700)]
Merge branch 'lf/receive-pack-auto-gc-to-client'

Allow messages that are generated by auto gc during "git push" on
the receiving end to be explicitly passed back to the sending end
over sideband, so that they are shown with "remote: " prefix to
avoid confusing the users.

* lf/receive-pack-auto-gc-to-client:
  receive-pack: send auto-gc output over sideband 2

8 years agoMerge branch 'em/newer-freebsd-shells-are-fine-with-returns'
Junio C Hamano [Mon, 27 Jun 2016 16:56:52 +0000 (09:56 -0700)]
Merge branch 'em/newer-freebsd-shells-are-fine-with-returns'

Comments about misbehaving FreeBSD shells have been clarified with
the version number (9.x and before are broken, newer ones are OK).

* em/newer-freebsd-shells-are-fine-with-returns:
  rebase: update comment about FreeBSD /bin/sh

8 years agoMerge branch 'lv/status-say-working-tree-not-directory'
Junio C Hamano [Mon, 27 Jun 2016 16:56:51 +0000 (09:56 -0700)]
Merge branch 'lv/status-say-working-tree-not-directory'

"git status" used to say "working directory" when it meant "working
tree".

* lv/status-say-working-tree-not-directory:
  Use "working tree" instead of "working directory" for git status

8 years agoMerge branch 'nb/gnome-keyring-build'
Junio C Hamano [Mon, 27 Jun 2016 16:56:50 +0000 (09:56 -0700)]
Merge branch 'nb/gnome-keyring-build'

Build improvements for gnome-keyring (in contrib/)

* nb/gnome-keyring-build:
  gnome-keyring: Don't hard-code pkg-config executable

8 years agoMerge branch 'jc/deref-tag'
Junio C Hamano [Mon, 27 Jun 2016 16:56:49 +0000 (09:56 -0700)]
Merge branch 'jc/deref-tag'

Code clean-up.

* jc/deref-tag:
  blame, line-log: do not loop around deref_tag()

8 years agoMerge branch 'et/add-chmod-x'
Junio C Hamano [Mon, 27 Jun 2016 16:56:49 +0000 (09:56 -0700)]
Merge branch 'et/add-chmod-x'

"git update-index --add --chmod=+x file" may be usable as an escape
hatch, but not a friendly thing to force for people who do need to
use it regularly.  "git add --chmod=+x file" can be used instead.

* et/add-chmod-x:
  add: add --chmod=+x / --chmod=-x options

8 years agoMerge branch 'jk/avoid-unbounded-alloca'
Junio C Hamano [Mon, 27 Jun 2016 16:56:48 +0000 (09:56 -0700)]
Merge branch 'jk/avoid-unbounded-alloca'

* jk/avoid-unbounded-alloca:
  tree-diff: avoid alloca for large allocations

8 years agoMerge branch 'rj/compat-regex-size-max-fix'
Junio C Hamano [Mon, 27 Jun 2016 16:56:47 +0000 (09:56 -0700)]
Merge branch 'rj/compat-regex-size-max-fix'

A compilation fix.

* rj/compat-regex-size-max-fix:
  regex: fix a SIZE_MAX macro redefinition warning

8 years agoMerge branch 'vs/prompt-avoid-unset-variable'
Junio C Hamano [Mon, 27 Jun 2016 16:56:47 +0000 (09:56 -0700)]
Merge branch 'vs/prompt-avoid-unset-variable'

The git-prompt scriptlet (in contrib/) was not friendly with those
who uses "set -u", which has been fixed.

* vs/prompt-avoid-unset-variable:
  git-prompt.sh: Don't error on null ${ZSH,BASH}_VERSION, $short_sha

8 years agoMerge branch 'sg/reflog-past-root'
Junio C Hamano [Mon, 27 Jun 2016 16:56:46 +0000 (09:56 -0700)]
Merge branch 'sg/reflog-past-root'

"git reflog" stopped upon seeing an entry that denotes a branch
creation event (aka "unborn"), which made it appear as if the
reflog was truncated.

* sg/reflog-past-root:
  reflog: continue walking the reflog past root commits

8 years agoMerge branch 'pb/strbuf-read-file-doc'
Junio C Hamano [Mon, 27 Jun 2016 16:56:46 +0000 (09:56 -0700)]
Merge branch 'pb/strbuf-read-file-doc'

* pb/strbuf-read-file-doc:
  strbuf: describe the return value of strbuf_read_file

8 years agoMerge branch 'dn/gpg-doc'
Junio C Hamano [Mon, 27 Jun 2016 16:56:45 +0000 (09:56 -0700)]
Merge branch 'dn/gpg-doc'

The documentation tries to consistently spell "GPG"; when
referring to the specific program name, "gpg" is used.

* dn/gpg-doc:
  Documentation: GPG capitalization

8 years agoMerge branch 'jk/fetch-prune-doc'
Junio C Hamano [Mon, 27 Jun 2016 16:56:44 +0000 (09:56 -0700)]
Merge branch 'jk/fetch-prune-doc'

* jk/fetch-prune-doc:
  fetch: document that pruning happens before fetching

8 years agoMerge branch 'ap/git-svn-propset-doc'
Junio C Hamano [Mon, 27 Jun 2016 16:56:43 +0000 (09:56 -0700)]
Merge branch 'ap/git-svn-propset-doc'

"git svn propset" subcommand that was added in 2.3 days is
documented now.

* ap/git-svn-propset-doc:
  git-svn: document the 'git svn propset' command

8 years agoMerge branch 'tr/doc-tt'
Junio C Hamano [Mon, 27 Jun 2016 16:56:42 +0000 (09:56 -0700)]
Merge branch 'tr/doc-tt'

The documentation set has been updated so that literal commands,
configuration variables and environment variables are consistently
typeset in fixed-width font and bold in manpages.

* tr/doc-tt:
  doc: change configuration variables format
  doc: more consistency in environment variables format
  doc: change environment variables format
  doc: clearer rule about formatting literals

8 years agoMerge branch 'pc/occurred'
Junio C Hamano [Mon, 27 Jun 2016 16:56:42 +0000 (09:56 -0700)]
Merge branch 'pc/occurred'

* pc/occurred:
  config.c: fix misspelt "occurred" in an error message
  refs.h: fix misspelt "occurred" in a comment

8 years agoMerge branch 'cc/apply-introduce-state'
Junio C Hamano [Mon, 27 Jun 2016 16:56:42 +0000 (09:56 -0700)]
Merge branch 'cc/apply-introduce-state'

The "git apply" standalone program is being libified; this is the
first step to move many state variables into a structure that can
be explicitly (re)initialized to make the machinery callable more
than once.

The next step that moves some remaining state variables into the
structure and turns die()s into an error return that propagates up
to the caller is not queued yet but in flight.  It would be good to
review the above first and give the remainder of the series a solid
base to build on.

* cc/apply-introduce-state: (50 commits)
  builtin/apply: remove misleading comment on lock_file field
  builtin/apply: move 'newfd' global into 'struct apply_state'
  builtin/apply: add 'lock_file' pointer into 'struct apply_state'
  builtin/apply: move applying patches into apply_all_patches()
  builtin/apply: move 'state' check into check_apply_state()
  builtin/apply: move 'symlink_changes' global into 'struct apply_state'
  builtin/apply: move 'fn_table' global into 'struct apply_state'
  builtin/apply: move 'state_linenr' global into 'struct apply_state'
  builtin/apply: move 'max_change' and 'max_len' into 'struct apply_state'
  builtin/apply: move 'ws_ignore_action' into 'struct apply_state'
  builtin/apply: move 'ws_error_action' into 'struct apply_state'
  builtin/apply: move 'applied_after_fixing_ws' into 'struct apply_state'
  builtin/apply: move 'squelch_whitespace_errors' into 'struct apply_state'
  builtin/apply: remove whitespace_option arg from set_default_whitespace_mode()
  builtin/apply: move 'whitespace_option' into 'struct apply_state'
  builtin/apply: move 'whitespace_error' global into 'struct apply_state'
  builtin/apply: move 'root' global into 'struct apply_state'
  builtin/apply: move 'p_value_known' global into 'struct apply_state'
  builtin/apply: move 'p_value' global into 'struct apply_state'
  builtin/apply: move 'has_include' global into 'struct apply_state'
  ...

8 years agogit-svn: skip mergeinfo handling with --no-follow-parent
Eric Wong [Mon, 20 Jun 2016 21:52:53 +0000 (21:52 +0000)]
git-svn: skip mergeinfo handling with --no-follow-parent

For repositories without parent following enabled, finding
git parents through svn:mergeinfo or svk::parents can be
expensive and pointless.

Reported-by: Александр Овчинников <proff@proff.email>
http://mid.gmane.org/4094761466408188@web24o.yandex.ru

Signed-off-by: Eric Wong <e@80x24.org>
8 years agoStart the post-2.9 cycle
Junio C Hamano [Mon, 20 Jun 2016 18:06:49 +0000 (11:06 -0700)]
Start the post-2.9 cycle

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'rs/xdiff-hunk-with-func-line'
Junio C Hamano [Mon, 20 Jun 2016 18:01:04 +0000 (11:01 -0700)]
Merge branch 'rs/xdiff-hunk-with-func-line'

"git show -W" (extend hunks to cover the entire function, delimited
by lines that match the "funcname" pattern) used to show the entire
file when a change added an entire function at the end of the file,
which has been fixed.

* rs/xdiff-hunk-with-func-line:
  xdiff: fix merging of appended hunk with -W
  grep: -W: don't extend context to trailing empty lines
  t7810: add test for grep -W and trailing empty context lines
  xdiff: don't trim common tail with -W
  xdiff: -W: don't include common trailing empty lines in context
  xdiff: ignore empty lines before added functions with -W
  xdiff: handle appended chunks better with -W
  xdiff: factor out match_func_rec()
  t4051: rewrite, add more tests

8 years agoMerge branch 'jk/rev-list-count-with-bitmap'
Junio C Hamano [Mon, 20 Jun 2016 18:01:03 +0000 (11:01 -0700)]
Merge branch 'jk/rev-list-count-with-bitmap'

"git rev-list --count" whose walk-length is limited with "-n"
option did not work well with the counting optimized to look at the
bitmap index.

* jk/rev-list-count-with-bitmap:
  rev-list: disable bitmaps when "-n" is used with listing objects
  rev-list: "adjust" results of "--count --use-bitmap-index -n"

8 years agoMerge branch 'wd/userdiff-css'
Junio C Hamano [Mon, 20 Jun 2016 18:01:02 +0000 (11:01 -0700)]
Merge branch 'wd/userdiff-css'

Update the funcname definition to support css files.

* wd/userdiff-css:
  userdiff: add built-in pattern for CSS

8 years agoMerge branch 'jc/clear-pathspec'
Junio C Hamano [Mon, 20 Jun 2016 18:01:02 +0000 (11:01 -0700)]
Merge branch 'jc/clear-pathspec'

We usually call a function that clears the contents a data
structure X without freeing the structure itself clear_X(), and
call a function that does clear_X() and also frees it free_X().
free_pathspec() function has been renamed to clear_pathspec()
to avoid confusion.

* jc/clear-pathspec:
  pathspec: rename free_pathspec() to clear_pathspec()

8 years agoMerge branch 'aq/upload-pack-use-parse-options'
Junio C Hamano [Mon, 20 Jun 2016 18:01:02 +0000 (11:01 -0700)]
Merge branch 'aq/upload-pack-use-parse-options'

"git upload-pack" command has been updated to use the parse-options
API.

* aq/upload-pack-use-parse-options:
  upload-pack.c: use parse-options API

8 years agoMerge branch 'jg/dash-is-last-branch-in-worktree-add'
Junio C Hamano [Mon, 20 Jun 2016 18:01:02 +0000 (11:01 -0700)]
Merge branch 'jg/dash-is-last-branch-in-worktree-add'

"git worktree add" learned that '-' can be used as a short-hand for
"@{-1}", the previous branch.

* jg/dash-is-last-branch-in-worktree-add:
  worktree: allow "-" short-hand for @{-1} in add command

8 years agoMerge branch 'et/pretty-format-c-auto'
Junio C Hamano [Mon, 20 Jun 2016 18:01:01 +0000 (11:01 -0700)]
Merge branch 'et/pretty-format-c-auto'

The commands in `git log` family take %C(auto) in a custom format
string.  This unconditionally turned the color on, ignoring
--no-color or with --color=auto when the output is not connected to
a tty; this was corrected to make the format truly behave as
"auto".

* et/pretty-format-c-auto:
  format_commit_message: honor `color=auto` for `%C(auto)`

8 years agoMerge branch 'sb/submodule-recommend-shallowness'
Junio C Hamano [Mon, 20 Jun 2016 18:01:01 +0000 (11:01 -0700)]
Merge branch 'sb/submodule-recommend-shallowness'

An upstream project can make a recommendation to shallowly clone
some submodules in the .gitmodules file it ships.

* sb/submodule-recommend-shallowness:
  submodule update: learn `--[no-]recommend-shallow` option
  submodule-config: keep shallow recommendation around

8 years agoMerge branch 'sb/submodule-misc-cleanups'
Junio C Hamano [Mon, 20 Jun 2016 18:01:01 +0000 (11:01 -0700)]
Merge branch 'sb/submodule-misc-cleanups'

Minor simplification.

* sb/submodule-misc-cleanups:
  submodule update: make use of the existing fetch_in_submodule function

8 years agoMerge branch 'ew/daemon-socket-keepalive'
Junio C Hamano [Mon, 20 Jun 2016 18:01:00 +0000 (11:01 -0700)]
Merge branch 'ew/daemon-socket-keepalive'

When "git daemon" is run without --[init-]timeout specified, a
connection from a client that silently goes offline can hang around
for a long time, wasting resources.  The socket-level KEEPALIVE has
been enabled to allow the OS to notice such failed connections.

* ew/daemon-socket-keepalive:
  daemon: enable SO_KEEPALIVE for all sockets

8 years agoMerge branch 'ah/no-verify-signature-with-pull-rebase'
Junio C Hamano [Mon, 20 Jun 2016 18:01:00 +0000 (11:01 -0700)]
Merge branch 'ah/no-verify-signature-with-pull-rebase'

"git pull --rebase --verify-signature" learned to warn the user
that "--verify-signature" is a no-op when rebasing.

* ah/no-verify-signature-with-pull-rebase:
  pull: warn on --verify-signatures with --rebase

8 years agoMerge branch 'ew/fast-import-unpack-limit'
Junio C Hamano [Mon, 20 Jun 2016 18:01:00 +0000 (11:01 -0700)]
Merge branch 'ew/fast-import-unpack-limit'

"git fast-import" learned the same performance trick to avoid
creating too small a packfile as "git fetch" and "git push" have,
using *.unpackLimit configuration.

* ew/fast-import-unpack-limit:
  fast-import: invalidate pack_id references after loosening
  fast-import: implement unpack limit

8 years agorebase: update comment about FreeBSD /bin/sh
Ed Maste [Fri, 17 Jun 2016 15:33:29 +0000 (11:33 -0400)]
rebase: update comment about FreeBSD /bin/sh

Commit 9f50d32 introduced a fix for FreeBSD /bin/sh misbehaviour
when dot-sourcing a file containing "return" statements outside of
any function, from a function in another shell script. That issue
affects FreeBSD 9.x, and is not present in the /bin/sh in FreeBSD
10.3 and later. Update the comment to clarify this.

The example from 9f50d32's commit message produces the expected output
on FreeBSD 10.3 and -CURRENT (the upcoming 11.0):

% sh script1.sh
only this line should show
%

Signed-off-by: Ed Maste <emaste@freebsd.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoDocumentation: GPG capitalization
Dave Nicolson [Thu, 16 Jun 2016 22:15:44 +0000 (22:15 +0000)]
Documentation: GPG capitalization

When "GPG" is used in a sentence it is now consistently capitalized.
When referring to the binary it is left as "gpg".

Signed-off-by: David Nicolson <david.nicolson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agogit-svn: document the 'git svn propset' command
Alfred Perlstein [Wed, 15 Jun 2016 05:19:50 +0000 (22:19 -0700)]
git-svn: document the 'git svn propset' command

Add example usage to the git-svn documentation.

Reported-by: Joseph Pecoraro <pecoraro@apple.com>
Signed-off-by: Alfred Perlstein <alfred@freebsd.org>
Reviewed-by: Eric Wong <e@80x24.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoblame, line-log: do not loop around deref_tag()
Junio C Hamano [Tue, 14 Jun 2016 20:38:14 +0000 (13:38 -0700)]
blame, line-log: do not loop around deref_tag()

These callers appear to expect that deref_tag() is to peel one layer
of a tag, but the function does not work that way; it has its own
loop to unwrap tags until an object that is not a tag appears.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agognome-keyring: Don't hard-code pkg-config executable
Heiko Becker [Tue, 14 Jun 2016 11:27:05 +0000 (13:27 +0200)]
gnome-keyring: Don't hard-code pkg-config executable

Helpful if your pkg-config executable has a prefix based on the
architecture, for example.

Signed-off-by: Heiko Becker <heirecka@exherbo.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agostrbuf: describe the return value of strbuf_read_file
Pranit Bauva [Tue, 14 Jun 2016 06:14:11 +0000 (11:44 +0530)]
strbuf: describe the return value of strbuf_read_file

Mentored-by: Lars Schneider <larsxschneider@gmail.com>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agofetch: document that pruning happens before fetching
Jeff King [Mon, 13 Jun 2016 23:58:51 +0000 (19:58 -0400)]
fetch: document that pruning happens before fetching

This was changed in 10a6cc8 (fetch --prune: Run prune before
fetching, 2014-01-02), but it seems that nobody in that
discussion realized we were advertising the "after"
explicitly.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoGit 2.9 v2.9.0
Junio C Hamano [Mon, 13 Jun 2016 17:42:13 +0000 (10:42 -0700)]
Git 2.9

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge tag 'l10n-2.9.0-rc0' of git://github.com/git-l10n/git-po
Junio C Hamano [Mon, 13 Jun 2016 01:00:57 +0000 (18:00 -0700)]
Merge tag 'l10n-2.9.0-rc0' of git://github.com/git-l10n/git-po

l10n-2.9.0-rc0

* tag 'l10n-2.9.0-rc0' of git://github.com/git-l10n/git-po:
  l10n: ko.po: Update Korean translation
  l10n: ru.po: update Russian translation
  l10n: de.po: translate 104 new messages
  l10n: zh_CN: review for git v2.9.0 l10n round 1
  l10n: zh_CN: for git v2.9.0 l10n round 1
  l10n: pt_PT: update Portuguese translation
  l10n: pt_PT: update according to git-gui glossary
  l10n: pt_PT: merge git.pot file
  l10n: Updated Bulgarian translation of git (2597t,0f,0u)
  l10n: sv.po: Update Swedish translation (2597t0f0u)
  l10n: fr.po v2.9.0rnd1
  l10n: Updated Vietnamese translation (2597t)
  l10n: git.pot: v2.9.0 round 1 (104 new, 37 removed)
  l10n: fr.po Fixed grammar mistake

8 years agol10n: ko.po: Update Korean translation
Changwoo Ryu [Sat, 11 Jun 2016 16:25:58 +0000 (01:25 +0900)]
l10n: ko.po: Update Korean translation

8 years agoMerge branch 'russian-l10n' of https://github.com/DJm00n/git-po-ru
Jiang Xin [Sat, 11 Jun 2016 12:21:52 +0000 (20:21 +0800)]
Merge branch 'russian-l10n' of https://github.com/DJm00n/git-po-ru

* 'russian-l10n' of https://github.com/DJm00n/git-po-ru:
  l10n: ru.po: update Russian translation

8 years agol10n: ru.po: update Russian translation
Dimitriy Ryazantcev [Sat, 11 Jun 2016 09:53:43 +0000 (12:53 +0300)]
l10n: ru.po: update Russian translation

Signed-off-by: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com>
8 years agoHopefully the final last-minute update before 2.9 final
Junio C Hamano [Fri, 10 Jun 2016 22:30:19 +0000 (15:30 -0700)]
Hopefully the final last-minute update before 2.9 final

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'jk/diff-compact-heuristic'
Junio C Hamano [Fri, 10 Jun 2016 22:26:06 +0000 (15:26 -0700)]
Merge branch 'jk/diff-compact-heuristic'

It turns out that the earlier effort to update the heuristics may
want to use a bit more time to mature.  Turn it off by default.

* jk/diff-compact-heuristic:
  diff: disable compaction heuristic for now

8 years agoMerge branch 'jk/shell-portability'
Junio C Hamano [Fri, 10 Jun 2016 22:26:04 +0000 (15:26 -0700)]
Merge branch 'jk/shell-portability'

test fixes.

* jk/shell-portability:
  t5500 & t7403: lose bash-ism "local"
  test-lib: add in-shell "env" replacement

8 years agoMerge branch 'jc/t2300-setup'
Junio C Hamano [Fri, 10 Jun 2016 22:26:04 +0000 (15:26 -0700)]
Merge branch 'jc/t2300-setup'

A test fix.

* jc/t2300-setup:
  t2300: run git-sh-setup in an environment that better mimics the real life

8 years agoconfig.c: fix misspelt "occurred" in an error message
Peter Colberg [Fri, 10 Jun 2016 19:05:26 +0000 (15:05 -0400)]
config.c: fix misspelt "occurred" in an error message

Signed-off-by: Peter Colberg <peter@colberg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agorefs.h: fix misspelt "occurred" in a comment
Peter Colberg [Fri, 10 Jun 2016 19:05:26 +0000 (15:05 -0400)]
refs.h: fix misspelt "occurred" in a comment

Signed-off-by: Peter Colberg <peter@colberg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agodiff: disable compaction heuristic for now
Junio C Hamano [Fri, 10 Jun 2016 17:58:55 +0000 (10:58 -0700)]
diff: disable compaction heuristic for now

http://lkml.kernel.org/g/20160610075043.GA13411@sigill.intra.peff.net
reports that a change to add a new "function" with common ending
with the existing one at the end of the file is shown like this:

    def foo
      do_foo_stuff()

   +  common_ending()
   +end
   +
   +def bar
   +  do_bar_stuff()
   +
      common_ending()
    end

when the new heuristic is in use.  In reality, the change is to add
the blank line before "def bar" and everything below, which is what
the code without the new heuristic shows.

Disable the heuristics by default, and resurrect the documentation
for the option and the configuration variables, while clearly
marking the feature as still experimental.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agol10n: de.po: translate 104 new messages
Ralf Thielow [Fri, 10 Jun 2016 16:00:46 +0000 (18:00 +0200)]
l10n: de.po: translate 104 new messages

Translate 104 new messages came from git.pot update in f517e50
(l10n: git.pot: v2.9.0 round 1 (104 new, 37 removed)).

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
8 years agoxdiff: fix merging of appended hunk with -W
René Scharfe [Thu, 9 Jun 2016 21:54:48 +0000 (23:54 +0200)]
xdiff: fix merging of appended hunk with -W

When -W is given we search the lines between the end of the current
context and the next change for a function line.  If there is none then
we merge those two hunks as they must be part of the same function.

If the next change is an appended chunk we abort the search early in
get_func_line(), however, because its line number is out of range.  Fix
that by searching from the end of the pre-image in that case instead.

Reported-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoUse "working tree" instead of "working directory" for git status
Lars Vogel [Thu, 9 Jun 2016 18:19:30 +0000 (20:19 +0200)]
Use "working tree" instead of "working directory" for git status

Working directory can be easily confused with the current directory.
In one of my patches I already updated the usage of working directory
with working tree for the man page but I noticed that git status also
uses this incorrect term.

Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agol10n: zh_CN: review for git v2.9.0 l10n round 1
Ray Chen [Sun, 5 Jun 2016 16:06:17 +0000 (00:06 +0800)]
l10n: zh_CN: review for git v2.9.0 l10n round 1

Signed-off-by: Ray Chen <oldsharp@gmail.com>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
8 years agodoc: change configuration variables format
Tom Russello [Wed, 8 Jun 2016 17:23:16 +0000 (19:23 +0200)]
doc: change configuration variables format

This change configuration variables that where in italic style
to monospace font according to the guideline. It was obtained with

grep '[[:alpha:]]*\.[[:alpha:]]*::$' config.txt | \
sed -e 's/::$//' -e 's/\./\\\\./' | \
xargs -iP perl -pi -e "s/\'P\'/\`P\`/g" ./*.txt

Signed-off-by: Tom Russello <tom.russello@grenoble-inp.org>
Signed-off-by: Erwan Mathoniere <erwan.mathoniere@grenoble-inp.org>
Signed-off-by: Samuel Groot <samuel.groot@grenoble-inp.org>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agodoc: more consistency in environment variables format
Tom Russello [Tue, 7 Jun 2016 22:35:07 +0000 (00:35 +0200)]
doc: more consistency in environment variables format

Wrap with backticks (monospaced font) unwrapped or single-quotes wrapped
(italic type) environment variables which are followed by the word
"environment". It was obtained with:

perl -pi -e "s/\'?(\\\$?[0-9A-Z\_]+)\'?(?= environment ?)/\`\1\`/g" *.txt

One of the main purposes is to stick to the CodingGuidelines as possible so
that people writting new documentation by mimicking the existing are more likely
to have it right (even if they didn't read the CodingGuidelines).

Signed-off-by: Tom Russello <tom.russello@grenoble-inp.org>
Signed-off-by: Erwan Mathoniere <erwan.mathoniere@grenoble-inp.org>
Signed-off-by: Samuel Groot <samuel.groot@grenoble-inp.org>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agodoc: change environment variables format
Tom Russello [Tue, 7 Jun 2016 22:35:06 +0000 (00:35 +0200)]
doc: change environment variables format

This change GIT_* variables that where in italic style to monospaced font
according to the guideline. It was obtained with

perl -pi -e "s/\'(GIT_.*?)\'/\`\1\`/g" *.txt

One of the main purposes is to stick to the CodingGuidelines as possible so
that people writting new documentation by mimicking the existing are more likely
to have it right (even if they didn't read the CodingGuidelines).

Signed-off-by: Tom Russello <tom.russello@grenoble-inp.org>
Signed-off-by: Erwan Mathoniere <erwan.mathoniere@grenoble-inp.org>
Signed-off-by: Samuel Groot <samuel.groot@grenoble-inp.org>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agodoc: clearer rule about formatting literals
Tom Russello [Tue, 7 Jun 2016 22:35:05 +0000 (00:35 +0200)]
doc: clearer rule about formatting literals

Make the guideline text that we want for our documentation clearer.

Signed-off-by: Tom Russello <tom.russello@grenoble-inp.org>
Signed-off-by: Erwan Mathoniere <erwan.mathoniere@grenoble-inp.org>
Signed-off-by: Samuel Groot <samuel.groot@grenoble-inp.org>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agotree-diff: avoid alloca for large allocations
Jeff King [Tue, 7 Jun 2016 22:53:00 +0000 (18:53 -0400)]
tree-diff: avoid alloca for large allocations

Commit 72441af (tree-diff: rework diff_tree() to generate
diffs for multiparent cases as well, 2014-04-07) introduced
the use of alloca so that the common cases of commits with 1
or 2 parents would not be adversely affected by going
through the multi-parent code.

However, our xalloca is not ideal when the number of parents
grows very large:

  1. If the requested size is too large for our stack,
     alloca() has no way to tell us, and we simply segfault
     while trying to access the memory.

  2. It does not use our usual memory_limit_check() logic.

I measured, and alloca is indeed buying us a very small
speedup over xmalloc()/free(). So we'd want to keep
something like it.

This patch simply puts a conditional in place at each
callsite: we use alloca for common known-small numbers of
parents, and otherwise use the heap. We are technically
still vulnerable to (1), but no more so than if we simply
put a few dozen bytes on the stack, which we must do all the
time anyway. And likewise, we technically miss a memory
limit check if it is tiny, but such a limit is pointless.

An alternative to this would be implement something like:

  struct tree *tp, tp_fallback[2];
  if (nparent <= ARRAY_SIZE(tp_fallback))
          tp = tp_fallback;
  else
  ALLOC_ARRAY(tp, nparent);
  ...
  if (tp != tp_fallback)
  free(tp);

That would let us drop our xalloca() portability code
entirely. But in my measurements, this seemed to perform
slightly worse than the xalloca solution.

Note in the example above, and in the patch below, I've used
ALLOC_ARRAY() to replace the manual xmalloc(nr * sizeof(*x)).
Besides being shorter, this has the bonus that one cannot
accidentally overflow a size_t during that computation.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoadd: add --chmod=+x / --chmod=-x options
Edward Thomson [Tue, 31 May 2016 22:08:18 +0000 (17:08 -0500)]
add: add --chmod=+x / --chmod=-x options

The executable bit will not be detected (and therefore will not be
set) for paths in a repository with `core.filemode` set to false,
though the users may still wish to add files as executable for
compatibility with other users who _do_ have `core.filemode`
functionality.  For example, Windows users adding shell scripts may
wish to add them as executable for compatibility with users on
non-Windows.

Although this can be done with a plumbing command
(`git update-index --add --chmod=+x foo`), teaching the `git-add`
command allows users to set a file executable with a command that
they're already familiar with.

Signed-off-by: Edward Thomson <ethomson@edwardthomson.com>
Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoregex: fix a SIZE_MAX macro redefinition warning
Ramsay Jones [Tue, 7 Jun 2016 00:35:33 +0000 (01:35 +0100)]
regex: fix a SIZE_MAX macro redefinition warning

Since commit 56a1a3ab ("Silence GCC's \"cast of pointer to integer of a
different size\" warning", 26-10-2015), sparse has been issuing a macro
redefinition warning for the SIZE_MAX macro. However, gcc did not issue
any such warning.

After commit 56a1a3ab, in terms of the order of #includes and #defines,
the code looked something like:

  $ cat -n junk.c
       1 #include <stddef.h>
       2
       3 #define SIZE_MAX ((size_t) -1)
       4
       5 #include <stdint.h>
       6
       7 int main(int argc, char *argv[])
       8 {
       9 return 0;
      10 }
  $
  $ gcc junk.c
  $

However, if you compile that file with -Wsystem-headers, then it will
also issue a warning. Having set -Wsystem-headers in CFLAGS, using the
config.mak file, then (on cygwin):

  $ make compat/regex/regex.o
      CC compat/regex/regex.o
  In file included from /usr/lib/gcc/x86_64-pc-cygwin/4.9.3/include/stdint.h:9:0,
                   from compat/regex/regcomp.c:21,
                   from compat/regex/regex.c:77:
  /usr/include/stdint.h:362:0: warning: "SIZE_MAX" redefined
   #define SIZE_MAX (__SIZE_MAX__)
   ^
  In file included from compat/regex/regex.c:69:0:
  compat/regex/regex_internal.h:108:0: note: this is the location of the previous definition
   # define SIZE_MAX ((size_t) -1)
   ^
  $

The compilation of the compat/regex code is somewhat unusual in that the
regex.c file directly #includes the other c files (regcomp.c, regexec.c
and regex_internal.c). Commit 56a1a3ab added an #include of <stdint.h>
to the regcomp.c file, which results in the redefinition, since this is
included after the regex_internal.h header. This header file contains a
'fallback' definition for SIZE_MAX, in order to support systems which do
not have the <stdint.h> header (the HAVE_STDINT_H macro is not defined).

In order to suppress the warning, we move the #include of <stdint.h>
from regcomp.c to the start of the compilation unit, close to the top
of regex.c, prior to the #include of the regex_internal.h header.

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoreflog: continue walking the reflog past root commits
SZEDER Gábor [Fri, 3 Jun 2016 20:42:35 +0000 (22:42 +0200)]
reflog: continue walking the reflog past root commits

If a repository contains more than one root commit, then its HEAD
reflog may contain multiple "creation events", i.e. entries whose
"from" value is the null sha1.  Listing such a reflog currently stops
prematurely at the first such entry, even when the reflog still
contains older entries.  This can scare users into thinking that their
reflog got truncated after 'git checkout --orphan'.

Continue walking the reflog past such creation events based on the
preceeding reflog entry's "new" value.

The test 'symbolic-ref writes reflog entry' in t1401-symbolic-ref
implicitly relies on the current behavior of the reflog walker to stop
at a root commit and thus to list only the reflog entries that are
relevant for that test.  Adjust the test to explicitly specify the
number of relevant reflog entries to be listed.

Reported-by: Patrik Gustafsson <pvn@textalk.se>
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoGit 2.9-rc2 v2.9.0-rc2
Junio C Hamano [Mon, 6 Jun 2016 21:19:45 +0000 (14:19 -0700)]
Git 2.9-rc2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoSync with 2.8.4
Junio C Hamano [Mon, 6 Jun 2016 21:30:49 +0000 (14:30 -0700)]
Sync with 2.8.4

* maint:
  Git 2.8.4

8 years agoGit 2.8.4 v2.8.4
Junio C Hamano [Mon, 6 Jun 2016 21:29:32 +0000 (14:29 -0700)]
Git 2.8.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'kb/msys2-tty' into maint
Junio C Hamano [Mon, 6 Jun 2016 21:27:38 +0000 (14:27 -0700)]
Merge branch 'kb/msys2-tty' into maint

The "are we talking with TTY, doing an interactive session?"
detection has been updated to work better for "Git for Windows".

* kb/msys2-tty:
  mingw: make isatty() recognize MSYS2's pseudo terminals (/dev/pty*)

8 years agoMerge branch 'da/difftool' into maint
Junio C Hamano [Mon, 6 Jun 2016 21:27:37 +0000 (14:27 -0700)]
Merge branch 'da/difftool' into maint

"git difftool" learned to handle unmerged paths correctly in
dir-diff mode.

* da/difftool:
  difftool: handle unmerged files in dir-diff mode
  difftool: initialize variables for readability

8 years agoMerge branch 'tb/core-eol-fix' into maint
Junio C Hamano [Mon, 6 Jun 2016 21:27:36 +0000 (14:27 -0700)]
Merge branch 'tb/core-eol-fix' into maint

A couple of bugs around core.autocrlf have been fixed.

* tb/core-eol-fix:
  convert.c: ident + core.autocrlf didn't work
  t0027: test cases for combined attributes
  convert: allow core.autocrlf=input and core.eol=crlf
  t0027: make commit_chk_wrnNNO() reliable

8 years agoMerge branch 'ar/diff-args-osx-precompose' into maint
Junio C Hamano [Mon, 6 Jun 2016 21:27:35 +0000 (14:27 -0700)]
Merge branch 'ar/diff-args-osx-precompose' into maint

Many commands normalize command line arguments from NFD to NFC
variant of UTF-8 on OSX, but commands in the "diff" family did
not, causing "git diff $path" to complain that no such path is
known to Git.  They have been taught to do the normalization.

* ar/diff-args-osx-precompose:
  diff: run arguments through precompose_argv

8 years agoMerge branch 'sb/submodule-helper-relative-path'
Junio C Hamano [Mon, 6 Jun 2016 21:18:55 +0000 (14:18 -0700)]
Merge branch 'sb/submodule-helper-relative-path'

A bash-ism "local" has been removed from "git submodule" scripted
Porcelain.

* sb/submodule-helper-relative-path:
  submodule: remove bashism from shell script

8 years agoMerge branch 'sb/submodule-helper-list-signal-unmatch-via-exit-status'
Junio C Hamano [Mon, 6 Jun 2016 21:18:55 +0000 (14:18 -0700)]
Merge branch 'sb/submodule-helper-list-signal-unmatch-via-exit-status'

The way how "submodule--helper list" signals unmatch error to its
callers has been updated.

* sb/submodule-helper-list-signal-unmatch-via-exit-status:
  submodule--helper: offer a consistent API

8 years agobuiltin/apply: remove misleading comment on lock_file field
Junio C Hamano [Mon, 6 Jun 2016 20:11:02 +0000 (13:11 -0700)]
builtin/apply: remove misleading comment on lock_file field

Just like pointer field like prefix, the piece of memory pointed at
by lock_file field is not owned by the apply_state structure.  It is
true that the caller needs to be careful about the lifetime rule for
lockfile instances, but that is none of this API's business.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agogit-prompt.sh: Don't error on null ${ZSH,BASH}_VERSION, $short_sha
Ville Skyttä [Mon, 6 Jun 2016 16:29:33 +0000 (19:29 +0300)]
git-prompt.sh: Don't error on null ${ZSH,BASH}_VERSION, $short_sha

When the shell is in "nounset" or "set -u" mode, referencing unset or
null variables results in an error. Protect $ZSH_VERSION and
$BASH_VERSION against that, and initialize $short_sha before use.

Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agocherry-pick: allow to pick to unborn branches
Michael J Gruber [Mon, 6 Jun 2016 13:23:54 +0000 (15:23 +0200)]
cherry-pick: allow to pick to unborn branches

cherry-pick allows to pick single commits to an empty HEAD, but not
multiple commits.

Allow the multiple commit case, too.

Reported-by: Fabrizio Cucci <fabrizio.cucci@gmail.com>
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoreceive-pack: send auto-gc output over sideband 2
Lukas Fleischer [Sun, 5 Jun 2016 09:36:38 +0000 (11:36 +0200)]
receive-pack: send auto-gc output over sideband 2

Redirect auto-gc output to the sideband such that it is visible to all
clients. As a side effect, all auto-gc error messages are now prefixed
with "remote: " before being printed to stderr on the client-side which
makes it easier to understand that those error messages originate from
the server.

Signed-off-by: Lukas Fleischer <lfleischer@lfos.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agol10n: zh_CN: for git v2.9.0 l10n round 1
Jiang Xin [Sun, 29 May 2016 12:40:35 +0000 (20:40 +0800)]
l10n: zh_CN: for git v2.9.0 l10n round 1

Update 104 new translations (2596t1f0u) for git v2.9.0-rc0.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
8 years agouserdiff: add built-in pattern for CSS
William Duclot [Fri, 3 Jun 2016 12:32:26 +0000 (14:32 +0200)]
userdiff: add built-in pattern for CSS

CSS is widely used, motivating it being included as a built-in pattern.

It must be noted that the word_regex for CSS (i.e. the regex defining
what is a word in the language) does not consider '.' and '#' characters
(in CSS selectors) to be part of the word. This behavior is documented
by the test t/t4018/css-rule.
The logic behind this behavior is the following: identifiers in CSS
selectors are identifiers in a HTML/XML document. Therefore, the '.'/'#'
character are not part of the identifier, but an indicator of the nature
of the identifier in HTML/XML (class or id). Diffing ".class1" and
".class2" must show that the class name is changed, but we still are
selecting a class.

Logic behind the "pattern" regex is:
    1. reject lines ending with a colon/semicolon (properties)
    2. if a line begins with a name in column 1, pick the whole line

Credits to Johannes Sixt (j6t@kdbg.org) for the pattern regex and most
of the tests.

Signed-off-by: William Duclot <william.duclot@ensimag.grenoble-inp.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Reviewed-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoAlmost ready for 2.9-rc2
Junio C Hamano [Fri, 3 Jun 2016 21:38:35 +0000 (14:38 -0700)]
Almost ready for 2.9-rc2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'rs/apply-name-terminate'
Junio C Hamano [Fri, 3 Jun 2016 21:38:04 +0000 (14:38 -0700)]
Merge branch 'rs/apply-name-terminate'

Code clean-up.

* rs/apply-name-terminate:
  apply: remove unused parameters from name_terminate()

8 years agoMerge branch 'rs/patch-id-use-skip-prefix'
Junio C Hamano [Fri, 3 Jun 2016 21:38:03 +0000 (14:38 -0700)]
Merge branch 'rs/patch-id-use-skip-prefix'

Code clean-up.

* rs/patch-id-use-skip-prefix:
  patch-id: use starts_with() and skip_prefix()

8 years agoMerge branch 'bd/readme.markdown-more'
Junio C Hamano [Fri, 3 Jun 2016 21:38:02 +0000 (14:38 -0700)]
Merge branch 'bd/readme.markdown-more'

The mark-up in the top-level README.md file has been updated to
typeset CLI command names differently from the body text.

* bd/readme.markdown-more:
  README.md: format CLI commands with code syntax

8 years agoMerge branch 'mm/makefile-developer-can-be-in-config-mak'
Junio C Hamano [Fri, 3 Jun 2016 21:38:02 +0000 (14:38 -0700)]
Merge branch 'mm/makefile-developer-can-be-in-config-mak'

"make DEVELOPER=1" worked as expected; setting DEVELOPER=1 in
config.mak didn't.

* mm/makefile-developer-can-be-in-config-mak:
  Makefile: add $(DEVELOPER_CFLAGS) variable
  Makefile: move 'ifdef DEVELOPER' after config.mak* inclusion

8 years agoMerge branch 'em/man-bold-literal'
Junio C Hamano [Fri, 3 Jun 2016 21:38:02 +0000 (14:38 -0700)]
Merge branch 'em/man-bold-literal'

The manpage output of our documentation did not render well in
terminal; typeset literals in bold by default to make them stand
out more.

* em/man-bold-literal:
  Documentation: bold literals in man

8 years agoMerge branch 'pa/cherry-pick-doc-typo'
Junio C Hamano [Fri, 3 Jun 2016 21:38:02 +0000 (14:38 -0700)]
Merge branch 'pa/cherry-pick-doc-typo'

"git cherry-pick --help" had three instances of word "behavior",
one of which was spelled "behaviour", which is updated to match the
other two.

* pa/cherry-pick-doc-typo:
  git-cherry-pick.txt: correct a small typo

8 years agoMerge branch 'mr/send-email-doc-gmail-2fa'
Junio C Hamano [Fri, 3 Jun 2016 21:38:01 +0000 (14:38 -0700)]
Merge branch 'mr/send-email-doc-gmail-2fa'

Typofix.

* mr/send-email-doc-gmail-2fa:
  Documentation/git-send-email: fix typo in gmail 2FA section

8 years agoMerge branch 'js/rebase-i-dedup-call-to-rerere'
Junio C Hamano [Fri, 3 Jun 2016 21:38:01 +0000 (14:38 -0700)]
Merge branch 'js/rebase-i-dedup-call-to-rerere'

"git rebase -i", after it fails to auto-resolve the conflict, had
an unnecessary call to "git rerere" from its very early days, which
was spotted recently; the call has been removed.

* js/rebase-i-dedup-call-to-rerere:
  rebase -i: remove an unnecessary 'rerere' invocation

8 years agoMerge branch 'js/perf-rebase-i'
Junio C Hamano [Fri, 3 Jun 2016 21:38:00 +0000 (14:38 -0700)]
Merge branch 'js/perf-rebase-i'

The one in 'master' has a brown-paper-bag bug that breaks the perf
test when used inside a usual Git repository with a working tree.

* js/perf-rebase-i:
  perf: make the tests work without a worktree

8 years agobuiltin/apply: move 'newfd' global into 'struct apply_state'
Christian Couder [Fri, 3 Jun 2016 16:58:52 +0000 (18:58 +0200)]
builtin/apply: move 'newfd' global into 'struct apply_state'

To libify the apply functionality the 'newfd' variable should
not be static and global to the file. Let's move it into
'struct apply_state'.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agobuiltin/apply: add 'lock_file' pointer into 'struct apply_state'
Christian Couder [Fri, 3 Jun 2016 16:58:51 +0000 (18:58 +0200)]
builtin/apply: add 'lock_file' pointer into 'struct apply_state'

We cannot have a 'struct lock_file' allocated on the stack, as lockfile.c
keeps a linked list of all created lock_file structures.

Also 'struct apply_state' users might later want the same 'struct lock_file'
instance to be reused by different series of calls to the apply api.

So let's add a 'struct lock_file *lock_file' pointer into 'struct apply_state'
and have the user of 'struct apply_state' allocate memory for the actual
'struct lock_file' instance.

Let's also add an argument to init_apply_state(), so that the caller can
easily supply a pointer to the allocated instance.

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agorev-list: disable bitmaps when "-n" is used with listing objects
Jeff King [Fri, 3 Jun 2016 07:08:05 +0000 (03:08 -0400)]
rev-list: disable bitmaps when "-n" is used with listing objects

You can ask rev-list to use bitmaps to speed up an --objects
traversal, which should generally give you your answers much
faster.

Likewise, you can ask rev-list to limit such a traversal
with `-n`, in which case we'll show only a limited set of
commits (and only the tree and commit objects directly
reachable from those commits).

But if you do both together, the results are nonsensical. We
end up limiting any fallback traversal we do to _find_ the
bitmaps, but the actual set of objects we output will be
picked arbitrarily from the union of any bitmaps we do find,
and will involve the objects of many more commits.

It's possible that somebody might want this as a "show me
what you can, but limit the amount of work you do" flag.
But as with the prior commit clamping "--count", the results
are basically non-deterministic; you'll get the values from
some commits between `n` and the total number, and you can't
tell which.

And unlike the `--count` case, we can't easily generate the
"real" value from the bitmap values (you can't just walk
back `-n` commits and subtract out the reachable objects
from the boundary commits; the bitmaps for `X` record its
total reachability, so you don't know which objects are
directly from `X` itself, which from `X^`, and so on).

So let's just fallback to the non-bitmap code path in this
case, so we always give a sane answer.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agorev-list: "adjust" results of "--count --use-bitmap-index -n"
Jeff King [Fri, 3 Jun 2016 07:07:34 +0000 (03:07 -0400)]
rev-list: "adjust" results of "--count --use-bitmap-index -n"

If you ask rev-list for:

    git rev-list --count --use-bitmap-index HEAD

we optimize out the actual traversal and just give you the
number of bits set in the commit bitmap. This is faster,
which is good.

But if you ask to limit the size of the traversal, like:

    git rev-list --count --use-bitmap-index -n 100 HEAD

we'll still output the full bitmapped number we found. On
the surface, that might even seem OK. You explicitly asked
to use the bitmap index, and it was cheap to compute the
real answer, so we gave it to you.

But there's something much more complicated going on under
the hood. If we don't have a bitmap directly for HEAD, then
we have to actually traverse backwards, looking for a
bitmapped commit. And _that_ traversal is bounded by our
`-n` count.

This is a good thing, because it bounds the work we have to
do, which is probably what the user wanted by asking for
`-n`. But now it makes the output quite confusing. You might
get many values:

  - your `-n` value, if we walked back and never found a
    bitmap (or fewer if there weren't that many commits)

  - the actual full count, if we found a bitmap root for
    every path of our traversal with in the `-n` limit

  - any number in between! We might have walked back and
    found _some_ bitmaps, but then cut off the traversal
    early with some commits not accounted for in the result.

So you cannot even see a value higher than your `-n` and say
"OK, bitmaps kicked in, this must be the real full count".
The only sane thing is for git to just clamp the value to a
maximum of the `-n` value, which means we should output the
exact same results whether bitmaps are in use or not.

The test in t5310 demonstrates this by using `-n 1`.
Without this patch we fail in the full-bitmap case (where we
do not have to traverse at all) but _not_ in the
partial-bitmap case (where we have to walk down to find an
actual bitmap). With this patch, both cases just work.

I didn't implement the crazy in-between case, just because
it's complicated to set up, and is really a subset of the
full-count case, which we do cover.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agopathspec: rename free_pathspec() to clear_pathspec()
Junio C Hamano [Thu, 2 Jun 2016 21:09:22 +0000 (14:09 -0700)]
pathspec: rename free_pathspec() to clear_pathspec()

The function takes a pointer to a pathspec structure, and releases
the resources held by it, but does not free() the structure itself.
Such a function should be called "clear", not "free".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoDocumentation/git-send-email: fix typo in gmail 2FA section
SZEDER Gábor [Wed, 1 Jun 2016 23:37:41 +0000 (01:37 +0200)]
Documentation/git-send-email: fix typo in gmail 2FA section

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agot2300: run git-sh-setup in an environment that better mimics the real life
Junio C Hamano [Wed, 1 Jun 2016 20:30:47 +0000 (13:30 -0700)]
t2300: run git-sh-setup in an environment that better mimics the real life

When we run scripted Porcelains, "git" potty has set up the $PATH by
prepending $GIT_EXEC_PATH, the path given by "git --exec-path=$there
$cmd", etc. already.  Because of this, scripted Porcelains can
dot-source shell script library like git-sh-setup with simple dot
without specifying any path.

t2300 however dot-sources git-sh-setup without adjusting $PATH like
the real "git" potty does.  This has not been a problem so far, but
once git-sh-setup wants to rely on the $PATH adjustment, just like
any scripted Porcelains already do, it would become one.  It cannot
for example dot-source another shell library without specifying the
full path to it by prefixing $(git --exec-path).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agot5500 & t7403: lose bash-ism "local"
Junio C Hamano [Wed, 1 Jun 2016 20:56:08 +0000 (13:56 -0700)]
t5500 & t7403: lose bash-ism "local"

In t5500::check_prot_host_port_path(), diagport is not a variable
used elsewhere and the function is not recursively called so this
can simply lose the "local", which may not be supported by shell
(besides, the function liberally clobbers other variables without
making them "local").

t7403::reset_submodule_urls() overrides the "root" variable used
in the test framework for no good reason; its use is not about
temporarily relocating where the test repositories are created.
This assignment can be made not to clobber the variable by moving
them into the subshells it already uses.  Its value is always
$TRASH_DIRECTORY, so we could use it instead there, and this
function that is called only once and its two subshells may not be
necessary (instead, the caller can use "git -C $there config" and
set a value that is derived from $TRASH_DIRECTORY), but this is a
minimum fix that is needed to lose "local".

Helped-by: John Keeping <john@keeping.me.uk>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agosubmodule: remove bashism from shell script
Stefan Beller [Wed, 1 Jun 2016 00:27:59 +0000 (17:27 -0700)]
submodule: remove bashism from shell script

Junio pointed out `relative_path` was using bashisms via the
local variables. As the longer term goal is to rewrite most of the
submodule code in C, do it now.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agosubmodule--helper: offer a consistent API
Stefan Beller [Tue, 31 May 2016 23:59:33 +0000 (16:59 -0700)]
submodule--helper: offer a consistent API

In 48308681 (2016-02-29, git submodule update: have a dedicated helper
for cloning), the helper communicated errors back only via exit code,
and dance with printing '#unmatched' in case of error was left to
git-submodule.sh as it uses the output of the helper and pipes it into
shell commands. This change makes the helper consistent by never
printing '#unmatched' in the helper but always handling these piping
issues in the actual shell script.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agobuiltin/apply: move applying patches into apply_all_patches()
Christian Couder [Tue, 24 May 2016 08:11:24 +0000 (10:11 +0200)]
builtin/apply: move applying patches into apply_all_patches()

To libify the apply functionality we should provide a function to
apply many patches. Let's move the code to do that into a new
apply_all_patches() function.

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agobuiltin/apply: move 'state' check into check_apply_state()
Christian Couder [Tue, 24 May 2016 08:11:23 +0000 (10:11 +0200)]
builtin/apply: move 'state' check into check_apply_state()

To libify the apply functionality we should provide a function
to check that the values in a 'struct apply_state' instance are
coherent. Let's move the code to do that into a new
check_apply_state() function.

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