1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-06 10:16:12 +02:00
Commit Graph

46549 Commits

Author SHA1 Message Date
Ben Peart 4f2a2e9f0e convert: update subprocess_read_status() to not die on EOF
Enable sub-processes to gracefully handle when the process dies by
updating subprocess_read_status to return an error on EOF instead of
dying.

Update apply_multi_file_filter to take advantage of the revised
subprocess_read_status.

Signed-off-by: Ben Peart <benpeart@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-15 13:01:57 +09:00
Ben Peart 99605d62e8 sub-process: move sub-process functions into separate files
Move the sub-proces functions into sub-process.h/c.  Add documentation
for the new module in Documentation/technical/api-sub-process.txt

Signed-off-by: Ben Peart <benpeart@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-15 13:01:57 +09:00
Ben Peart f514d7d177 convert: rename reusable sub-process functions
Do a mechanical rename of the functions that will become the reusable
sub-process module.

Signed-off-by: Ben Peart <benpeart@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-15 13:01:57 +09:00
Ben Peart 7ddb9b2ca9 convert: update generic functions to only use generic data structures
Update all functions that are going to be moved into a reusable module
so that they only work with the reusable data structures.  Move code
that is specific to the filter out into the filter specific functions.

Signed-off-by: Ben Peart <benpeart@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-15 13:01:57 +09:00
Ben Peart 1b0b46ee3b convert: separate generic structures and variables from the filter specific ones
To enable future reuse of the filter.<driver>.process infrastructure,
split the cmd2process structure into two separate parts.

subprocess_entry will now contain the generic data required to manage
the creation and tracking of the child process in a hashmap.

cmd2process is a filter protocol specific structure that is used to
track the negotiated capabilities of the filter.

Signed-off-by: Ben Peart <benpeart@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-15 13:01:57 +09:00
Ben Peart a810ea9945 convert: split start_multi_file_filter() into two separate functions
To enable future reuse of the filter.<driver>.process infrastructure,
split start_multi_file_filter() into two separate parts.

start_multi_file_filter() will now only contain the generic logic to
manage the creation and tracking of the child process in a hashmap.

start_multi_file_filter_fn() is a protocol specific initialization
function that will negotiate the multi-file-filter interface version
and capabilities.

Signed-off-by: Ben Peart <benpeart@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-15 13:01:57 +09:00
Jeff King 7e936842f5 pkt-line: annotate packet_writel with LAST_ARG_MUST_BE_NULL
packet_writel() takes a variable-sized list and reads to
the first NULL. Let's let the compiler know so that it can
help us catch mistakes in the callers.

This should have been annotated similarly when it was a
static function, but it's doubly important now that the
function is available to the whole code-base.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-15 13:01:36 +09:00
Ben Peart c0c70f7ac0 convert: move packet_write_line() into pkt-line as packet_writel()
Add packet_writel() which writes multiple lines in a single call and
then calls packet_flush_gently(). Update convert.c to use the new
packet_writel() function from pkt-line.

Signed-off-by: Ben Peart <benpeart@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-08 10:57:26 +09:00
Ben Peart 825b9226bf pkt-line: add packet_read_line_gently()
Add packet_read_line_gently() to enable reading a line without dying on
EOF.

Signed-off-by: Ben Peart <benpeart@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-08 10:57:26 +09:00
Ben Peart 974b50c556 pkt-line: fix packet_read_line() to handle len < 0 errors
Update packet_read_line() to test for len > 0 to avoid potential bug
if read functions return lengths less than zero to indicate errors.

Signed-off-by: Ben Peart <benpeart@microsoft.com>
Found/Fixed-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-08 10:57:26 +09:00
Ben Peart 070e5f72d9 convert: remove erroneous tests for errno == EPIPE
start_multi_file_filter() and apply_multi_file_filter() currently test
for errno == EPIPE but treating EPIPE as an error is already happening
from one of the packet_write() functions.

Signed-off-by: Ben Peart <benpeart@microsoft.com>
Found/Fixed-by: Jeff King <peff@peff.net>
Acked-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-08 10:57:26 +09:00
Junio C Hamano e1104a5ee5 Ninth batch for 2.13
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-28 14:14:56 -07:00
Junio C Hamano e471fa3405 Sync with 'maint' 2017-03-28 14:14:24 -07:00
Junio C Hamano 62dc8b5fbc Merge branch 'jk/sha1dc'
sha1dc/sha1.c wanted to check the endianness of the target platform
at compilation time and used a CPP macro with a rather overly
generic name, "BIGENDIAN", to pass the result of the check around
in the file.  It wasn't prepared for the same macro set to 0
(false) by the platform to signal that the target is _not_ a big
endian box, and assumed that the endianness detection logic it has
alone would be the one that is setting the macro, resulting in a
breakage on Windows.  This has been fixed by using a bit less
generic name for the same purpose.

* jk/sha1dc:
  sha1dc: avoid CPP macro collisions
2017-03-28 14:06:00 -07:00
Junio C Hamano 0330344e0f Merge branch 'jh/memihash-opt'
The name-hash used for detecting paths that are different only in
cases (which matter on case insensitive filesystems) has been
optimized to take advantage of multi-threading when it makes sense.

* jh/memihash-opt:
  name-hash: add test-lazy-init-name-hash to .gitignore
  name-hash: add perf test for lazy_init_name_hash
  name-hash: add test-lazy-init-name-hash
  name-hash: perf improvement for lazy_init_name_hash
  hashmap: document memihash_cont, hashmap_disallow_rehash api
  hashmap: add disallow_rehash setting
  hashmap: allow memihash computation to be continued
  name-hash: specify initial size for istate.dir_hash table
2017-03-28 14:06:00 -07:00
Junio C Hamano 53a0f9f7ad Merge branch 'jk/fast-import-cleanup'
Code clean-up.

* jk/fast-import-cleanup:
  pack.h: define largest possible encoded object size
  encode_in_pack_object_header: respect output buffer length
  fast-import: use xsnprintf for formatting headers
  fast-import: use xsnprintf for writing sha1s
2017-03-28 14:05:59 -07:00
Junio C Hamano f494890292 Merge branch 'sg/skip-prefix-in-prettify-refname'
Code cleanup.

* sg/skip-prefix-in-prettify-refname:
  refs.c: use skip_prefix() in prettify_refname()
2017-03-28 14:05:59 -07:00
Junio C Hamano e779b0f070 Merge branch 'ab/branch-list-doc'
Doc update.

* ab/branch-list-doc:
  branch doc: update description for `--list`
  branch doc: change `git branch <pattern>` to use `<branchname>`
2017-03-28 14:05:59 -07:00
Junio C Hamano 6a5ff7acb5 Merge branch 'jk/pager-in-use'
Code clean-up.

* jk/pager-in-use:
  pager_in_use: use git_env_bool()
2017-03-28 14:05:59 -07:00
Junio C Hamano a612436f14 Merge branch 'tg/stash-push-fixup'
Recent enhancement to "git stash push" command to support pathspec
to allow only a subset of working tree changes to be stashed away
was found to be too chatty and exposed the internal implementation
detail (e.g. when it uses reset to match the index to HEAD before
doing other things, output from reset seeped out).  These, and
other chattyness has been fixed.

* tg/stash-push-fixup:
  stash: keep untracked files intact in stash -k
  stash: pass the pathspec argument to git reset
  stash: don't show internal implementation details
2017-03-28 14:05:58 -07:00
Junio C Hamano e394fa01d6 Merge branch 'sb/checkout-recurse-submodules'
"git checkout" is taught the "--recurse-submodules" option.

* sb/checkout-recurse-submodules:
  builtin/read-tree: add --recurse-submodules switch
  builtin/checkout: add --recurse-submodules switch
  entry.c: create submodules when interesting
  unpack-trees: check if we can perform the operation for submodules
  unpack-trees: pass old oid to verify_clean_submodule
  update submodules: add submodule_move_head
  submodule.c: get_super_prefix_or_empty
  update submodules: move up prepare_submodule_repo_env
  submodules: introduce check to see whether to touch a submodule
  update submodules: add a config option to determine if submodules are updated
  update submodules: add submodule config parsing
  make is_submodule_populated gently
  lib-submodule-update.sh: define tests for recursing into submodules
  lib-submodule-update.sh: replace sha1 by hash
  lib-submodule-update: teach test_submodule_content the -C <dir> flag
  lib-submodule-update.sh: do not use ./. as submodule remote
  lib-submodule-update.sh: reorder create_lib_submodule_repo
  submodule--helper.c: remove duplicate code
  connect_work_tree_and_git_dir: safely create leading directories
2017-03-28 14:05:58 -07:00
Junio C Hamano ff8b7e63de Merge branch 'bw/grep-recurse-submodules'
Build fix for NO_PTHREADS build.

* bw/grep-recurse-submodules:
  grep: fix builds with with no thread support
  grep: set default output method
2017-03-28 14:05:57 -07:00
Junio C Hamano 49800c9407 Prepare for 2.12.3 2017-03-28 13:54:14 -07:00
Junio C Hamano 67476f59bc Merge branch 'km/config-grammofix' into maint
Doc update.

* km/config-grammofix:
  doc/config: grammar fixes for core.{editor,commentChar}
2017-03-28 13:52:29 -07:00
Junio C Hamano 88fb4aa23a Merge branch 'sb/t3600-rephrase' into maint
A test retitling.

* sb/t3600-rephrase:
  t3600: rename test to describe its functionality
2017-03-28 13:52:29 -07:00
Junio C Hamano 04b4f7d579 Merge branch 'sb/submodule-update-initial-runs-custom-script' into maint
A test fix.

* sb/submodule-update-initial-runs-custom-script:
  t7406: correct test case for submodule-update initial population
2017-03-28 13:52:29 -07:00
Junio C Hamano 27ee56f9db Merge branch 'jk/quote-env-path-list-component' into maint
A test fix.

* jk/quote-env-path-list-component:
  t5615: fix a here-doc syntax error
2017-03-28 13:52:28 -07:00
Junio C Hamano fd7c41ec97 Merge branch 'rs/update-hook-optim' into maint
Code clean-up.

* rs/update-hook-optim:
  receive-pack: simplify run_update_post_hook()
2017-03-28 13:52:28 -07:00
Junio C Hamano fb0ab976c6 Merge branch 'rs/shortlog-cleanup' into maint
Code clean-up.

* rs/shortlog-cleanup:
  shortlog: don't set after_subject to an empty string
2017-03-28 13:52:28 -07:00
Junio C Hamano 1c91ec0b8e Merge branch 'rs/path-name-safety-cleanup' into maint
Code clean-up.

* rs/path-name-safety-cleanup:
  revision: remove declaration of path_name()
2017-03-28 13:52:27 -07:00
Junio C Hamano 310b94528c Merge branch 'rs/http-push-cleanup' into maint
Code clean-up.

* rs/http-push-cleanup:
  http-push: don't check return value of lookup_unknown_object()
2017-03-28 13:52:26 -07:00
Junio C Hamano e3c551dd7b Merge branch 'sb/wt-status-cleanup' into maint
Code clean-up.

* sb/wt-status-cleanup:
  wt-status: simplify by using for_each_string_list_item
2017-03-28 13:52:26 -07:00
Junio C Hamano ba5e05ffef Merge branch 'jk/pack-name-cleanups' into maint
Code clean-up.

* jk/pack-name-cleanups:
  index-pack: make pointer-alias fallbacks safer
  replace snprintf with odb_pack_name()
  odb_pack_keep(): stop generating keepfile name
  sha1_file.c: make pack-name helper globally accessible
  move odb_* declarations out of git-compat-util.h
2017-03-28 13:52:25 -07:00
Junio C Hamano 8f71209d1e Merge branch 'jk/rev-parse-cleanup' into maint
Code clean-up.

* jk/rev-parse-cleanup:
  rev-parse: simplify parsing of ref options
  rev-parse: add helper for parsing "--foo/--foo="
  rev-parse: use skip_prefix when parsing options
2017-03-28 13:52:25 -07:00
Junio C Hamano a9508a1345 Merge branch 'rs/blame-code-cleanup' into maint
Code clean-up.

* rs/blame-code-cleanup:
  blame: move blame_entry duplication to add_blame_entry()
2017-03-28 13:52:25 -07:00
Junio C Hamano 110bdbddc8 Merge branch 'st/verify-tag' into maint
A few unterminated here documents in tests were fixed, which in
turn revealed incorrect expectations the tests make. These tests
have been updated.

* st/verify-tag:
  t7004, t7030: fix here-doc syntax errors
2017-03-28 13:52:24 -07:00
Junio C Hamano 57009b1dd9 Merge branch 'js/regexec-buf' into maint
Fix for potential segv introduced in v2.11.0 and later (also
v2.10.2).

* js/regexec-buf:
  pickaxe: fix segfault with '-S<...> --pickaxe-regex'
2017-03-28 13:52:24 -07:00
Junio C Hamano fd3ab91ce6 Merge branch 'jk/execv-dashed-external' into maint
Fix for NO_PTHREADS build.

* jk/execv-dashed-external:
  run-command: fix segfault when cleaning forked async process
2017-03-28 13:52:23 -07:00
Junio C Hamano c953cf95a5 Merge branch 'ew/http-alternates-as-redirects-warning' into maint
Recent versions of Git treats http alternates (used in dumb http
transport) just like HTTP redirects and requires the client to
enable following it, due to security concerns.  But we forgot to
give a warning when we decide not to honor the alternates.

* ew/http-alternates-as-redirects-warning:
  http: release strbuf on disabled alternates
  http: inform about alternates-as-redirects behavior
2017-03-28 13:52:23 -07:00
Junio C Hamano bfee58c0a5 Merge branch 'dp/filter-branch-prune-empty' into maint
"git filter-branch --prune-empty" drops a single-parent commit that
becomes a no-op, but did not drop a root commit whose tree is empty.

* dp/filter-branch-prune-empty:
  p7000: add test for filter-branch with --prune-empty
  filter-branch: fix --prune-empty on parentless commits
  t7003: ensure --prune-empty removes entire branch when applicable
  t7003: ensure --prune-empty can prune root commit
2017-03-28 13:52:22 -07:00
Junio C Hamano 2b69d3116f Merge branch 'mm/fetch-show-error-message-on-unadvertised-object' into maint
"git fetch" that requests a commit by object name, when the other
side does not allow such an request, failed without much
explanation.

* mm/fetch-show-error-message-on-unadvertised-object:
  fetch-pack: add specific error for fetching an unadvertised object
  fetch_refs_via_pack: call report_unmatched_refs
  fetch-pack: move code to report unmatched refs to a function
2017-03-28 13:52:22 -07:00
Junio C Hamano 41534b626e Merge branch 'jk/interpret-branch-name' into maint
"git branch @" created refs/heads/@ as a branch, and in general the
code that handled @{-1} and @{upstream} was a bit too loose in
disambiguating.

* jk/interpret-branch-name:
  checkout: restrict @-expansions when finding branch
  strbuf_check_ref_format(): expand only local branches
  branch: restrict @-expansions when deleting
  t3204: test git-branch @-expansion corner cases
  interpret_branch_name: allow callers to restrict expansions
  strbuf_branchname: add docstring
  strbuf_branchname: drop return value
  interpret_branch_name: move docstring to header file
  interpret_branch_name(): handle auto-namelen for @{-1}
2017-03-28 13:52:22 -07:00
Junio C Hamano e25c1229b2 Merge branch 'ab/cond-skip-tests' into maint
A few tests were run conditionally under (rare) conditions where
they cannot be run (like running cvs tests under 'root' account).

* ab/cond-skip-tests:
  gitweb tests: skip tests when we don't have Time::HiRes
  gitweb tests: change confusing "skip_all" phrasing
  cvs tests: skip tests that call "cvs commit" when running as root
2017-03-28 13:52:21 -07:00
Junio C Hamano bb622de88d Merge branch 'jk/ident-empty' into maint
user.email that consists of only cruft chars should consistently
error out, but didn't.

* jk/ident-empty:
  ident: do not ignore empty config name/email
  ident: reject all-crud ident name
  ident: handle NULL email when complaining of empty name
  ident: mark error messages for translation
2017-03-28 13:52:21 -07:00
Junio C Hamano 252ef8fe9e Merge branch 'jk/delta-chain-limit' into maint
"git repack --depth=<n>" for a long time busted the specified depth
when reusing delta from existing packs.  This has been corrected.

* jk/delta-chain-limit:
  pack-objects: convert recursion to iteration in break_delta_chain()
  pack-objects: enforce --depth limit in reused deltas
2017-03-28 13:52:21 -07:00
Junio C Hamano 930405224f Merge branch 'sg/test-with-stdin' into maint
Teach the "debug" helper used in the test framework that allows a
command to run under "gdb" to make the session interactive.

* sg/test-with-stdin:
  tests: make the 'test_pause' helper work in non-verbose mode
  tests: create an interactive gdb session with the 'debug' helper
2017-03-28 13:52:20 -07:00
Junio C Hamano c34aa34299 Merge branch 'jk/interop-test' into maint
Picking two versions of Git and running tests to make sure the
older one and the newer one interoperate happily has now become
possible.

* jk/interop-test:
  t/interop: add test of old clients against modern git-daemon
  t: add an interoperability test harness
2017-03-28 13:52:20 -07:00
Junio C Hamano e0c74e6f38 Merge branch 'jt/perf-updates' into maint
The t/perf performance test suite was not prepared to test not so
old versions of Git, but now it covers versions of Git that are not
so ancient.

* jt/perf-updates:
  t/perf: add fallback for pre-bin-wrappers versions of git
  t/perf: use $MODERN_GIT for all repo-copying steps
  t/perf: export variable used in other blocks
2017-03-28 13:52:19 -07:00
Junio C Hamano cd27bc7a0b Merge branch 'rs/strbuf-add-real-path' into maint
An helper function to make it easier to append the result from
real_path() to a strbuf has been added.

* rs/strbuf-add-real-path:
  strbuf: add strbuf_add_real_path()
  cocci: use ALLOC_ARRAY
2017-03-28 13:52:19 -07:00
Junio C Hamano c772d1bcdc Merge branch 'jk/parse-config-key-cleanup' into maint
The "parse_config_key()" API function has been cleaned up.

* jk/parse-config-key-cleanup:
  parse_hide_refs_config: tell parse_config_key we don't want a subsection
  parse_config_key: allow matching single-level config
  parse_config_key: use skip_prefix instead of starts_with
  refs: parse_hide_refs_config to use parse_config_key
2017-03-28 13:52:19 -07:00