summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
11 hoursMerge branch 'jx/proc-receive-hook' into pupuJunio C Hamano
* jx/proc-receive-hook: doc: add documentation for the proc-receive hook receive-pack: refactor report for proc-receive receive-pack: new config receive.procReceiveRefs refs.c: refactor to reuse ref_is_hidden() receive-pack: add new proc-receive hook transport: not report a non-head push as a branch
11 hoursMerge branch 'dr/doc-recurse-submodules' into puJunio C Hamano
Documentation updates around the "--recurse-submodules" option. Getting there... cf. <F03FAA2F-EDFB-4497-A4E8-3AC267C779FC@gmail.com> cf. <1EA4CEB1-D329-4916-A9AC-2F64A7A4F6D0@gmail.com> * dr/doc-recurse-submodules: doc: --recurse-submodules mostly applies to active submodules doc: be more precise on (fetch|push).recurseSubmodules doc: explain how to deactivate submodule.recurse completely doc: document --recurse-submodules for reset and restore doc: list all commands affected by submodule.recurse
11 hoursMerge branch 'dl/libify-a-few' into puJunio C Hamano
Code in builtin/*, i.e. those can only be called from within built-in subcommands, that implements bulk of a couple of subcommands have been moved to libgit.a so that they could be used by others. * dl/libify-a-few: Lib-ify prune-packed Lib-ify fmt-merge-msg
11 hoursMerge branch 'dl/merge-autostash' into puJunio C Hamano
"git merge" learns the "--autostash" option. * dl/merge-autostash: pull: pass --autostash to merge t5520: make test_pull_autostash() accept expect_parent_num merge: teach --autostash option sequencer: implement save_autostash() sequencer: unlink autostash in apply_autostash() sequencer: extract perform_autostash() from rebase rebase: generify create_autostash() rebase: extract create_autostash() reset: extract reset_head() from rebase rebase: generify reset_head() rebase: use apply_autostash() from sequencer.c sequencer: make apply_rebase() accept a path rebase: use read_oneliner() sequencer: make read_oneliner() extern sequencer: configurably warn on non-existent files sequencer: make read_oneliner() accept flags sequencer: use file strbuf for read_oneliner() t7600: use test_write_lines() Makefile: ASCII-sort += lists
11 hoursMerge branch 'jc/log-no-mailmap' into puJunio C Hamano
"git log" learns "--[no-]mailmap" as a synonym to "--[no-]use-mailmap" * jc/log-no-mailmap: log: give --[no-]use-mailmap a more sensible synonym --[no-]mailmap clone: reorder --recursive/--recurse-submodules parse-options: teach "git cmd -h" to show alias as alias
11 hoursMerge branch 'es/bugreport' into puJunio C Hamano
The "bugreport" tool. Ready for 'next' to be improved/enhanced on top? As the scope of the topic got trimmed, hopefully these early parts can be polished quickly enough to be merged down. * es/bugreport: bugreport: add compiler info bugreport: add uname info bugreport: gather git version and build info bugreport: add tool to generate debugging info help: move list_config_help to builtin/help
11 hoursMerge branch 'en/fill-directory-exponential' into puJunio C Hamano
The directory traversal code had redundant recursive calls which made its performance characteristics exponential with respect to the depth of the tree, which was corrected. * en/fill-directory-exponential: dir: replace exponential algorithm with a linear one dir: refactor treat_directory to clarify control flow dir: fix confusion based on variable tense dir: fix broken comment dir: consolidate treat_path() and treat_one_path() dir: fix simple typo in comment t7063: more thorough status checking
11 hoursMerge branch 'mk/use-size-t-in-zlib' into puJunio C Hamano
The wrapper to call into zlib followed our long tradition to use "unsigned long" for sizes of regions in memory, which have been updated to use "size_t". * mk/use-size-t-in-zlib: zlib.c: use size_t for size
11 hoursMerge branch 'dd/ci-musl-libc' into puJunio C Hamano
A new CI job to build and run test suite on linux with musl libc has been added. * dd/ci-musl-libc: travis: build and test on Linux with musl libc and busybox ci: refactor docker runner script ci: libify logic for usage and checking CI_USER
11 hoursMerge branch 'jx/atomic-push' into puJunio C Hamano
"git push --atomic" used to show failures for refs that weren't even pushed, which has been corrected. * jx/atomic-push: transport-helper: new method reject_atomic_push() transport-helper: mark failure for atomic push send-pack: mark failure of atomic push properly t5543: never report what we do not push
11 hoursMerge branch 'ma/doc-discard-docbook-xsl-1.73' into puJunio C Hamano
Raise the minimum required version of docbook-xsl package to 1.74, as 1.74.0 was from late 2008, which is more than 10 years old, and drop compatibility cruft from our documentation suite. * ma/doc-discard-docbook-xsl-1.73: INSTALL: drop support for docbook-xsl before 1.74 manpage-normal.xsl: fold in manpage-base.xsl manpage-bold-literal.xsl: stop using git.docbook.backslash Doc: drop support for docbook-xsl before 1.73.0 Doc: drop support for docbook-xsl before 1.72.0 Doc: drop support for docbook-xsl before 1.71.1
11 hoursMerge branch 'gs/commit-graph-path-filter' into puJunio C Hamano
Introduce an extension to the commit-graph to make it efficient to check for the paths that were modified at each commit using Bloom filters. * gs/commit-graph-path-filter: commit-graph: add GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS test flag t4216: add end to end tests for git log with Bloom filters revision.c: add trace2 stats around Bloom filter usage revision.c: use Bloom filters to speed up path based revision walks commit-graph: add --changed-paths option to write subcommand commit-graph: reuse existing Bloom filters during write commit-graph: write Bloom filters to commit graph file diff: skip batch object download when possible commit-graph: examine commits by generation number commit-graph: examine changed-path objects in pack order commit-graph: compute Bloom filters for changed paths diff: halt tree-diff early after max_changes bloom.c: core Bloom filter implementation for changed paths. bloom.c: introduce core Bloom filter constructs bloom.c: add the murmur3 hash implementation commit-graph: define and use MAX_NUM_CHUNKS
11 hoursMerge branch 'ps/transactional-update-ref-stdin' into puJunio C Hamano
"git update-ref --stdin" learned a handful of new verbs to let the user control ref update transactions more explicitly, which helps as an ingredient to implement two-phase commit-style atomic ref-updates across multiple repositories. Good start, but suspect not quite there yet. cf. <xmqqo8she9yp.fsf@gitster.c.googlers.com> * ps/transactional-update-ref-stdin: update-ref: implement interactive transaction handling update-ref: read commands in a line-wise fashion update-ref: move transaction handling into `update_refs_stdin()` update-ref: pass end pointer instead of strbuf update-ref: drop unused argument for `parse_refname` update-ref: organize commands in an array strbuf: provide function to append whole lines git-update-ref.txt: add missing word refs: fix segfault when aborting empty transaction
12 hoursMerge branch 'ag/rebase-merge-allow-ff-under-abbrev-command' into jchJunio C Hamano
* ag/rebase-merge-allow-ff-under-abbrev-command: t3432: test `--merge' with `rebase.abbreviateCommands = true', too sequencer: don't abbreviate a command if it doesn't have a short form
12 hourst3432: test `--merge' with `rebase.abbreviateCommands = true', tooAlban Gruin
When fast forwarding, `git --merge' should act the same whether `rebase.abbreviateCommands' is set or not, but so far it was not the case. This duplicates the tests ensuring that `--merge' works when fast forwarding to check if it also works with abbreviated commands. Signed-off-by: Alban Gruin <alban.gruin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 hourssequencer: don't abbreviate a command if it doesn't have a short formAlban Gruin
When the sequencer is requested to abbreviate commands, it will replace those that do not have a short form (eg. `noop') by a comment mark. `noop' serves no purpose, except when fast-forwarding (ie. by running `git rebase'). Removing it will break this command when `rebase.abbreviateCommands' is set to true. Teach todo_list_to_strbuf() to check if a command has an actual short form, and to ignore it if not. Signed-off-by: Alban Gruin <alban.gruin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 hoursMerge branch 'jk/oid-array-cleanups' into jchJunio C Hamano
* jk/oid-array-cleanups: oidset: stop referring to sha1-array ref-filter: stop referring to "sha1 array" bisect: stop referring to sha1_array test-tool: rename sha1-array to oid-array oid_array: rename source file from sha1-array oid_array: use size_t for iteration oid_array: use size_t for count and allocation
13 hoursMerge branch 'jt/rebase-allow-duplicate' into jchJunio C Hamano
Allow "git rebase" to reapply all local commits, even if the may be already in the upstream, without checking first. * jt/rebase-allow-duplicate: t3402: use POSIX compliant regex(7) rebase --merge: optionally skip upstreamed commits
13 hoursMerge branch 'jm/gitweb-fastcgi-utf8' into jchJunio C Hamano
Gitweb update. * jm/gitweb-fastcgi-utf8: gitweb: fix UTF-8 encoding when using CGI::Fast
13 hoursMerge branch 'jc/allow-strlen-substitution-in-shell-scripts' into jchJunio C Hamano
Coding guideline update. * jc/allow-strlen-substitution-in-shell-scripts: CodingGuidelines: allow ${#posix} == strlen($posix)
13 hoursMerge branch 'en/pull-do-not-rebase-after-fast-forwarding' into jchJunio C Hamano
"git pull --rebase" tried to run a rebase even after noticing that the pull results in a fast-forward and no rebase is needed nor sensible, for the past few years due to a mistake nobody noticed. * en/pull-do-not-rebase-after-fast-forwarding: pull: avoid running both merge and rebase
13 hoursMerge branch 'dl/wrapper-fix-indentation' into jchJunio C Hamano
Coding style fix. * dl/wrapper-fix-indentation: wrapper: indent with tabs
13 hoursMerge branch 'ag/sequencer-i18n-messages' into jchJunio C Hamano
Message fix. * ag/sequencer-i18n-messages: sequencer: mark messages for translation
13 hoursMerge branch 'rs/pull-options-sync-code-and-doc' into jchJunio C Hamano
"git pull" shares many options with underlying "git fetch", but some of them were not documented and some of those that would make sense to pass down were not passed down. * rs/pull-options-sync-code-and-doc: pull: pass documented fetch options on pull: remove --update-head-ok from documentation
13 hoursMerge branch 'js/walk-doc-optim' into jchJunio C Hamano
Code cleanup. * js/walk-doc-optim: MyFirstObjectWalk: remove unnecessary conditional statement
13 hoursMyFirstObjectWalk: remove unnecessary conditional statementJohannes Schindelin
In the given example, `commit` cannot be `NULL` (because this is the loop condition: if it was `NULL`, the loop body would not be entered at all). It took this developer a moment or two to see that this is therefore dead code. Let's remove it, to avoid puzzling future readers. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Reviewed-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 hoursMerge branch 'pb/rebase-doc-typofix' into jchJunio C Hamano
Typofix. * pb/rebase-doc-typofix: git-rebase.txt: fix typo
14 hoursMerge branch 'jk/build-with-right-curl' into jchJunio C Hamano
The build procedure did not use the libcurl library and its include files correctly for a custom-built installation. * jk/build-with-right-curl: Makefile: use curl-config --cflags Makefile: avoid running curl-config multiple times
14 hoursMerge branch 'jk/p5310-drop-non-bitmap-timing' into jchJunio C Hamano
Perf-test update. * jk/p5310-drop-non-bitmap-timing: p5310: stop timing non-bitmap pack-to-disk
14 hoursMerge branch 'dr/push-remoteref-fix' into jchJunio C Hamano
The "%(push:remoteref)" placeholder in the "--format=" argument of "git format-patch" (and friends) only showed what got explicitly configured, not what ref at the receiving end would be updated when "git push" was used, as it ignored the default behaviour (e.g. update the same ref as the source). * dr/push-remoteref-fix: remote.c: fix handling of %(push:remoteref)
14 hoursMerge branch 'jk/harden-protocol-v2-delim-handling' into jchJunio C Hamano
The server-end of the v2 protocol to serve "git clone" and "git fetch" was not prepared to see a delim packets at unexpected places, which led to a crash. * jk/harden-protocol-v2-delim-handling: test-lib-functions: simplify packetize() stdin code upload-pack: handle unexpected delim packets test-lib-functions: make packetize() more efficient
14 hoursMerge branch 'jk/test-cleanup' into jchJunio C Hamano
Test cleanup. * jk/test-cleanup: t/lib-*.sh: drop executable bit t/lib-credential.sh: drop shebang line
14 hoursMerge branch 'ak/run-command-on-cygwin-fix' into jchJunio C Hamano
Utitiles run via the run_command() API were not spawned correctly on Cygwin, when the paths to them are given as a full path with backslashes. * ak/run-command-on-cygwin-fix: run-command: trigger PATH lookup properly on Cygwin
14 hoursMerge branch 'jc/doc-test-leaving-early' into jchJunio C Hamano
Document the recommended way to abort a failing test early (e.g. by exiting a loop), which is to say "return 1". * jc/doc-test-leaving-early: t/README: suggest how to leave test early with failure
14 hoursMerge branch 'dr/midx-avoid-int-underflow' into jchJunio C Hamano
When fed a midx that records no objects, some codepaths tried to loop from 0 through (num_objects-1), which, due to integer arithmetic wrapping around, made it nonsense operation with out of bounds array accesses. The code has been corrected to reject such an midx file. * dr/midx-avoid-int-underflow: midx.c: fix an integer underflow
14 hoursMerge branch 'dl/test-must-fail-fixes-3' into jchJunio C Hamano
Test clean-up continues. * dl/test-must-fail-fixes-3: t5801: teach compare_refs() to accept ! t5612: stop losing return codes of git commands t5612: don't use `test_must_fail test_cmp` t5607: reorder `nongit test_must_fail` t5550: simplify no matching line check t5512: stop losing return codes of git commands t5512: stop losing git exit code in here-docs t5512: don't use `test_must_fail test_cmp`
14 hoursMerge branch 'js/trace2-env-vars' into jchJunio C Hamano
Trace2 enhancement to allow logging of the environment variables. * js/trace2-env-vars: trace2: teach Git to log environment variables
14 hoursMerge branch 'en/sparse-checkout' into jchJunio C Hamano
"sparse-checkout" UI improvements. * en/sparse-checkout: sparse-checkout: provide a new reapply subcommand unpack-trees: failure to set SKIP_WORKTREE bits always just a warning unpack-trees: provide warnings on sparse updates for unmerged paths too unpack-trees: make sparse path messages sound like warnings unpack-trees: split display_error_msgs() into two unpack-trees: rename ERROR_* fields meant for warnings to WARNING_* unpack-trees: move ERROR_WOULD_LOSE_SUBMODULE earlier sparse-checkout: use improved unpack_trees porcelain messages sparse-checkout: use new update_sparsity() function unpack-trees: add a new update_sparsity() function unpack-trees: pull sparse-checkout pattern reading into a new function unpack-trees: do not mark a dirty path with SKIP_WORKTREE unpack-trees: allow check_updates() to work on a different index t1091: make some tests a little more defensive against failures unpack-trees: simplify pattern_list freeing unpack-trees: simplify verify_absent_sparse() unpack-trees: remove unused error type unpack-trees: fix minor typo in comment
14 hoursMerge branch 'jt/connectivity-check-optim-in-partial-clone' into jchJunio C Hamano
Simplify the commit ancestry connectedness check in a partial clone repository in which "promised" objects are assumed to be obtainable lazily on-demand from promisor remote repositories. Looking good. cf. <20200326231416.GC12694@google.com> * jt/connectivity-check-optim-in-partial-clone: connected: always use partial clone optimization
14 hoursMerge branch 'bc/faq' into jchJunio C Hamano
Doc update. * bc/faq: docs: add a FAQ
14 hoursoidset: stop referring to sha1-arrayJeff King
Ths has been oid_array for some time, though the source only recently moved from sha1-array.[ch] to oid-array.[ch]. In either case, we should say "oid-array" here. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 hoursref-filter: stop referring to "sha1 array"Jeff King
A comment refers to the "sha1s in the given sha1 array". But this became an oid_array along with everywhere else in 910650d2f8 (Rename sha1_array to oid_array, 2017-03-31). Plus there's an extra line of leftover editing cruft we can drop. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 hoursbisect: stop referring to sha1_arrayJeff King
Our join_sha1_array_hex() function long ago switched to using an oid_array; let's change the name to match. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 hourstest-tool: rename sha1-array to oid-arrayJeff King
This matches the actual data structure name, as well as the source file that contains the code we're testing. The test scripts need updating to use the new name, as well. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 hoursoid_array: rename source file from sha1-arrayJeff King
We renamed the actual data structure in 910650d2f8 (Rename sha1_array to oid_array, 2017-03-31), but the file is still called sha1-array. Besides being slightly confusing, it makes it more annoying to grep for leftover occurrences of "sha1" in various files, because the header is included in so many places. Let's complete the transition by renaming the source and header files (and fixing up a few comment references). I kept the "-" in the name, as that seems to be our style; cf. fc1395f4a4 (sha1_file.c: rename to use dash in file name, 2018-04-10). We also have oidmap.h and oidset.h without any punctuation, but those are "struct oidmap" and "struct oidset" in the code. We _could_ make this "oidarray" to match, but somehow it looks uglier to me because of the length of "array" (plus it would be a very invasive patch for little gain). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 hoursoid_array: use size_t for iterationJeff King
The previous commit started using size_t for our allocations. There are some iterations that use int or unsigned, though. These aren't dangerous with respect to memory, but they could produce incorrect results. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 hoursoid_array: use size_t for count and allocationJeff King
The oid_array object uses an "int" to store the number of items and the allocated size. It's rather unlikely for somebody to have more than 2^31 objects in a repository (the sha1's alone would be 40GB!), but if they do, we'd overflow our alloc variable. You can reproduce this case with something like: git init repo cd repo # make a pack with 2^24 objects perl -e ' my $nr = 2**24; for (my $i = 0; $i < $nr; $i++) { print "blob\n"; print "data 4\n"; print pack("N", $i); } ' | git fast-import # now make 256 copies of it; most of these objects will be duplicates, # but oid_array doesn't de-dup until all values are read and it can # sort the result. cd .git/objects/pack/ pack=$(echo *.pack) idx=$(echo *.idx) for i in $(seq 0 255); do # no need to waste disk space ln "$pack" "pack-extra-$i.pack" ln "$idx" "pack-extra-$i.idx" done # and now force an oid_array to store all of it git cat-file --batch-all-objects --batch-check which results in: fatal: size_t overflow: 32 * 18446744071562067968 So the good news is that st_mult() sees the problem (the large number is because our int wraps negative, and then that gets cast to a size_t), doing the job it was meant to: bailing in crazy situations rather than causing an undersized buffer. But we should avoid hitting this case at all, and instead limit ourselves based on what malloc() is willing to give us. We can easily do that by switching to size_t. The cat-file process above made it to ~120GB virtual set size before the integer overflow (our internal hash storage is 32-bytes now in preparation for sha256, so we'd expect ~128GB total needed, plus potentially more to copy from one realloc'd block to another)). After this patch (and about 130GB of RAM+swap), it does eventually read in the whole set. No test for obvious reasons. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 hoursdoc: add documentation for the proc-receive hookJiang Xin
Add documentation for the new "proc-receive" hook. Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 hoursreceive-pack: refactor report for proc-receiveJiang Xin
The "proc-receive" may update one or more references, and will send its result one by one in pkt-line format. Each line of the result has four fields and one optional message field, as "<old-oid> <new-oid> <ref> <status> [<message>]". See the following example: # OK, run this command successfully. PKT-LINE(old-oid new-oid ref ok) # NO, I reject it. PKT-LINE(old-oid new-oid ref ng reason) # OK, but use an alternate reference. PKT-LINE(old-oid new-oid ref ok ref:alt-ref) # It will fallthrough to receive-pack to execute. PKT-LINE(old-oid new-oid ref ft) The first three fields have the same foramt as a command. The forth field has a two-letter status code. Available status code: * ok: The command runs successfully. If the optional message has a prefix "ref:", the hook has created/updated an alternate reference instead. * ng: Fail to run the command. Error message is in the optional message field. * ft: Will fallthrough to receive-pack to execute. Suggested-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 hoursreceive-pack: new config receive.procReceiveRefsJiang Xin
Add a new multi-valued config variable "receive.procReceiveRefs" for `receive-pack` command, like the follows: git config --system --add receive.procReceiveRefs refs/for/ git config --system --add receive.procReceiveRefs refs/drafts/ If the specific prefix strings match the reference names of the commands which are sent by git client to `receive-pack`, these commands will be executed by an external hook (named "proc-receive"), instead of the internal `execute_commands` function. For example, if it is set to "refs/for/", pushing to a reference such as "refs/for/master" will not create or update reference "refs/for/master", but may create or update a pull request directly by running the external hook. Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>