Commit graph

52748 commits

Author SHA1 Message Date
Junio C Hamano 93ded333bc Merge branch 'sk/instaweb-rh-update'
"git instaweb" has been adjusted to run better with newer Apache on
RedHat based distros.

* sk/instaweb-rh-update:
  git-instaweb: fix apache2 config with apache >= 2.4
  git-instaweb: support Fedora/Red Hat apache module path
2018-08-20 11:33:49 -07:00
Junio C Hamano 02c51a2fd8 Merge branch 'en/t7406-fixes'
Test fixes.

* en/t7406-fixes:
  t7406: avoid using test_must_fail for commands other than git
  t7406: prefer test_* helper functions to test -[feds]
  t7406: avoid having git commands upstream of a pipe
  t7406: simplify by using diff --name-only instead of diff --raw
  t7406: fix call that was failing for the wrong reason
2018-08-20 11:33:49 -07:00
Junio C Hamano 750eb11d8f Merge branch 'js/rebase-merges-exec-fix'
The "--exec" option to "git rebase --rebase-merges" placed the exec
commands at wrong places, which has been corrected.

* js/rebase-merges-exec-fix:
  rebase --exec: make it work with --rebase-merges
  t3430: demonstrate what -r, --autosquash & --exec should do
2018-08-20 11:33:48 -07:00
Junio C Hamano 14677d25ab Merge branch 'ab/test-must-be-empty-for-master'
Test updates.

* ab/test-must-be-empty-for-master:
  tests: make use of the test_must_be_empty function
2018-08-20 11:33:48 -07:00
Junio C Hamano 34f229790d Merge branch 'ab/newhash-is-sha256'
Documentation update.

* ab/newhash-is-sha256:
  doc hash-function-transition: pick SHA-256 as NewHash
  doc hash-function-transition: note the lack of a changelog
2018-08-20 11:33:48 -07:00
Ævar Arnfjörð Bjarmason 3338e9950e t2024: mark test using "checkout -p" with PERL prerequisite
Checkout with the -p switch uses the "add interactive" framework which
is written in Perl.

One test added in 8d7b558bae ("checkout & worktree: introduce
checkout.defaultRemote", 2018-06-05) didn't declare the PERL
prerequisite, breaking the test when built with NO_PERL.

Reported-by: CB Bailey <cb@hashpling.org>
Signed-off-by: CB Bailey <cb@hashpling.org>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-18 09:26:54 -07:00
Junio C Hamano 59a255aef0 sideband: do not read beyond the end of input
The caller of maybe_colorize_sideband() gives a counted buffer
<src, n>, but the callee checked src[] as if it were a NUL terminated
buffer.  If src[] had all isspace() bytes in it, we would have made
n negative, and then

 (1) made number of strncasecmp() calls to see if the remaining
     bytes in src[] matched keywords, reading beyond the end of the
     array (this actually happens even if n does not go negative),
     and/or

 (2) called strbuf_add() with negative count, most likely triggering
     the "you want to use way too much memory" error due to unsigned
     integer overflow.

Fix both issues by making sure we do not go beyond &src[n].

In the longer term we may want to accept size_t as parameter for
clarity (even though we know that a sideband message we are painting
typically would fit on a line on a terminal and int is sufficient).
Write it down as a NEEDSWORK comment.

Helped-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-18 09:16:48 -07:00
Junio C Hamano fa03cdc39b Seventh batch for 2.19 cycle
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-17 13:15:06 -07:00
Junio C Hamano 4e0ea8eddd Merge branch 'nd/complete-config-vars'
Build fix.

* nd/complete-config-vars:
  Makefile: add missing dependency for command-list.h
2018-08-17 13:09:59 -07:00
Junio C Hamano 2c8c407d0a Merge branch 'ar/t4150-am-scissors-test-fix'
Test fix.

* ar/t4150-am-scissors-test-fix:
  t4150: fix broken test for am --scissors
2018-08-17 13:09:59 -07:00
Junio C Hamano c757aa2d12 Merge branch 'js/pull-rebase-type-shorthand'
"git pull --rebase=interactive" learned "i" as a short-hand for
"interactive".

* js/pull-rebase-type-shorthand:
  pull --rebase=<type>: allow single-letter abbreviations for the type
2018-08-17 13:09:59 -07:00
Junio C Hamano f74e7b8c5b Merge branch 'jk/diff-rendered-docs'
The end result of documentation update has been made to be
inspected more easily to help developers.

* jk/diff-rendered-docs:
  add a script to diff rendered documentation
2018-08-17 13:09:58 -07:00
Junio C Hamano f382c24ef0 Merge branch 'hn/config-in-code-comment'
Header update.

* hn/config-in-code-comment:
  config: document git config getter return value
2018-08-17 13:09:58 -07:00
Junio C Hamano 3146f8a6a0 Merge branch 'nd/config-blame-sort'
Doc fix.

* nd/config-blame-sort:
  config.txt: reorder blame stuff to keep config keys sorted
2018-08-17 13:09:58 -07:00
Junio C Hamano b576cf70b2 Merge branch 'en/t3031-title-fix'
Test fix.

* en/t3031-title-fix:
  t3031: update test description to mention desired behavior
2018-08-17 13:09:58 -07:00
Junio C Hamano 791ad49483 Merge branch 'sb/indent-heuristic-optim'
"git diff --indent-heuristic" had a bad corner case performance.

* sb/indent-heuristic-optim:
  xdiff: reduce indent heuristic overhead
2018-08-17 13:09:57 -07:00
Junio C Hamano 8ba8642bd5 Merge branch 'en/abort-df-conflict-fixes'
"git merge --abort" etc. did not clean things up properly when
there were conflicted entries in the index in certain order that
are involved in D/F conflicts.  This has been corrected.

* en/abort-df-conflict-fixes:
  read-cache: fix directory/file conflict handling in read_index_unmerged()
  t1015: demonstrate directory/file conflict recovery failures
2018-08-17 13:09:57 -07:00
Junio C Hamano c5d276cb18 Merge branch 'mk/http-backend-content-length'
The http-backend (used for smart-http transport) used to slurp the
whole input until EOF, without paying attention to CONTENT_LENGTH
that is supplied in the environment and instead expecting the Web
server to close the input stream.  This has been fixed.

* mk/http-backend-content-length:
  t5562: avoid non-portable "export FOO=bar" construct
  http-backend: respect CONTENT_LENGTH for receive-pack
  http-backend: respect CONTENT_LENGTH as specified by rfc3875
  http-backend: cleanup writing to child process
2018-08-17 13:09:57 -07:00
Junio C Hamano c83149ace6 Merge branch 'ot/ref-filter-object-info'
A few atoms like %(objecttype) and %(objectsize) in the format
specifier of "for-each-ref --format=<format>" can be filled without
getting the full contents of the object, but just with the object
header.  These cases have been optimized by calling
oid_object_info() API (instead of reading and inspecting the data).

* ot/ref-filter-object-info:
  ref-filter: use oid_object_info() to get object
  ref-filter: merge get_obj and get_object
  ref-filter: initialize eaten variable
  ref-filter: fill empty fields with empty values
  ref-filter: add info_source to valid_atom
2018-08-17 13:09:57 -07:00
Junio C Hamano 0194c9ad72 Merge branch 'nd/no-extern'
Noiseword "extern" has been removed from function decls in the
header files.

* nd/no-extern:
  submodule.h: drop extern from function declaration
  revision.h: drop extern from function declaration
  repository.h: drop extern from function declaration
  rerere.h: drop extern from function declaration
  line-range.h: drop extern from function declaration
  diff.h: remove extern from function declaration
  diffcore.h: drop extern from function declaration
  convert.h: drop 'extern' from function declaration
  cache-tree.h: drop extern from function declaration
  blame.h: drop extern on func declaration
  attr.h: drop extern from function declaration
  apply.h: drop extern on func declaration
2018-08-17 13:09:56 -07:00
Junio C Hamano 271940c11c Merge branch 'es/want-color-fd-defensive'
Futureproofing a helper function that can easily be misused.

* es/want-color-fd-defensive:
  color: protect against out-of-bounds reads and writes
2018-08-17 13:09:56 -07:00
Junio C Hamano d1b0164c4d Merge branch 'ab/sha1dc'
AIX portability update for the SHA1DC hash, imported from upstream.

* ab/sha1dc:
  sha1dc: update from upstream
2018-08-17 13:09:56 -07:00
Junio C Hamano 8963bb0c2d Merge branch 'rs/parse-opt-lithelp'
The parse-options machinery learned to refrain from enclosing
placeholder string inside a "<bra" and "ket>" pair automatically
without PARSE_OPT_LITERAL_ARGHELP.  Existing help text for option
arguments that are not formatted correctly have been identified and
fixed.

* rs/parse-opt-lithelp:
  parse-options: automatically infer PARSE_OPT_LITERAL_ARGHELP
  shortlog: correct option help for -w
  send-pack: specify --force-with-lease argument help explicitly
  pack-objects: specify --index-version argument help explicitly
  difftool: remove angular brackets from argument help
  add, update-index: fix --chmod argument help
  push: use PARSE_OPT_LITERAL_ARGHELP instead of unbalanced brackets
2018-08-17 13:09:56 -07:00
Junio C Hamano 28dbabb5e0 Merge branch 'ab/fetch-nego'
Update to a few other topics around 'git fetch'.

* ab/fetch-nego:
  fetch doc: cross-link two new negotiation options
  negotiator: unknown fetch.negotiationAlgorithm should error out
2018-08-17 13:09:55 -07:00
Junio C Hamano 72c11b7e62 Merge branch 'jt/refspec-dwim-precedence-fix'
"git fetch $there refs/heads/s" ought to fetch the tip of the
branch 's', but when "refs/heads/refs/heads/s", i.e. a branch whose
name is "refs/heads/s" exists at the same time, fetched that one
instead by mistake.  This has been corrected to honor the usual
disambiguation rules for abbreviated refnames.

* jt/refspec-dwim-precedence-fix:
  remote: make refspec follow the same disambiguation rule as local refs
2018-08-17 13:09:55 -07:00
Junio C Hamano 60858f343a Merge branch 'jk/merge-subtree-heuristics'
The automatic tree-matching in "git merge -s subtree" was broken 5
years ago and nobody has noticed since then, which is now fixed.

* jk/merge-subtree-heuristics:
  score_trees(): fix iteration over trees with missing entries
2018-08-17 13:09:55 -07:00
Junio C Hamano 28bdd99065 Merge branch 'ab/test-must-be-empty'
Test updates.

* ab/test-must-be-empty:
  tests: make use of the test_must_be_empty function
2018-08-17 13:09:54 -07:00
Junio C Hamano 1bc505b476 Merge branch 'es/rebase-i-author-script-fix'
The "author-script" file "git rebase -i" creates got broken when
we started to move the command away from shell script, which is
getting fixed now.

* es/rebase-i-author-script-fix:
  sequencer: don't die() on bogus user-edited timestamp
  sequencer: fix "rebase -i --root" corrupting author header timestamp
  sequencer: fix "rebase -i --root" corrupting author header timezone
  sequencer: fix "rebase -i --root" corrupting author header
2018-08-17 13:09:54 -07:00
Junio C Hamano f8ca71870a Merge branch 'ab/fsck-transfer-updates'
The test performed at the receiving end of "git push" to prevent
bad objects from entering repository can be customized via
receive.fsck.* configuration variables; we now have gained a
counterpart to do the same on the "git fetch" side, with
fetch.fsck.* configuration variables.

* ab/fsck-transfer-updates:
  fsck: test and document unknown fsck.<msg-id> values
  fsck: add stress tests for fsck.skipList
  fsck: test & document {fetch,receive}.fsck.* config fallback
  fetch: implement fetch.fsck.*
  transfer.fsckObjects tests: untangle confusing setup
  config doc: elaborate on fetch.fsckObjects security
  config doc: elaborate on what transfer.fsckObjects does
  config doc: unify the description of fsck.* and receive.fsck.*
  config doc: don't describe *.fetchObjects twice
  receive.fsck.<msg-id> tests: remove dead code
2018-08-17 13:09:54 -07:00
Stefan Beller e6b09b184d builtin/submodule--helper: remove stray new line
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-16 10:42:56 -07:00
Stefan Beller 31158c7efc t7410: update to new style
While at it fix a typo (s/independed/independent) and
make sure git is not in a chain of pipes.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-16 10:42:29 -07:00
Nguyễn Thái Ngọc Duy 3e7dd99208 cherry-pick: fix --quit not deleting CHERRY_PICK_HEAD
--quit is supposed to be --abort but without restoring HEAD. Leaving
CHERRY_PICK_HEAD behind could make other commands mistake that
cherry-pick is still ongoing (e.g. "git commit --amend" will refuse to
work). Clean it too.

For --abort, this job of deleting CHERRY_PICK_HEAD is on "git reset"
so we don't need to do anything else. But let's add extra checks in
--abort tests to confirm.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-16 10:02:55 -07:00
Phillip Wood bc9238bb09 rebase -i: fix SIGSEGV when 'merge <branch>' fails
If a merge command in the todo list specifies just a branch to merge
with no -C/-c argument then item->commit is NULL. This means that if
there are merge conflicts error_with_patch() is passed a NULL commit
which causes a segmentation fault when make_patch() tries to look it up.

This commit implements a minimal fix which fixes the crash and allows
the user to successfully commit a conflict resolution with 'git rebase
--continue'. It does not write .git/rebase-merge/patch,
.git/rebase-merge/stopped-sha or update REBASE_HEAD. To sensibly get the
hashes of the merge parents would require refactoring do_merge() to
extract the code that parses the merge parents into a separate function
which error_with_patch() could then use to write the parents into the
stopped-sha file. To create meaningful output make_patch() and 'git
rebase --show-current-patch' would also need to be modified to diff the
merge parent and merge base in this case.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-16 08:54:50 -07:00
Phillip Wood d54e189862 t3430: add conflicting commit
Move the creation of conflicting-G from a test to the setup so that it
can be used in subsequent tests without creating the kind of implicit
dependencies that plague t3404. While we're at it simplify the
arguments to the test_commit() call the creates the conflicting commit.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-16 08:52:58 -07:00
Junio C Hamano 63749b2dea Sixth batch for 2.19 cycle
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-15 15:13:39 -07:00
Junio C Hamano b160b6e69d Merge branch 'jt/connectivity-check-after-unshallow'
"git fetch" sometimes failed to update the remote-tracking refs,
which has been corrected.

* jt/connectivity-check-after-unshallow:
  fetch-pack: unify ref in and out param
2018-08-15 15:08:28 -07:00
Junio C Hamano 6be44b59fc Merge branch 'sg/travis-retrieve-trash-upon-failure'
The Travis CI scripts were taught to ship back the test data from
failed tests.

* sg/travis-retrieve-trash-upon-failure:
  travis-ci: include the trash directories of failed tests in the trace log
2018-08-15 15:08:28 -07:00
Junio C Hamano 11ea82ae37 Merge branch 'rs/remote-mv-leakfix'
Leakfix.

* rs/remote-mv-leakfix:
  remote: clear string_list after use in mv()
2018-08-15 15:08:28 -07:00
Junio C Hamano c5c26f7cc2 Merge branch 'es/mw-to-git-chain-fix'
Test fix.

* es/mw-to-git-chain-fix:
  mw-to-git/t9360: fix broken &&-chain
2018-08-15 15:08:27 -07:00
Junio C Hamano dca64ed397 Merge branch 'ms/http-proto-doc'
Doc fix.

* ms/http-proto-doc:
  doc: fix want-capability separator
2018-08-15 15:08:27 -07:00
Junio C Hamano 2e2c24f82a Merge branch 'nd/pack-objects-threading-doc'
Doc fix.

* nd/pack-objects-threading-doc:
  pack-objects: document about thread synchronization
2018-08-15 15:08:27 -07:00
Junio C Hamano ab539208b2 Merge branch 'jn/subtree-test-fixes'
Test fix.

* jn/subtree-test-fixes:
  subtree test: simplify preparation of expected results
  subtree test: add missing && to &&-chain
2018-08-15 15:08:27 -07:00
Junio C Hamano dd4ab3eaaa Merge branch 'cb/p4-pre-submit-hook'
"git p4 submit" learns to ask its own pre-submit hook if it should
continue with submitting.

* cb/p4-pre-submit-hook:
  git-p4: add the `p4-pre-submit` hook
2018-08-15 15:08:27 -07:00
Junio C Hamano 30cf1911e2 Merge branch 'js/vscode'
Add a script (in contrib/) to help users of VSCode work better with
our codebase.

* js/vscode:
  vscode: let cSpell work on commit messages, too
  vscode: add a dictionary for cSpell
  vscode: use 8-space tabs, no trailing ws, etc for Git's source code
  vscode: wrap commit messages at column 72 by default
  vscode: only overwrite C/C++ settings
  mingw: define WIN32 explicitly
  cache.h: extract enum declaration from inside a struct declaration
  vscode: hard-code a couple defines
  contrib: add a script to initialize VS Code configuration
2018-08-15 15:08:26 -07:00
Junio C Hamano 88f240734f Merge branch 'bb/redecl-enum-fix'
Compilation fix.

* bb/redecl-enum-fix:
  packfile: ensure that enum object_type is defined
2018-08-15 15:08:26 -07:00
Junio C Hamano e28daf222f Merge branch 'jk/banned-function'
It is too easy to misuse system API functions such as strcat();
these selected functions are now forbidden in this codebase and
will cause a compilation failure.

* jk/banned-function:
  banned.h: mark strncpy() as banned
  banned.h: mark sprintf() as banned
  banned.h: mark strcat() as banned
  automatically ban strcpy()
2018-08-15 15:08:26 -07:00
Junio C Hamano e4095da40e Merge branch 'en/merge-recursive-skip-fix'
When the sparse checkout feature is in use, "git cherry-pick" and
other mergy operations lost the skip_worktree bit when a path that
is excluded from checkout requires content level merge, which is
resolved as the same as the HEAD version, without materializing the
merge result in the working tree, which made the path appear as
deleted.  This has been corrected by preserving the skip_worktree
bit (and not materializing the file in the working tree).

* en/merge-recursive-skip-fix:
  merge-recursive: preserve skip_worktree bit when necessary
  t3507: add a testcase showing failure with sparse checkout
2018-08-15 15:08:26 -07:00
Junio C Hamano d6628c99fa Merge branch 'jt/tag-following-with-proto-v2-fix'
The wire-protocol v2 relies on the client to send "ref prefixes" to
limit the bandwidth spent on the initial ref advertisement.  "git
fetch $remote branch:branch" that asks tags that point into the
history leading to the "branch" automatically followed sent to
narrow prefix and broke the tag following, which has been fixed.

* jt/tag-following-with-proto-v2-fix:
  fetch: send "refs/tags/" prefix upon CLI refspecs
  t5702: test fetch with multiple refspecs at a time
2018-08-15 15:08:25 -07:00
Junio C Hamano 7d020f5a78 Merge branch 'jk/size-t'
Code clean-up to use size_t/ssize_t when they are the right type.

* jk/size-t:
  strbuf_humanise: use unsigned variables
  pass st.st_size as hint for strbuf_readlink()
  strbuf_readlink: use ssize_t
  strbuf: use size_t for length in intermediate variables
  reencode_string: use size_t for string lengths
  reencode_string: use st_add/st_mult helpers
2018-08-15 15:08:25 -07:00
Junio C Hamano bce8031d9a Merge branch 'sg/coccicheck-updates'
Update the way we use Coccinelle to find out-of-style code that
need to be modernised.

* sg/coccicheck-updates:
  coccinelle: extract dedicated make target to clean Coccinelle's results
  coccinelle: put sane filenames into output patches
  coccinelle: exclude sha1dc source files from static analysis
  coccinelle: use $(addsuffix) in 'coccicheck' make target
  coccinelle: mark the 'coccicheck' make target as .PHONY
2018-08-15 15:08:25 -07:00