Commit graph

47914 commits

Author SHA1 Message Date
Jonathan Tan 092c55d094 object: remove "used" field from struct object
The "used" field in struct object is only used by builtin/fsck. Remove
that field and modify builtin/fsck to use a flag instead.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-07-20 14:54:08 -07:00
Jonathan Tan ad2db4030e fsck: remove redundant parse_tree() invocation
If obj->type == OBJ_TREE, an invocation of fsck_walk() will invoke
parse_tree() and return quickly if that returns nonzero, so it is of no
use for traverse_one_object() to invoke parse_tree() in this situation
before invoking fsck_walk(). Remove that code.

The behavior of traverse_one_object() is changed slightly in that it now
returns -1 instead of 1 in the case that parse_tree() fails, but this is
not an issue because its only caller (traverse_reachable) does not care
about the value as long as it is nonzero.

This code was introduced in commit 271b8d2 ("builtin-fsck: move away
from object-refs to fsck_walk", 2008-02-25). The same issue existed in
that commit.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-07-20 14:53:51 -07:00
Junio C Hamano cac25fc330 A few more topics before 2.14-rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-07-18 12:52:49 -07:00
Junio C Hamano 764046f6b0 Merge branch 'jk/gc-pre-detach-under-hook'
We run an early part of "git gc" that deals with refs before
daemonising (and not under lock) even when running a background
auto-gc, which caused multiple gc processes attempting to run the
early part at the same time.  This is now prevented by running the
early part also under the GC lock.

* jk/gc-pre-detach-under-hook:
  gc: run pre-detach operations under lock
2017-07-18 12:48:10 -07:00
Junio C Hamano 1115749223 Merge branch 'jn/hooks-pre-rebase-sample-fix'
Code clean-up, that makes us in sync with Debian by one patch.

* jn/hooks-pre-rebase-sample-fix:
  pre-rebase hook: capture documentation in a <<here document
2017-07-18 12:48:10 -07:00
Junio C Hamano a11ab576d9 Merge branch 'rs/progress-overall-throughput-at-the-end'
The progress meter did not give a useful output when we haven't had
0.5 seconds to measure the throughput during the interval.  Instead
show the overall throughput rate at the end, which is a much more
useful number.

* rs/progress-overall-throughput-at-the-end:
  progress: show overall rate in last update
2017-07-18 12:48:09 -07:00
Junio C Hamano 33400c0e96 Merge branch 'tb/push-to-cygwin-unc-path'
On Cygwin, similar to Windows, "git push //server/share/repository"
ought to mean a repository on a network share that can be accessed
locally, but this did not work correctly due to stripping the double
slashes at the beginning.

This may need to be heavily tested before it gets unleashed to the
wild, as the change is at a fairly low-level code and would affect
not just the code to decide if the push destination is local.  There
may be unexpected fallouts in the path normalization.

* tb/push-to-cygwin-unc-path:
  cygwin: allow pushing to UNC paths
2017-07-18 12:48:09 -07:00
Junio C Hamano f3da2b79be Git 2.14-rc0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-07-13 16:22:29 -07:00
Junio C Hamano 757e9874be Merge branch 'jk/build-with-asan'
The build procedure has been improved to allow building and testing
Git with address sanitizer more easily.

* jk/build-with-asan:
  Makefile: disable unaligned loads with UBSan
  Makefile: turn off -fomit-frame-pointer with sanitizers
  Makefile: add helper for compiling with -fsanitize
  test-lib: turn on ASan abort_on_error by default
  test-lib: set ASAN_OPTIONS variable before we run git
2017-07-13 16:14:54 -07:00
Junio C Hamano c9c63ee558 Merge branch 'sb/pull-rebase-submodule'
"git pull --rebase --recurse-submodules" learns to rebase the
branch in the submodules to an updated base.

* sb/pull-rebase-submodule:
  builtin/fetch cleanup: always set default value for submodule recursing
  pull: optionally rebase submodules (remote submodule changes only)
  builtin/fetch: parse recurse-submodules-default at default options parsing
  builtin/fetch: factor submodule recurse parsing out to submodule config
2017-07-13 16:14:54 -07:00
Junio C Hamano 91f6922544 Merge branch 'sb/hashmap-customize-comparison'
Update the hashmap API so that data to customize the behaviour of
the comparison function can be specified at the time a hashmap is
initialized.

* sb/hashmap-customize-comparison:
  hashmap: migrate documentation from Documentation/technical into header
  patch-ids.c: use hashmap correctly
  hashmap.h: compare function has access to a data field
2017-07-13 16:14:54 -07:00
Junio C Hamano eac97b438c Merge branch 'ab/grep-lose-opt-regflags'
Code cleanup.

* ab/grep-lose-opt-regflags:
  grep: remove redundant REG_NEWLINE when compiling fixed regex
  grep: remove regflags from the public grep_opt API
  grep: remove redundant and verbose re-assignments to 0
  grep: remove redundant "fixed" field re-assignment to 0
  grep: adjust a redundant grep pattern type assignment
  grep: remove redundant double assignment to 0
2017-07-13 16:14:54 -07:00
Junio C Hamano 80145b1e41 Sync with v2.13.3 2017-07-12 15:25:14 -07:00
Junio C Hamano 08f9c32463 Git 2.13.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-07-12 15:24:15 -07:00
Junio C Hamano 55bdfa022f Merge branch 'kn/ref-filter-branch-list' into maint
The rewrite of "git branch --list" using for-each-ref's internals
that happened in v2.13 regressed its handling of color.branch.local;
this has been fixed.

* kn/ref-filter-branch-list:
  ref-filter.c: drop return from void function
  branch: set remote color in ref-filter branch immediately
  branch: use BRANCH_COLOR_LOCAL in ref-filter format
  branch: only perform HEAD check for local branches
2017-07-12 15:23:09 -07:00
Junio C Hamano ecab58c65f Merge branch 'ks/typofix-commit-c-comment' into maint
Typofix.

* ks/typofix-commit-c-comment:
  builtin/commit.c: fix a typo in the comment
2017-07-12 15:20:49 -07:00
Junio C Hamano 9d21a968b2 Merge branch 'jk/reflog-walk-maint' into maint
After "git branch --move" of the currently checked out branch, the
code to walk the reflog of HEAD via "log -g" and friends
incorrectly stopped at the reflog entry that records the renaming
of the branch.

* jk/reflog-walk-maint:
  reflog-walk: include all fields when freeing complete_reflogs
  reflog-walk: don't free reflogs added to cache
  reflog-walk: duplicate strings in complete_reflogs list
  reflog-walk: skip over double-null oid due to HEAD rename
2017-07-12 15:20:36 -07:00
Junio C Hamano 8ba1d6616f Hopefully the last batch before -rc0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-07-12 15:19:27 -07:00
Junio C Hamano a5a3c5afcd Merge branch 'ks/fix-rebase-doc-picture'
Doc update.

* ks/fix-rebase-doc-picture:
  doc: correct a mistake in an illustration
2017-07-12 15:18:24 -07:00
Junio C Hamano 094aa09aa5 Merge branch 'rs/wt-status-cleanup'
Code cleanup.

* rs/wt-status-cleanup:
  wt-status: use separate variable for result of shorten_unambiguous_ref
2017-07-12 15:18:23 -07:00
Junio C Hamano f056cde60e Merge branch 'rs/use-div-round-up'
Code cleanup.

* rs/use-div-round-up:
  use DIV_ROUND_UP
2017-07-12 15:18:23 -07:00
Junio C Hamano 768d0fe0da Merge branch 'kn/ref-filter-branch-list'
The rewrite of "git branch --list" using for-each-ref's internals
that happened in v2.13 regressed its handling of color.branch.local;
this has been fixed.

* kn/ref-filter-branch-list:
  ref-filter.c: drop return from void function
  branch: set remote color in ref-filter branch immediately
  branch: use BRANCH_COLOR_LOCAL in ref-filter format
  branch: only perform HEAD check for local branches
2017-07-12 15:18:23 -07:00
Junio C Hamano 536c1ec32a Merge branch 'rs/urlmatch-cleanup'
Code cleanup.

* rs/urlmatch-cleanup:
  urlmatch: use hex2chr() in append_normalized_escapes()
2017-07-12 15:18:22 -07:00
Junio C Hamano 6fee4ca625 Merge branch 'rs/apply-avoid-over-reading'
Code cleanup.

* rs/apply-avoid-over-reading:
  apply: use strcmp(3) for comparing strings in gitdiff_verify_name()
2017-07-12 15:18:22 -07:00
Junio C Hamano b5fe65fe93 Merge branch 'sb/submodule-doc'
Doc update.

* sb/submodule-doc:
  submodules: overhaul documentation
2017-07-12 15:18:21 -07:00
Jeff King c45af94dbc gc: run pre-detach operations under lock
We normally try to avoid having two auto-gc operations run
at the same time, because it wastes resources. This was done
long ago in 64a99eb47 (gc: reject if another gc is running,
unless --force is given, 2013-08-08).

When we do a detached auto-gc, we run the ref-related
commands _before_ detaching, to avoid confusing lock
contention. This was done by 62aad1849 (gc --auto: do not
lock refs in the background, 2014-05-25).

These two features do not interact well. The pre-detach
operations are run before we check the gc.pid lock, meaning
that on a busy repository we may run many of them
concurrently. Ideally we'd take the lock before spawning any
operations, and hold it for the duration of the program.

This is tricky, though, with the way the pid-file interacts
with the daemonize() process.  Other processes will check
that the pid recorded in the pid-file still exists. But
detaching causes us to fork and continue running under a
new pid. So if we take the lock before detaching, the
pid-file will have a bogus pid in it. We'd have to go back
and update it with the new pid after detaching. We'd also
have to play some tricks with the tempfile subsystem to
tweak the "owner" field, so that the parent process does not
clean it up on exit, but the child process does.

Instead, we can do something a bit simpler: take the lock
only for the duration of the pre-detach work, then detach,
then take it again for the post-detach work. Technically,
this means that the post-detach lock could lose to another
process doing pre-detach work. But in the long run this
works out.

That second process would then follow-up by doing
post-detach work. Unless it was in turn blocked by a third
process doing pre-detach work, and so on. This could in
theory go on indefinitely, as the pre-detach work does not
repack, and so need_to_gc() will continue to trigger.  But
in each round we are racing between the pre- and post-detach
locks. Eventually, one of the post-detach locks will win the
race and complete the full gc. So in the worst case, we may
racily repeat the pre-detach work, but we would never do so
simultaneously (it would happen via a sequence of serialized
race-wins).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-07-12 09:41:04 -07:00
Jonathan Nieder 8db1ae5740 pre-rebase hook: capture documentation in a <<here document
Without this change, the sample hook does not pass a syntax check
(sh -n):

  $ sh -n hooks--pre-rebase.sample
  hooks--pre-rebase.sample: line 101: syntax error near unexpected token `('
  hooks--pre-rebase.sample: line 101: `   merged into it again (either directly or indirectly).'

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-07-11 08:56:33 -07:00
René Scharfe 42c78a216e use DIV_ROUND_UP
Convert code that divides and rounds up to use DIV_ROUND_UP to make the
intent clearer and reduce the number of magic constants.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-07-10 14:24:36 -07:00
Junio C Hamano 117ddefdb4 Sync with maint 2017-07-10 14:06:21 -07:00
Junio C Hamano 699d47e1d2 Prepare for 2.13.3 2017-07-10 14:02:07 -07:00
Junio C Hamano 4aaf5b0b21 Merge branch 'sb/merge-recursive-code-cleanup' into maint
Code clean-up.

* sb/merge-recursive-code-cleanup:
  merge-recursive: use DIFF_XDL_SET macro
2017-07-10 13:59:09 -07:00
Junio C Hamano 127c13aa41 Merge branch 'jc/utf8-fprintf' into maint
Code cleanup.

* jc/utf8-fprintf:
  submodule--helper: do not call utf8_fprintf() unnecessarily
2017-07-10 13:59:09 -07:00
Junio C Hamano 8e7b78a692 Merge branch 'js/fsck-name-object' into maint
Test fix.

* js/fsck-name-object:
  t1450: use egrep for regexp "alternation"
2017-07-10 13:59:08 -07:00
Junio C Hamano 5a24b4e14a Merge branch 'js/t5534-rev-parse-gives-multi-line-output-fix' into maint
A few tests that tried to verify the contents of push certificates
did not use 'git rev-parse' to formulate the line to look for in
the certificate correctly.

* js/t5534-rev-parse-gives-multi-line-output-fix:
  t5534: fix misleading grep invocation
2017-07-10 13:59:07 -07:00
Junio C Hamano 362009f8cf Merge branch 'ab/sha1dc-maint' into maint
Update the sha1dc again to fix portability glitches.

* ab/sha1dc-maint:
  sha1dc: update from upstream
2017-07-10 13:59:06 -07:00
Junio C Hamano 35049a2343 Merge branch 'aw/contrib-subtree-doc-asciidoctor' into maint
The Makefile rule in contrib/subtree for building documentation
learned to honour USE_ASCIIDOCTOR just like the main documentation
set does.

* aw/contrib-subtree-doc-asciidoctor:
  subtree: honour USE_ASCIIDOCTOR when set
2017-07-10 13:59:06 -07:00
Junio C Hamano a9e87e3204 Merge branch 'cc/shared-index-permfix' into maint
The split index code did not honor core.sharedrepository setting
correctly.

* cc/shared-index-permfix:
  t1700: make sure split-index respects core.sharedrepository
  t1301: move modebits() to test-lib-functions.sh
  read-cache: use shared perms when writing shared index
2017-07-10 13:59:05 -07:00
Junio C Hamano 76de71b487 Merge branch 'ah/doc-pretty-color-auto-prefix' into maint
Doc update.

* ah/doc-pretty-color-auto-prefix:
  doc: clarify syntax for %C(auto,...) in pretty formats
2017-07-10 13:59:05 -07:00
Junio C Hamano cf77911ae5 Merge branch 'mb/reword-autocomplete-message' into maint
Message update.

* mb/reword-autocomplete-message:
  auto-correct: tweak phrasing
2017-07-10 13:59:04 -07:00
Junio C Hamano 8f3a16c390 Merge branch 'ks/t7508-indent-fix' into maint
Cosmetic update to a test.

* ks/t7508-indent-fix:
  t7508: fix a broken indentation
2017-07-10 13:59:03 -07:00
Junio C Hamano dbcf77592a Merge branch 'sb/t4005-modernize' into maint
Test clean-up.

* sb/t4005-modernize:
  t4005: modernize style and drop hard coded sha1
2017-07-10 13:59:02 -07:00
Junio C Hamano 33c3c2d368 Merge branch 'rs/apply-validate-input' into maint
Tighten error checks for invalid "git apply" input.

* rs/apply-validate-input:
  apply: check git diffs for mutually exclusive header lines
  apply: check git diffs for invalid file modes
  apply: check git diffs for missing old filenames
2017-07-10 13:59:01 -07:00
Junio C Hamano b944d7c4b5 Merge branch 'jc/pack-bitmap-unaligned' into maint
An unaligned 32-bit access in pack-bitmap code ahs been corrected.

* jc/pack-bitmap-unaligned:
  pack-bitmap: don't perform unaligned memory access
2017-07-10 13:59:00 -07:00
Junio C Hamano 9f6728da31 Merge branch 'pw/rebase-i-regression-fix-tests' into maint
Fix a recent regression to "git rebase -i" and add tests that would
have caught it and others.

* pw/rebase-i-regression-fix-tests:
  t3420: fix under GETTEXT_POISON build
  rebase: add more regression tests for console output
  rebase: add regression tests for console output
  rebase -i: add test for reflog message
  sequencer: print autostash messages to stderr
2017-07-10 13:59:00 -07:00
Junio C Hamano f904494574 Merge branch 'jk/add-p-commentchar-fix' into maint
"git add -p" were updated in 2.12 timeframe to cope with custom
core.commentchar but the implementation was buggy and a
metacharacter like $ and * did not work.

* jk/add-p-commentchar-fix:
  add--interactive: quote commentChar regex
  add--interactive: handle EOF in prompt_yesno
2017-07-10 13:58:59 -07:00
Junio C Hamano 040746c061 Merge branch 'js/alias-early-config' into maint
The code to pick up and execute command alias definition from the
configuration used to switch to the top of the working tree and
then come back when the expanded alias was executed, which was
unnecessarilyl complex.  Attempt to simplify the logic by using the
early-config mechanism that does not chdir around.

* js/alias-early-config:
  alias: use the early config machinery to expand aliases
  t7006: demonstrate a problem with aliases in subdirectories
  t1308: relax the test verifying that empty alias values are disallowed
  help: use early config when autocorrecting aliases
  config: report correct line number upon error
  discover_git_directory(): avoid setting invalid git_dir
2017-07-10 13:58:58 -07:00
Junio C Hamano 49771171e5 Merge branch 'rs/pretty-add-again' into maint
The pretty-format specifiers like '%h', '%t', etc. had an
optimization that no longer works correctly.  In preparation/hope
of getting it correctly implemented, first discard the optimization
that is broken.

* rs/pretty-add-again:
  pretty: recalculate duplicate short hashes
2017-07-10 13:58:57 -07:00
Junio C Hamano 86d51bbe1a Merge branch 'ah/doc-gitattributes-empty-index' into maint
An example in documentation that does not work in multi worktree
configuration has been corrected.

* ah/doc-gitattributes-empty-index:
  doc: do not use `rm .git/index` when normalizing line endings
2017-07-10 13:58:56 -07:00
Junio C Hamano 311b760b8f Merge branch 'da/mergetools-meld-output-opt-on-macos' into maint
"git mergetool" learned to work around a wrapper MacOS X adds
around underlying meld.

* da/mergetools-meld-output-opt-on-macos:
  mergetools/meld: improve compatibiilty with Meld on macOS X
2017-07-10 13:58:56 -07:00
Junio C Hamano c4ffd78852 Merge branch 'jk/diff-highlight-module' into maint
The 'diff-highlight' program (in contrib/) has been restructured
for easier reuse by an external project 'diff-so-fancy'.

* jk/diff-highlight-module:
  diff-highlight: split code into module
2017-07-10 13:58:56 -07:00