OSDN Git Service

git-core/git.git
9 years agoMerge branch 'nd/untracked-cache'
Junio C Hamano [Wed, 24 Jun 2015 19:21:49 +0000 (12:21 -0700)]
Merge branch 'nd/untracked-cache'

Hotfix for the 'untracked-cache' topic that is already in 'master'.

* nd/untracked-cache:
  read-cache: fix untracked cache invalidation when split-index is used

9 years agoMerge branch 'mh/fsck-reflog-entries'
Junio C Hamano [Wed, 24 Jun 2015 19:21:48 +0000 (12:21 -0700)]
Merge branch 'mh/fsck-reflog-entries'

"git fsck" used to ignore missing or invalid objects recorded in reflog.

* mh/fsck-reflog-entries:
  fsck: report errors if reflog entries point at invalid objects
  fsck_handle_reflog_sha1(): new function

9 years agoMerge branch 'js/sleep-without-select'
Junio C Hamano [Wed, 24 Jun 2015 19:21:47 +0000 (12:21 -0700)]
Merge branch 'js/sleep-without-select'

Portability fix.

* js/sleep-without-select:
  lockfile: wait using sleep_millisec() instead of select()
  lockfile: convert retry timeout computations to millisecond
  help.c: wrap wait-only poll() invocation in sleep_millisec()
  lockfile: replace random() by rand()

9 years agoMerge branch 'es/utf8-stupid-compiler-workaround'
Junio C Hamano [Wed, 24 Jun 2015 19:21:46 +0000 (12:21 -0700)]
Merge branch 'es/utf8-stupid-compiler-workaround'

A compilation workaround.

* es/utf8-stupid-compiler-workaround:
  utf8: NO_ICONV: silence uninitialized variable warning

9 years agoMerge branch 'rl/am-3way-config'
Junio C Hamano [Wed, 24 Jun 2015 19:21:45 +0000 (12:21 -0700)]
Merge branch 'rl/am-3way-config'

"git am" learned am.threeWay configuration variable.

* rl/am-3way-config:
  git-am: add am.threeWay config variable
  t4150-am: refactor am -3 tests
  git-am.sh: fix initialization of the threeway variable

9 years agoMerge branch 'jc/ll-merge-expose-path'
Junio C Hamano [Wed, 24 Jun 2015 19:21:45 +0000 (12:21 -0700)]
Merge branch 'jc/ll-merge-expose-path'

Traditionally, external low-level 3-way merge drivers are expected
to produce their results based solely on the contents of the three
variants given in temporary files named by %O, %A and %B on their
command line.  Additionally allow them to look at the final path
(given by %P).

* jc/ll-merge-expose-path:
  ll-merge: pass the original path to external drivers

9 years agoMerge branch 'es/osx-header-pollutes-mask-macro'
Junio C Hamano [Wed, 24 Jun 2015 19:21:44 +0000 (12:21 -0700)]
Merge branch 'es/osx-header-pollutes-mask-macro'

* es/osx-header-pollutes-mask-macro:
  ewah: use less generic macro name
  ewah/bitmap: silence warning about MASK macro redefinition

9 years agoMerge branch 'es/configure-getdelim'
Junio C Hamano [Wed, 24 Jun 2015 19:21:43 +0000 (12:21 -0700)]
Merge branch 'es/configure-getdelim'

Auto-detect availability of getdelim() that helps optimized version
of strbuf_getwholeline().

* es/configure-getdelim:
  configure: add getdelim() check
  config.mak.uname: Darwin: define HAVE_GETDELIM for modern OS X releases

9 years agoMerge branch 'pt/pull-optparse'
Junio C Hamano [Wed, 24 Jun 2015 19:21:42 +0000 (12:21 -0700)]
Merge branch 'pt/pull-optparse'

"git pull" has become more aware of the options meant for
underlying "git fetch" and then learned to use parse-options
parser.

* pt/pull-optparse:
  pull: use git-rev-parse --parseopt for option parsing
  pull: handle git-fetch's options as well

9 years agoMerge branch 'qn/blame-show-email'
Junio C Hamano [Wed, 24 Jun 2015 19:21:41 +0000 (12:21 -0700)]
Merge branch 'qn/blame-show-email'

"git blame" learned blame.showEmail configuration variable.

* qn/blame-show-email:
  blame: add blame.showEmail configuration

9 years agoMerge branch 'jc/do-not-feed-tags-to-clear-commit-marks'
Junio C Hamano [Wed, 24 Jun 2015 19:21:40 +0000 (12:21 -0700)]
Merge branch 'jc/do-not-feed-tags-to-clear-commit-marks'

"git format-patch --ignore-if-upstream A..B" did not like to be fed
tags as boundary commits.

* jc/do-not-feed-tags-to-clear-commit-marks:
  format-patch: do not feed tags to clear_commit_marks()

9 years agoMerge branch 'es/send-email-sendmail-alias'
Junio C Hamano [Wed, 24 Jun 2015 19:21:39 +0000 (12:21 -0700)]
Merge branch 'es/send-email-sendmail-alias'

"git send-email" learned to handle more forms of sendmail style
aliases file.

* es/send-email-sendmail-alias:
  send-email: further warn about unsupported sendmail aliases features
  t9001: add sendmail aliases line continuation tests
  t9001: refactor sendmail aliases test infrastructure
  send-email: implement sendmail aliases line continuation support
  send-email: simplify sendmail aliases comment and blank line recognizer
  send-email: refactor sendmail aliases parser
  send-email: fix style: cuddle 'elsif' and 'else' with closing brace
  send-email: drop noise comments which merely repeat what code says
  send-email: visually distinguish sendmail aliases parser warnings
  send-email: further document missing sendmail aliases functionality

9 years agoMerge branch 'jc/apply-reject-noop-hunk'
Junio C Hamano [Wed, 24 Jun 2015 19:21:39 +0000 (12:21 -0700)]
Merge branch 'jc/apply-reject-noop-hunk'

"git apply" cannot diagnose a patch corruption when the breakage is
to mark the length of the hunk shorter than it really is on the
hunk header line "@@ -l,k +m,n @@"; one special case it could is
when the hunk becomes no-op (e.g. k == n == 2 for two-line context
patch output), and it learned how to do so.

* jc/apply-reject-noop-hunk:
  apply: reject a hunk that does not do anything

9 years agogit-multimail: update to release 1.1.0
Matthieu Moy [Thu, 18 Jun 2015 08:46:04 +0000 (10:46 +0200)]
git-multimail: update to release 1.1.0

The changes are described in CHANGES.

Contributions-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Contributions-by: Richard Hansen <rhansen@rhansen.org>
Contributions-by: Michael Haggerty <mhagger@alum.mit.edu>
Contributions-by: Elijah Newren <newren@gmail.com>
Contributions-by: Luke Mewburn <luke@mewburn.net>
Contributions-by: Dave Boutcher <daveboutcher@gmail.com>
Contributions-by: Azat Khuzhin <a3at.mail@gmail.com>
Contributions-by: Sebastian Schuberth <sschuberth@gmail.com>
Contributions-by: Mikko Johannes Koivunalho <mikko.koivunalho@iki.fi>
Contributions-by: Elijah Newren <newren@palantir.com>
Contributions-by: BenoƮt Ryder <benoit@ryder.fr>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoEighth batch for 2.5
Junio C Hamano [Tue, 16 Jun 2015 21:39:31 +0000 (14:39 -0700)]
Eighth batch for 2.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoSync with 2.4.4
Junio C Hamano [Tue, 16 Jun 2015 21:39:01 +0000 (14:39 -0700)]
Sync with 2.4.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoGit 2.4.4 v2.4.4
Junio C Hamano [Tue, 16 Jun 2015 21:38:01 +0000 (14:38 -0700)]
Git 2.4.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'jk/clone-dissociate' into maint
Junio C Hamano [Tue, 16 Jun 2015 21:33:52 +0000 (14:33 -0700)]
Merge branch 'jk/clone-dissociate' into maint

Code clean-up.

* jk/clone-dissociate:
  clone: reorder --dissociate and --reference options
  clone: use OPT_STRING_LIST for --reference

9 years agoMerge branch 'sb/submodule-doc-intro' into maint
Junio C Hamano [Tue, 16 Jun 2015 21:33:52 +0000 (14:33 -0700)]
Merge branch 'sb/submodule-doc-intro' into maint

* sb/submodule-doc-intro:
  submodule doc: reorder introductory paragraphs

9 years agoMerge branch 'sb/glossary-submodule' into maint
Junio C Hamano [Tue, 16 Jun 2015 21:33:51 +0000 (14:33 -0700)]
Merge branch 'sb/glossary-submodule' into maint

* sb/glossary-submodule:
  glossary: add "remote", "submodule", "superproject"

9 years agoMerge branch 'ah/usage-strings' into maint
Junio C Hamano [Tue, 16 Jun 2015 21:33:50 +0000 (14:33 -0700)]
Merge branch 'ah/usage-strings' into maint

A few usage string updates.

* ah/usage-strings:
  blame, log: format usage strings similarly to those in documentation

9 years agoMerge branch 'mc/commit-doc-grammofix' into maint
Junio C Hamano [Tue, 16 Jun 2015 21:33:49 +0000 (14:33 -0700)]
Merge branch 'mc/commit-doc-grammofix' into maint

Doc grammar fix.

* mc/commit-doc-grammofix:
  Documentation/git-commit: grammofix

9 years agoMerge branch 'rs/janitorial' into maint
Junio C Hamano [Tue, 16 Jun 2015 21:33:47 +0000 (14:33 -0700)]
Merge branch 'rs/janitorial' into maint

Code clean-up.

* rs/janitorial:
  dir: remove unused variable sb
  clean: remove unused variable buf
  use file_exists() to check if a file exists in the worktree

9 years agoMerge branch 'sb/test-bitmap-free-at-end' into maint
Junio C Hamano [Tue, 16 Jun 2015 21:33:47 +0000 (14:33 -0700)]
Merge branch 'sb/test-bitmap-free-at-end' into maint

An earlier leakfix to bitmap testing code was incomplete.

* sb/test-bitmap-free-at-end:
  test_bitmap_walk: free bitmap with bitmap_free

9 years agoMerge branch 'dt/clean-pathspec-filter-then-lstat' into maint
Junio C Hamano [Tue, 16 Jun 2015 21:33:46 +0000 (14:33 -0700)]
Merge branch 'dt/clean-pathspec-filter-then-lstat' into maint

"git clean pathspec..." tried to lstat(2) and complain even for
paths outside the given pathspec.

* dt/clean-pathspec-filter-then-lstat:
  clean: only lstat files in pathspec

9 years agoMerge branch 'jk/http-backend-deadlock' into maint
Junio C Hamano [Tue, 16 Jun 2015 21:33:45 +0000 (14:33 -0700)]
Merge branch 'jk/http-backend-deadlock' into maint

Communication between the HTTP server and http_backend process can
lead to a dead-lock when relaying a large ref negotiation request.
Diagnose the situation better, and mitigate it by reading such a
request first into core (to a reasonable limit).

* jk/http-backend-deadlock:
  http-backend: spool ref negotiation requests to buffer
  t5551: factor out tag creation
  http-backend: fix die recursion with custom handler

9 years agoMerge branch 'jh/filter-empty-contents' into maint
Junio C Hamano [Tue, 16 Jun 2015 21:33:44 +0000 (14:33 -0700)]
Merge branch 'jh/filter-empty-contents' into maint

The clean/smudge interface did not work well when filtering an
empty contents (failed and then passed the empty input through).
It can be argued that a filter that produces anything but empty for
an empty input is nonsense, but if the user wants to do strange
things, then why not?

* jh/filter-empty-contents:
  sha1_file: pass empty buffer to index empty file

9 years agoMerge branch 'jk/stash-options' into maint
Junio C Hamano [Tue, 16 Jun 2015 21:33:43 +0000 (14:33 -0700)]
Merge branch 'jk/stash-options' into maint

Make "git stash something --help" error out, so that users can
safely say "git stash drop --help".

* jk/stash-options:
  stash: recognize "--help" for subcommands
  stash: complain about unknown flags

9 years agoMerge branch 'mm/log-format-raw-doc' into maint
Junio C Hamano [Tue, 16 Jun 2015 21:33:42 +0000 (14:33 -0700)]
Merge branch 'mm/log-format-raw-doc' into maint

Clarify that "log --raw" and "log --format=raw" are unrelated
concepts.

* mm/log-format-raw-doc:
  Documentation/log: clarify sha1 non-abbreviation in log --raw
  Documentation/log: clarify what --raw means

9 years agoMerge branch 'ep/do-not-feed-a-pointer-to-array-size' into maint
Junio C Hamano [Tue, 16 Jun 2015 21:33:41 +0000 (14:33 -0700)]
Merge branch 'ep/do-not-feed-a-pointer-to-array-size' into maint

Catch a programmer mistake to feed a pointer not an array to
ARRAY_SIZE() macro, by using a couple of GCC extensions.

* ep/do-not-feed-a-pointer-to-array-size:
  git-compat-util.h: implement a different ARRAY_SIZE macro for for safely deriving the size of array

9 years agoMerge branch 'nd/slim-index-pack-memory-usage'
Junio C Hamano [Tue, 16 Jun 2015 21:27:08 +0000 (14:27 -0700)]
Merge branch 'nd/slim-index-pack-memory-usage'

An earlier optimization broke index-pack for a large object
transfer; this fixes it before the breakage hits any released
version.

* nd/slim-index-pack-memory-usage:
  index-pack: fix truncation of off_t in comparison

9 years agoMerge branch 'sb/pack-protocol-mention-smart-http'
Junio C Hamano [Tue, 16 Jun 2015 21:27:07 +0000 (14:27 -0700)]
Merge branch 'sb/pack-protocol-mention-smart-http'

Doc updates.

* sb/pack-protocol-mention-smart-http:
  Documentation/technical/pack-protocol: mention http as possible protocol

9 years agoMerge branch 'jk/make-fix-dependencies'
Junio C Hamano [Tue, 16 Jun 2015 21:27:06 +0000 (14:27 -0700)]
Merge branch 'jk/make-fix-dependencies'

Build clean-up.

* jk/make-fix-dependencies:
  Makefile: silence perl/PM.stamp recipe
  Makefile: avoid timestamp updates to GIT-BUILD-OPTIONS
  Makefile: drop dependency between git-instaweb and gitweb

9 years agoMerge branch 'jk/die-on-bogus-worktree-late'
Junio C Hamano [Tue, 16 Jun 2015 21:27:06 +0000 (14:27 -0700)]
Merge branch 'jk/die-on-bogus-worktree-late'

The setup code used to die when core.bare and core.worktree are set
inconsistently, even for commands that do not need working tree.

* jk/die-on-bogus-worktree-late:
  setup_git_directory: delay core.bare/core.worktree errors

9 years agoMerge branch 'sg/merge-summary-config'
Junio C Hamano [Tue, 16 Jun 2015 21:27:05 +0000 (14:27 -0700)]
Merge branch 'sg/merge-summary-config'

Doc updates.

* sg/merge-summary-config:
  Documentation: include 'merge.branchdesc' for merge and config as well

9 years agoMerge branch 'ah/send-email-sendmail-alias'
Junio C Hamano [Tue, 16 Jun 2015 21:27:04 +0000 (14:27 -0700)]
Merge branch 'ah/send-email-sendmail-alias'

"git send-email" learned the alias file format used by the sendmail
program (in an abbreviated form).

* ah/send-email-sendmail-alias:
  t9001: write $HOME/, not ~/, to help shells without tilde expansion
  send-email: add sendmail email aliases format

9 years agoMerge tag 'l10n-2.4-maint-de-updates' of git://github.com/git-l10n/git-po into maint
Junio C Hamano [Sun, 14 Jun 2015 21:24:49 +0000 (14:24 -0700)]
Merge tag 'l10n-2.4-maint-de-updates' of git://github.com/git-l10n/git-po into maint

l10n-2.4-maint-de-updates

* tag 'l10n-2.4-maint-de-updates' of git://github.com/git-l10n/git-po:
  l10n: de.po: translation fix for fall-back to 3way merge
  l10n: de.po: punctuation fixes
  l10n: de.po: grammar fix
  l10n: de.po: change error message from "sagen" to "Meinten Sie"

9 years agol10n: de.po: translation fix for fall-back to 3way merge
Michael J Gruber [Tue, 19 May 2015 08:51:34 +0000 (10:51 +0200)]
l10n: de.po: translation fix for fall-back to 3way merge

The English version is correct, but misleading: It is not the 3way merge
that is being patched also, but that is being fallen back to also.

The German version translates the former meaning. Make it translate the
latter.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
9 years agol10n: de.po: punctuation fixes
Michael J Gruber [Tue, 19 May 2015 08:51:33 +0000 (10:51 +0200)]
l10n: de.po: punctuation fixes

This respects the ellipsis style used in de.po.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
9 years agol10n: de.po: grammar fix
Michael J Gruber [Tue, 19 May 2015 08:51:32 +0000 (10:51 +0200)]
l10n: de.po: grammar fix

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
9 years agol10n: de.po: change error message from "sagen" to "Meinten Sie"
Phillip Sz [Sat, 9 May 2015 11:28:55 +0000 (13:28 +0200)]
l10n: de.po: change error message from "sagen" to "Meinten Sie"

We should not use "sagen" if someone has written something wrong.
Although it's "say" in English, we should not use it in German
and instead use our normal error message.

Signed-off-by: Phillip Sz <phillip.szelat@gmail.com>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
9 years agoSecond half of seventh batch
Junio C Hamano [Thu, 11 Jun 2015 16:35:25 +0000 (09:35 -0700)]
Second half of seventh batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'tb/complete-sequencing'
Junio C Hamano [Thu, 11 Jun 2015 16:29:59 +0000 (09:29 -0700)]
Merge branch 'tb/complete-sequencing'

The bash completion script (in contrib/) learned a few options that
"git revert" takes.

* tb/complete-sequencing:
  completion: suggest sequencer commands for revert

9 years agoMerge branch 'jk/squelch-missing-link-warning-for-unreachable'
Junio C Hamano [Thu, 11 Jun 2015 16:29:58 +0000 (09:29 -0700)]
Merge branch 'jk/squelch-missing-link-warning-for-unreachable'

Recent "git prune" traverses young unreachable objects to safekeep
old objects in the reachability chain from them, which sometimes
caused error messages that are unnecessarily alarming.

* jk/squelch-missing-link-warning-for-unreachable:
  suppress errors on missing UNINTERESTING links
  silence broken link warnings with revs->ignore_missing_links
  add quieter versions of parse_{tree,commit}

9 years agoMerge branch 'pt/pull-tests'
Junio C Hamano [Thu, 11 Jun 2015 16:29:58 +0000 (09:29 -0700)]
Merge branch 'pt/pull-tests'

Add more test coverage to "git pull".

* pt/pull-tests:
  t5520: check reflog action in fast-forward merge
  t5521: test --dry-run does not make any changes
  t5520: test --rebase failure on unborn branch with index
  t5520: test --rebase with multiple branches
  t5520: test work tree fast-forward when fetch updates head
  t5520: test for failure if index has unresolved entries
  t5520: test no merge candidates cases
  t5520: prevent field splitting in content comparisons

9 years agoMerge branch 'sb/glossary-submodule'
Junio C Hamano [Thu, 11 Jun 2015 16:29:57 +0000 (09:29 -0700)]
Merge branch 'sb/glossary-submodule'

* sb/glossary-submodule:
  glossary: add "remote", "submodule", "superproject"

9 years agoMerge branch 'sb/submodule-doc-intro'
Junio C Hamano [Thu, 11 Jun 2015 16:29:56 +0000 (09:29 -0700)]
Merge branch 'sb/submodule-doc-intro'

* sb/submodule-doc-intro:
  submodule doc: reorder introductory paragraphs

9 years agoMerge branch 'jk/diagnose-config-mmap-failure'
Junio C Hamano [Thu, 11 Jun 2015 16:29:55 +0000 (09:29 -0700)]
Merge branch 'jk/diagnose-config-mmap-failure'

The configuration reader/writer uses mmap(2) interface to access
the files; when we find a directory, it barfed with "Out of memory?".

* jk/diagnose-config-mmap-failure:
  xmmap(): drop "Out of memory?"
  config.c: rewrite ENODEV into EISDIR when mmap fails
  config.c: avoid xmmap error messages
  config.c: fix mmap leak when writing config
  read-cache.c: drop PROT_WRITE from mmap of index

9 years agoMerge branch 'mt/p4-depotFile-at-version'
Junio C Hamano [Thu, 11 Jun 2015 16:29:55 +0000 (09:29 -0700)]
Merge branch 'mt/p4-depotFile-at-version'

* mt/p4-depotFile-at-version:
  p4: retrieve the right revision of the file in UTF-16 codepath

9 years agoMerge branch 'mh/verify-lock-error-report'
Junio C Hamano [Thu, 11 Jun 2015 16:29:54 +0000 (09:29 -0700)]
Merge branch 'mh/verify-lock-error-report'

Bring consistency to error reporting mechanism used in "refs" API.

* mh/verify-lock-error-report:
  ref_transaction_commit(): do not capitalize error messages
  verify_lock(): do not capitalize error messages
  verify_lock(): report errors via a strbuf
  verify_lock(): on errors, let the caller unlock the lock
  verify_lock(): return 0/-1 rather than struct ref_lock *

9 years agoMerge branch 'jk/color-diff-plain-is-context'
Junio C Hamano [Thu, 11 Jun 2015 16:29:53 +0000 (09:29 -0700)]
Merge branch 'jk/color-diff-plain-is-context'

"color.diff.plain" was a misnomer; give it 'color.diff.context' as
a more logical synonym.

* jk/color-diff-plain-is-context:
  diff.h: rename DIFF_PLAIN color slot to DIFF_CONTEXT
  diff: accept color.diff.context as a synonym for "plain"

9 years agoMerge branch 'jk/clone-dissociate'
Junio C Hamano [Thu, 11 Jun 2015 16:29:52 +0000 (09:29 -0700)]
Merge branch 'jk/clone-dissociate'

Code clean-up.

* jk/clone-dissociate:
  clone: reorder --dissociate and --reference options
  clone: use OPT_STRING_LIST for --reference

9 years agoMerge branch 'jc/diff-ws-error-highlight'
Junio C Hamano [Thu, 11 Jun 2015 16:29:51 +0000 (09:29 -0700)]
Merge branch 'jc/diff-ws-error-highlight'

Allow whitespace breakages in deleted and context lines to be also
painted in the output.

* jc/diff-ws-error-highlight:
  diff.c: --ws-error-highlight=<kind> option
  diff.c: add emit_del_line() and emit_context_line()
  t4015: separate common setup and per-test expectation
  t4015: modernise style

9 years agofsck: report errors if reflog entries point at invalid objects
Michael Haggerty [Mon, 8 Jun 2015 13:40:05 +0000 (15:40 +0200)]
fsck: report errors if reflog entries point at invalid objects

Previously, if a reflog entry's old or new SHA-1 was not resolvable to
an object, that SHA-1 was silently ignored. Instead, report such cases
as errors.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agofsck_handle_reflog_sha1(): new function
Michael Haggerty [Mon, 8 Jun 2015 13:40:04 +0000 (15:40 +0200)]
fsck_handle_reflog_sha1(): new function

New function, extracted from fsck_handle_reflog_ent(). The extra
is_null_sha1() test for the new reference is currently unnecessary, as
reflogs are deleted when the reference itself is deleted. But it
doesn't hurt, either.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoread-cache: fix untracked cache invalidation when split-index is used
Nguyį»…n ThĆ”i Ngį»c Duy [Sun, 7 Jun 2015 10:40:52 +0000 (17:40 +0700)]
read-cache: fix untracked cache invalidation when split-index is used

Before this change, t7063.17 fails. The actual action though happens at
t7063.16 where the entry "two" is added back to index after being
removed in the .13. Here we expect a directory invalidate at .16 and
none at .17 where untracked cache is refreshed. But things do not go as
expected when GIT_TEST_SPLIT_INDEX is set.

The different behavior that happens at .16 when split index is used: the
entry "two", when deleted at .13, is simply marked "deleted". When .16
executes, the entry resurfaces from the version in base index. This
happens in merge_base_index() where add_index_entry() is called to add
"two" back from the base index.

This is where the bug comes from. The add_index_entry() is called with
ADD_CACHE_KEEP_CACHE_TREE flag because this version of "two" is not new,
it does not break either cache-tree or untracked cache. The code should
check this flag and not invalidate untracked cache. This causes a second
invalidation violates test expectation. The fix is obvious.

Noticed-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Nguyį»…n ThĆ”i Ngį»c Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoutf8: NO_ICONV: silence uninitialized variable warning
Eric Sunshine [Fri, 5 Jun 2015 06:42:16 +0000 (02:42 -0400)]
utf8: NO_ICONV: silence uninitialized variable warning

The last argument of reencode_string_len() is an 'int *' which is
assigned the length of the converted string. When NO_ICONV is defined,
however, reencode_string_len() is stubbed out by the macro:

    #define reencode_string_len(a,b,c,d,e) NULL

which never assigns a value to the final argument. When called like
this:

    int n;
    char *s = reencode_string_len(..., &n);
    if (s)
        do_something(s, n);

some compilers complain that 'n' is used uninitialized within the
conditional.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agolockfile: wait using sleep_millisec() instead of select()
Johannes Sixt [Fri, 5 Jun 2015 19:45:07 +0000 (21:45 +0200)]
lockfile: wait using sleep_millisec() instead of select()

Use the new function sleep_millisec() to delay execution for a short
time. This avoids the invocation of select() with just a timeout, but
no file descriptors. Such a use of select() is quit with EINVAL on
Windows, leading to no delay at all.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agolockfile: convert retry timeout computations to millisecond
Johannes Sixt [Fri, 5 Jun 2015 19:45:06 +0000 (21:45 +0200)]
lockfile: convert retry timeout computations to millisecond

When the goal is to wait for some random amount of time up to one
second, it is not necessary to compute with microsecond precision.
This is a preparation to re-use sleep_millisec().

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agohelp.c: wrap wait-only poll() invocation in sleep_millisec()
Johannes Sixt [Fri, 5 Jun 2015 19:45:05 +0000 (21:45 +0200)]
help.c: wrap wait-only poll() invocation in sleep_millisec()

We want to use the new function elsewhere in a moment.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agolockfile: replace random() by rand()
Johannes Sixt [Fri, 5 Jun 2015 19:45:04 +0000 (21:45 +0200)]
lockfile: replace random() by rand()

On Windows, we do not have functions srandom() and random(). Use srand()
and rand(). These functions produce random numbers of lesser quality,
but for the purpose (a retry time-out) they are still good enough.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoSync with 2.4.3
Junio C Hamano [Fri, 5 Jun 2015 19:23:18 +0000 (12:23 -0700)]
Sync with 2.4.3

9 years agoGit 2.4.3 v2.4.3
Junio C Hamano [Fri, 5 Jun 2015 19:15:57 +0000 (12:15 -0700)]
Git 2.4.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoThe first half of the seventh batch for 2.5
Junio C Hamano [Fri, 5 Jun 2015 19:20:57 +0000 (12:20 -0700)]
The first half of the seventh batch for 2.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'ld/p4-editor-multi-words'
Junio C Hamano [Fri, 5 Jun 2015 19:17:38 +0000 (12:17 -0700)]
Merge branch 'ld/p4-editor-multi-words'

Unlike "$EDITOR" and "$GIT_EDITOR" that can hold the path to the
command and initial options (e.g. "/path/to/emacs -nw"), 'git p4'
did not let the shell interpolate the contents of the environment
variable that name the editor "$P4EDITOR" (and "$EDITOR", too).
Make it in line with the rest of Git, as well as with Perforce.

* ld/p4-editor-multi-words:
  git-p4: tests: use test-chmtime in place of touch
  git-p4: fix handling of multi-word P4EDITOR
  git-p4: add failing test for P4EDITOR handling

9 years agoMerge branch 'bc/object-id'
Junio C Hamano [Fri, 5 Jun 2015 19:17:37 +0000 (12:17 -0700)]
Merge branch 'bc/object-id'

for_each_ref() callback functions were taught to name the objects
not with "unsigned char sha1[20]" but with "struct object_id".

* bc/object-id: (56 commits)
  struct ref_lock: convert old_sha1 member to object_id
  warn_if_dangling_symref(): convert local variable "junk" to object_id
  each_ref_fn_adapter(): remove adapter
  rev_list_insert_ref(): remove unneeded arguments
  rev_list_insert_ref_oid(): new function, taking an object_oid
  mark_complete(): remove unneeded arguments
  mark_complete_oid(): new function, taking an object_oid
  clear_marks(): rewrite to take an object_id argument
  mark_complete(): rewrite to take an object_id argument
  send_ref(): convert local variable "peeled" to object_id
  upload-pack: rewrite functions to take object_id arguments
  find_symref(): convert local variable "unused" to object_id
  find_symref(): rewrite to take an object_id argument
  write_one_ref(): rewrite to take an object_id argument
  write_refs_to_temp_dir(): convert local variable sha1 to object_id
  submodule: rewrite to take an object_id argument
  shallow: rewrite functions to take object_id arguments
  handle_one_ref(): rewrite to take an object_id argument
  add_info_ref(): rewrite to take an object_id argument
  handle_one_reflog(): rewrite to take an object_id argument
  ...

9 years agoMerge branch 'jk/at-push-sha1'
Junio C Hamano [Fri, 5 Jun 2015 19:17:36 +0000 (12:17 -0700)]
Merge branch 'jk/at-push-sha1'

Introduce <branch>@{push} short-hand to denote the remote-tracking
branch that tracks the branch at the remote the <branch> would be
pushed to.

* jk/at-push-sha1:
  for-each-ref: accept "%(push)" format
  for-each-ref: use skip_prefix instead of starts_with
  sha1_name: implement @{push} shorthand
  sha1_name: refactor interpret_upstream_mark
  sha1_name: refactor upstream_mark
  remote.c: add branch_get_push
  remote.c: return upstream name from stat_tracking_info
  remote.c: untangle error logic in branch_get_upstream
  remote.c: report specific errors from branch_get_upstream
  remote.c: introduce branch_get_upstream helper
  remote.c: hoist read_config into remote_get_1
  remote.c: provide per-branch pushremote name
  remote.c: hoist branch.*.remote lookup out of remote_get_1
  remote.c: drop "remote" pointer from "struct branch"
  remote.c: refactor setup of branch->merge list
  remote.c: drop default_remote_name variable

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

Error messages from "git branch" called remote-tracking branches as
"remote branches".

* dl/branch-error-message:
  branch: do not call a "remote-tracking branch" a "remote branch"

9 years agoMerge branch 'jk/skip-http-tests-under-no-curl' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:28 +0000 (12:00 -0700)]
Merge branch 'jk/skip-http-tests-under-no-curl' into maint

Test clean-up.

* jk/skip-http-tests-under-no-curl:
  tests: skip dav http-push tests under NO_EXPAT=NoThanks
  t/lib-httpd.sh: skip tests if NO_CURL is defined

9 years agoMerge branch 'ps/doc-packfile-vs-pack-file' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:27 +0000 (12:00 -0700)]
Merge branch 'ps/doc-packfile-vs-pack-file' into maint

Doc consistency updates.

* ps/doc-packfile-vs-pack-file:
  doc: fix inconsistent spelling of "packfile"
  pack-protocol.txt: fix insconsistent spelling of "packfile"
  git-unpack-objects.txt: fix inconsistent spelling of "packfile"
  git-verify-pack.txt: fix inconsistent spelling of "packfile"

9 years agoMerge branch 'fg/document-commit-message-stripping' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:26 +0000 (12:00 -0700)]
Merge branch 'fg/document-commit-message-stripping' into maint

* fg/document-commit-message-stripping:
  Documentation: clarify how "git commit" cleans up the edited log message

9 years agoMerge branch 'jk/rerere-forget-check-enabled' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:25 +0000 (12:00 -0700)]
Merge branch 'jk/rerere-forget-check-enabled' into maint

"git rerere forget" in a repository without rerere enabled gave a
cryptic error message; it should be a silent no-op instead.

* jk/rerere-forget-check-enabled:
  rerere: exit silently on "forget" when rerere is disabled

9 years agoMerge branch 'pt/pull-log-n' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:24 +0000 (12:00 -0700)]
Merge branch 'pt/pull-log-n' into maint

"git pull --log" and "git pull --no-log" worked as expected, but
"git pull --log=20" did not.

* pt/pull-log-n:
  pull: handle --log=<n>

9 years agoMerge branch 'pt/pull-ff-vs-merge-ff' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:23 +0000 (12:00 -0700)]
Merge branch 'pt/pull-ff-vs-merge-ff' into maint

The pull.ff configuration was supposed to override the merge.ff
configuration, but it didn't.

* pt/pull-ff-vs-merge-ff:
  pull: parse pull.ff as a bool or string
  pull: make pull.ff=true override merge.ff

9 years agoMerge branch 'rs/plug-leak-in-pack-bitmaps' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:22 +0000 (12:00 -0700)]
Merge branch 'rs/plug-leak-in-pack-bitmaps' into maint

The code to read pack-bitmap wanted to allocate a few hundred
pointers to a structure, but by mistake allocated and leaked memory
enough to hold that many actual structures.  Correct the allocation
size and also have it on stack, as it is small enough.

* rs/plug-leak-in-pack-bitmaps:
  pack-bitmaps: plug memory leak, fix allocation size for recent_bitmaps

9 years agoMerge branch 'ja/tutorial-asciidoctor-fix' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:22 +0000 (12:00 -0700)]
Merge branch 'ja/tutorial-asciidoctor-fix' into maint

A literal block in the tutorial had lines with unequal lengths to
delimit it from the rest of the document, which choke GitHub's
AsciiDoc renderer.

* ja/tutorial-asciidoctor-fix:
  doc: fix unmatched code fences

9 years agoMerge branch 'jk/stripspace-asciidoctor-fix' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:20 +0000 (12:00 -0700)]
Merge branch 'jk/stripspace-asciidoctor-fix' into maint

A literal block in the tutorial had lines with unequal lengths to
delimit it from the rest of the document, which choke GitHub's
AsciiDoc renderer.

* jk/stripspace-asciidoctor-fix:
  doc: fix unmatched code fences in git-stripspace

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

Various documentation mark-up fixes to make the output more
consistent in general and also make AsciiDoctor (an alternative
formatter) happier.

* jk/asciidoc-markup-fix:
  doc: convert AsciiDoc {?foo} to ifdef::foo[]
  doc: put example URLs and emails inside literal backticks
  doc: drop backslash quoting of some curly braces
  doc: convert \--option to --option
  doc/add: reformat `--edit` option
  doc: fix length of underlined section-title
  doc: fix hanging "+"-continuation
  doc: fix unquoted use of "{type}"
  doc: fix misrendering due to `single quote'

9 years agoMerge branch 'ps/bundle-verify-arg' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:18 +0000 (12:00 -0700)]
Merge branch 'ps/bundle-verify-arg' into maint

"git bundle verify" did not diagnose extra parameters on the
command line.

* ps/bundle-verify-arg:
  bundle: verify arguments more strictly

9 years agoMerge branch 'mh/write-refs-sooner-2.4' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:17 +0000 (12:00 -0700)]
Merge branch 'mh/write-refs-sooner-2.4' into maint

Multi-ref transaction support we merged a few releases ago
unnecessarily kept many file descriptors open, risking to fail with
resource exhaustion.  This is for 2.4.x track.

* mh/write-refs-sooner-2.4:
  ref_transaction_commit(): fix atomicity and avoid fd exhaustion
  ref_transaction_commit(): remove the local flags variable
  ref_transaction_commit(): inline call to write_ref_sha1()
  rename_ref(): inline calls to write_ref_sha1() from this function
  commit_ref_update(): new function, extracted from write_ref_sha1()
  write_ref_to_lockfile(): new function, extracted from write_ref_sha1()
  t7004: rename ULIMIT test prerequisite to ULIMIT_STACK_SIZE
  update-ref: test handling large transactions properly
  ref_transaction_commit(): fix atomicity and avoid fd exhaustion
  ref_transaction_commit(): remove the local flags variable
  ref_transaction_commit(): inline call to write_ref_sha1()
  rename_ref(): inline calls to write_ref_sha1() from this function
  commit_ref_update(): new function, extracted from write_ref_sha1()
  write_ref_to_lockfile(): new function, extracted from write_ref_sha1()
  t7004: rename ULIMIT test prerequisite to ULIMIT_STACK_SIZE
  update-ref: test handling large transactions properly

9 years agoMerge branch 'mh/ref-directory-file' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:16 +0000 (12:00 -0700)]
Merge branch 'mh/ref-directory-file' into maint

The ref API did not handle cases where 'refs/heads/xyzzy/frotz' is
removed at the same time as 'refs/heads/xyzzy' is added (or vice
versa) very well.

* mh/ref-directory-file:
  reflog_expire(): integrate lock_ref_sha1_basic() errors into ours
  ref_transaction_commit(): delete extra "the" from error message
  ref_transaction_commit(): provide better error messages
  rename_ref(): integrate lock_ref_sha1_basic() errors into ours
  lock_ref_sha1_basic(): improve diagnostics for ref D/F conflicts
  lock_ref_sha1_basic(): report errors via a "struct strbuf *err"
  verify_refname_available(): report errors via a "struct strbuf *err"
  verify_refname_available(): rename function
  refs: check for D/F conflicts among refs created in a transaction
  ref_transaction_commit(): use a string_list for detecting duplicates
  is_refname_available(): use dirname in first loop
  struct nonmatching_ref_data: store a refname instead of a ref_entry
  report_refname_conflict(): inline function
  entry_matches(): inline function
  is_refname_available(): convert local variable "dirname" to strbuf
  is_refname_available(): avoid shadowing "dir" variable
  is_refname_available(): revamp the comments
  t1404: new tests of ref D/F conflicts within transactions

9 years agoMerge branch 'mg/log-decorate-HEAD' into maint
Junio C Hamano [Fri, 5 Jun 2015 19:00:15 +0000 (12:00 -0700)]
Merge branch 'mg/log-decorate-HEAD' into maint

The "log --decorate" enhancement in Git 2.4 that shows the commit
at the tip of the current branch e.g. "HEAD -> master", did not
work with --decorate=full.

* mg/log-decorate-HEAD:
  log: do not shorten decoration names too early
  log: decorate HEAD with branch name under --decorate=full, too

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 agoll-merge: pass the original path to external drivers
Junio C Hamano [Thu, 4 Jun 2015 22:10:29 +0000 (15:10 -0700)]
ll-merge: pass the original path to external drivers

The interface to custom low-level merge driver was modeled to be
capable of driving programs like "merge" (from the RCS suite) that
can produce result solely by looking at three files that hold
contents of common ancestor, ours and theirs.  The information we
feed to the external drivers via the command line placeholders %O,
%A, and %B were designed to be purely about contents by giving
names of the temporary files that hold these variants without
exposing the original pathname.  No matter where the result goes,
merging the same three variants should produce the same result,
contents is the king, that is the Git way.

The external driver interface, however, is meant to help people to
step outside the Git worldview, and sometimes people want to know
the final path that the resulting merged contents would be stored
in.  Expose this to the external drivers via a new placeholder %P.

Requested-by: Andreas Gondek
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agogit-am: add am.threeWay config variable
Remi Lespinet [Thu, 4 Jun 2015 15:04:55 +0000 (17:04 +0200)]
git-am: add am.threeWay config variable

Add the am.threeWay configuration variable to use the -3 or --3way
option of git am by default. When am.threeway is set and not desired
for a specific git am command, the --no-3way option can be used to
override it.

Signed-off-by: Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agot4150-am: refactor am -3 tests
Remi Lespinet [Thu, 4 Jun 2015 15:04:54 +0000 (17:04 +0200)]
t4150-am: refactor am -3 tests

Create a setup for git am -3 in a separate test instead of creating
this setup each time.

This prepares for the next commit which will use this setup as well.

Signed-off-by: Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agogit-am.sh: fix initialization of the threeway variable
Remi Lespinet [Thu, 4 Jun 2015 15:04:53 +0000 (17:04 +0200)]
git-am.sh: fix initialization of the threeway variable

Initialization for the threeway variable was missing. This caused
a behavior change for command lines like:

threeway=t git am ...

This commit adds initialization for this variable.

Signed-off-by: Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoindex-pack: fix truncation of off_t in comparison
Jeff King [Thu, 4 Jun 2015 12:35:42 +0000 (08:35 -0400)]
index-pack: fix truncation of off_t in comparison

Commit c6458e6 (index-pack: kill union delta_base to save
memory, 2015-04-18) refactored the comparison functions used
in sorting and binary searching our delta list. The
resulting code does something like:

  int cmp_offsets(off_t a, off_t b)
  {
  return a - b;
  }

This works most of the time, but produces nonsensical
results when the difference between the two offsets is
larger than what can be stored in an "int". This can lead to
unresolved deltas if the packsize is larger than 2G (even on
64-bit systems, an int is still typically 32 bits):

  $ git clone git://github.com/mozilla/gecko-dev
  Cloning into 'gecko-dev'...
  remote: Counting objects: 4800161, done.
  remote: Compressing objects: 100% (178/178), done.
  remote: Total 4800161 (delta 88), reused 0 (delta 0), pack-reused 4799978
  Receiving objects: 100% (4800161/4800161), 2.21 GiB | 3.26 MiB/s, done.
  Resolving deltas:  99% (3808820/3811944), completed with 0 local objects.
  fatal: pack has 3124 unresolved deltas
  fatal: index-pack failed

We can fix it by doing direct comparisons between the
offsets and returning constants; the callers only care about
the sign of the comparison, not the magnitude.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoconfigure: add getdelim() check
Eric Sunshine [Tue, 2 Jun 2015 21:15:44 +0000 (17:15 -0400)]
configure: add getdelim() check

As an optimization, strbuf will take advantage of getdelim() if
available, so add a configure check which defines HAVE_GETDELIM if
found.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoconfig.mak.uname: Darwin: define HAVE_GETDELIM for modern OS X releases
Eric Sunshine [Tue, 2 Jun 2015 21:15:43 +0000 (17:15 -0400)]
config.mak.uname: Darwin: define HAVE_GETDELIM for modern OS X releases

On Mac OS X, getdelim() first became available with Xcode 4.1[1], which
was released the same day as OS X 10.7 "Lion", so assume getdelim()
availability from 10.7 onward. (As of this writing, OS X is at 10.10
"Yosemite".)

According to Wikipedia[2], 4.1 was also available for download by paying
developers on OS X 10.6 "Snow Leopard", so it's possible that some 10.6
machines may have getdelim(). However, as strbuf's use of getdelim() is
purely an optimization, let's be conservative and assume 10.6 and
earlier lack getdelim().

[1]: Or, possibly with Xcode 4.0, but that version is no longer
     available for download, or not available to non-paying developers,
     so testing is not possible.

[2]: http://en.wikipedia.org/wiki/Xcode

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoewah: use less generic macro name
Jeff King [Wed, 3 Jun 2015 06:39:37 +0000 (02:39 -0400)]
ewah: use less generic macro name

The ewah/ewok.h header pollutes the global namespace with
"BITS_IN_WORD", without any specific notion that we are
talking about the bits in an eword_t. We can give this the
more specific name "BITS_IN_EWORD".

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>