{"thread":{"id":"54259","subject":"What's cooking in git.git (Sep 2020, #05; Fri, 18)","startedAt":"2020-09-19T01:42:57Z","lastAt":"2020-09-20T08:03:31Z","messageCount":7,"participants":["Junio C Hamano","René Scharfe"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"405926","messageId":"xmqqwo0qk0fw.fsf@gitster.c.googlers.com","threadId":"54259","inReplyTo":null,"subject":"What's cooking in git.git (Sep 2020, #05; Fri, 18)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-09-19T01:41:23Z","receivedAt":"2020-09-19T01:42:57Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Here are the topics that have been cooking.  Commits prefixed with '-' are\nonly in 'seen' (formerly 'pu'---proposed updates) while commits prefixed\nwith '+' are in 'next'.  The ones marked with '.' do not appear in any of\nthe integration branches, but I am still holding onto them.\n\nYou can find the changes described here in the integration branches of the\nrepositories listed at\n\n    http://git-blame.blogspot.com/p/git-public-repositories.html\n\n--------------------------------------------------\n[Graduated to 'master']\n\n* al/t3200-back-on-a-branch (2020-09-08) 1 commit\n  (merged to 'next' on 2020-09-09 at 833e2fc60c)\n + t3200: clean side effect of git checkout --orphan\n\n Test fix.\n\n\n* ea/blame-use-oideq (2020-09-08) 1 commit\n  (merged to 'next' on 2020-09-09 at babefe4727)\n + blame.c: replace instance of !oidcmp for oideq\n\n Code cleanup.\n\n\n* es/wt-add-detach (2020-09-06) 3 commits\n  (merged to 'next' on 2020-09-10 at abd83f90e7)\n + git-worktree.txt: discuss branch-based vs. throwaway worktrees\n + worktree: teach `add` to recognize -d as shorthand for --detach\n + git-checkout.txt: document -d short option for --detach\n\n \"git worktree add\" learns that the \"-d\" is a synonym to \"--detach\"\n option to create a new worktree without being on a branch.\n\n\n* hn/refs-ref-log-only-bit (2020-09-08) 1 commit\n  (merged to 'next' on 2020-09-09 at f729cb2c81)\n + refs: move REF_LOG_ONLY to refs-internal.h\n\n A bit of API reshuffling to make sure stuff common to all backends\n are not defined only in files backend.\n\n\n* jc/add-i-use-builtin-experimental (2020-09-08) 1 commit\n  (merged to 'next' on 2020-09-09 at abcb7515dc)\n + add -i: use the built-in version when feature.experimental is set\n\n The \"add -i/-p\" machinery has been written in C but it is not used\n by default yet.  It is made default to those who are participating\n in feature.experimental experiment.\n\n\n* jc/dist-tarball-tweak (2020-09-09) 1 commit\n  (merged to 'next' on 2020-09-10 at 36cbe7ee9e)\n + Makefile: allow extra tweaking of distribution tarball\n\n Allow maintainers to tweak $(TAR) invocations done while making\n distribution tarballs.\n\n\n* jc/quote-path-cleanup (2020-09-10) 7 commits\n  (merged to 'next' on 2020-09-10 at 3bfde81846)\n + quote: turn 'nodq' parameter into a set of flags\n + quote: rename misnamed sq_lookup[] to cq_lookup[]\n + wt-status: consistently quote paths in \"status --short\" output\n + quote_path: code clarification\n + quote_path: optionally allow quoting a path with SP in it\n + quote_path: give flags parameter to quote_path()\n + quote_path: rename quote_path_relative() to quote_path()\n\n \"git status --short\" quoted a path with SP in it when tracked, but\n not those that are untracked, ignored or unmerged.  They are all\n shown quoted consistently.\n\n\n* jk/add-i-fixes (2020-09-08) 2 commits\n  (merged to 'next' on 2020-09-09 at 46ea071a7a)\n + add--interactive.perl: specify --no-color explicitly\n + add-patch: fix inverted return code of repo_read_index()\n\n \"add -i/-p\" fixes.\n\n\n* mf/submodule-summary-with-correct-repository (2020-06-24) 2 commits\n  (merged to 'next' on 2020-09-10 at 7853fe7e12)\n + submodule: use submodule repository when preparing summary\n + revision: use repository from rev_info when parsing commits\n\n \"git diff/show\" on a change that involves a submodule used to read\n the information on commits in the submodule from a wrong repository\n and gave a wrong information when the commit-graph is involved.\n cf. <xmqqzh667ca4.fsf@gitster.c.googlers.com>\n\n\n* mt/config-fail-nongit-early (2020-09-09) 1 commit\n  (merged to 'next' on 2020-09-10 at 6f77f65b4e)\n + config: complain about --worktree outside of a git repo\n\n Unlike \"git config --local\", \"git config --worktree\" did not fail\n early and cleanly when started outside a git repository.\n\n\n* os/collect-changed-submodules-optim (2020-09-06) 1 commit\n  (merged to 'next' on 2020-09-10 at b6d9ed060e)\n + submodule: suppress checking for file name and ref ambiguity for object ids\n\n Optimization around submodule handling.\n\n\n* pb/clang-json-compilation-database (2020-09-06) 1 commit\n  (merged to 'next' on 2020-09-09 at 9f5ea136f1)\n + Makefile: add support for generating JSON compilation database\n\n Developer support.\n\n\n* pw/add-p-leakfix (2020-09-08) 1 commit\n  (merged to 'next' on 2020-09-09 at 4206d0503c)\n + add -p: fix memory leak\n\n Leakfix.\n\n\n* rs/misc-cleanups (2020-09-06) 3 commits\n  (merged to 'next' on 2020-09-09 at 4a19ea9672)\n + pack-bitmap-write: use hashwrite_be32() in write_hash_cache()\n + midx: use hashwrite_u8() in write_midx_header()\n + fast-import: use write_pack_header()\n\n Misc cleanups.\n\n\n* rs/parallel-read-cache-fix (2020-09-06) 1 commit\n  (merged to 'next' on 2020-09-09 at 92953a75c4)\n + read-cache: fix mem-pool allocation for multi-threaded index loading\n\n A follow-up fix to a topic already in 'master'.\n\n\n* rs/refspec-leakfix (2020-09-06) 2 commits\n  (merged to 'next' on 2020-09-09 at 10741e90a5)\n + refspec: add and use refspec_appendf()\n + push: release strbufs used for refspec formatting\n\n Leakfix.\n\n\n* so/log-tree-diff-cleanup (2020-09-06) 2 commits\n  (merged to 'next' on 2020-09-09 at f8744b8e8a)\n + log_tree_diff: get rid of extra check for NULL\n + log_tree_diff: get rid of code duplication for first_parent_only\n\n Code cleanup.\n\n--------------------------------------------------\n[New Topics]\n\n* cs/don-t-pretend-a-failed-remote-set-head-succeeded (2020-09-17) 1 commit\n  (merged to 'next' on 2020-09-18 at 51f73ca6dc)\n + remote: don't show success message when set-head fails\n\n \"git remote set-head\" that failed still said something that hints\n the operation went through, which was misleading.\n\n Will merge to 'master'.\n\n\n* dl/diff-merge-base (2020-09-17) 10 commits\n - contrib/completion: complete `git diff --merge-base`\n - builtin/diff-tree: learn --merge-base\n - builtin/diff-index: learn --merge-base\n - t4068: add --merge-base tests\n - diff-lib: define diff_get_merge_base()\n - diff-lib: accept option flags in run_diff_index()\n - contrib/completion: extract common diff/difftool options\n - git-diff.txt: backtick quote command text\n - git-diff-index.txt: make --cached description a proper sentence\n - t4068: remove unnecessary >tmp\n\n \"git diff A...B\" learned \"git diff --merge-base A B\", which is a\n longer short-hand to say the same thing.\n\n Expecting a reroll.\n cf. <20200917181303.GA108156@coredump.intra.peff.net>,\n <xmqqh7rws5hm.fsf@gitster.c.googlers.com>, etc.\n\n\n* jk/dont-count-existing-objects-twice (2020-09-17) 1 commit\n  (merged to 'next' on 2020-09-18 at 73b30558b9)\n + packfile: actually set approximate_object_count_valid\n\n There is a logic to estimate how many objects are in the\n repository, which is mean to run once per process invocation, but\n it ran every time the estimated value was requested.\n\n Will merge to 'master'.\n\n\n* dl/complete-format-patch-recent-features (2020-09-17) 1 commit\n  (merged to 'next' on 2020-09-18 at c0ec1f7569)\n + contrib/completion: complete options that take refs for format-patch\n\n Update to command line completion (in contrib/)\n\n Will merge to 'master'.\n\n\n* js/ignore-cmake-build-artifacts (2020-09-17) 1 commit\n - cmake: ignore generated files\n\n Running CMake based build with VS (in contrib/) from the top-level\n of the working tree leaves extra build crufts behind.  Add patterns\n to .gitignore\n\n Expecting a resolution in a better way.\n cf. <xmqq7dsrnjhi.fsf@gitster.c.googlers.com>\n It turns out that these crufts are visible only when the CMake\n based build procedure is used against the best practice.  A better\n alternative may be to prominently describe the recommended way to\n use the CMake-based build procedure.\n\n\n* hx/push-atomic-with-cert (2020-09-18) 1 commit\n - send-pack: run GPG after atomic push checking\n\n \"git push\" that wants to be atomic and wants to send push\n certificate learned not to prepare and sign the push certificate\n when it fails the local check (hence due to atomicity it is known\n that no certificate is needed).\n\n Expecting a reroll.\n cf. <xmqqft7eljkz.fsf@gitster.c.googlers.com>\n\n--------------------------------------------------\n[Stalled]\n\n* vv/send-email-with-less-secure-apps-access (2020-08-29) 1 commit\n - Documentation/git-send-email.txt: Mention less secure app access might need to enable.\n\n Doc update.\n\n Expecting a reroll.\n cf. <xmqqwo1hi9nv.fsf@gitster.c.googlers.com>\n cf. <xmqqft85i72s.fsf@gitster.c.googlers.com>\n\n\n* jc/war-on-dashed-git (2020-08-27) 1 commit\n - git: catch an attempt to run \"git-foo\"\n\n The first step to remove on-disk binaries for built-in subcommands\n by soliciting objections.\n\n On hold for now.\n\n\n* dr/push-remoteref-fix (2020-04-23) 1 commit\n - remote.c: fix handling of %(push:remoteref)\n\n The \"%(push:remoteref)\" placeholder in the \"--format=\" argument of\n \"git format-patch\" (and friends) only showed what got explicitly\n configured, not what ref at the receiving end would be updated when\n \"git push\" was used, as it ignored the default behaviour (e.g. update\n the same ref as the source).\n\n Discard for now.\n cf. <xmqqv9gu7c61.fsf@gitster.c.googlers.com>\n cf. <20200911214358.acl3hy2e763begoo@feanor>\n\n\n* mk/use-size-t-in-zlib (2018-10-15) 1 commit\n - zlib.c: use size_t for size\n\n The wrapper to call into zlib followed our long tradition to use\n \"unsigned long\" for sizes of regions in memory, which have been\n updated to use \"size_t\".\n\n--------------------------------------------------\n[Cooking]\n\n* kk/build-portability-fix (2020-09-09) 1 commit\n  (merged to 'next' on 2020-09-16 at 63f2672632)\n + Fit to Plan 9's ANSI/POSIX compatibility layer\n\n Portability tweak for some shell scripts used while building.\n\n Will merge to 'master'.\n\n\n* al/ref-filter-merged-and-no-merged (2020-09-18) 5 commits\n  (merged to 'next' on 2020-09-18 at cc2a0039f3)\n + Doc: prefer more specific file name\n + ref-filter: make internal reachable-filter API more precise\n  (merged to 'next' on 2020-09-16 at b04e306660)\n + ref-filter: allow merged and no-merged filters\n + Doc: cover multiple contains/no-contains filters\n + t3201: test multiple branch filter combinations\n\n \"git for-each-ref\" and friends that list refs used to allow only\n one --merged or --no-merged to filter them; they learned to take\n combination of both kind of filtering.\n\n Will merge to 'master'.\n\n\n* bc/faq-misc (2020-09-14) 3 commits\n - docs: explain how to deal with files that are always modified\n - docs: explain why reverts are not always applied on merge\n - docs: explain why squash merges are broken with long-running branches\n\n More FAQ entries.\n\n Expecting a reroll.\n cf. <20200913171206.GO241078@camp.crustytoothpaste.net>\n\n\n* sb/clone-origin (2020-09-11) 4 commits\n - clone: allow configurable default for `-o`/`--origin`\n - clone: validate --origin option before use\n - clone: call git_config before parse_options\n - clone: add tests for --template and some disallowed option pairs\n\n \"git clone\" learned clone.defaultremotename configuration variable\n to customize what nickname to use to call the remote the repository\n was cloned from.\n\n Expecting an update.\n\n\n* sk/force-if-includes (2020-09-14) 8 commits\n - SQUASH???\n - t: add tests for \"force-if-includes\"\n - doc: add reference for \"--[no-]force-if-includes\"\n - builtin/push: add option \"--[no-]force-if-includes\"\n - transport-helper: update ref status for \"force-if-includes\"\n - send-pack: check ref status for \"force-if-includes\"\n - transport: add flag for \"--[no-]force-if-includes\"\n - remote: add reflog check for \"force-if-includes\"\n\n\n* ab/mediawiki-fixes (2020-09-16) 15 commits\n - remote-mediawiki tests: annotate failing tests\n - remote-mediawiki: fix duplicate revisions being imported\n - remote-mediawiki tests: use CLI installer\n - remote-mediawiki tests: use inline PerlIO for readability\n - remote-mediawiki tests: replace deprecated Perl construct\n - remote-mediawiki tests: use a more idiomatic dispatch table\n - remote-mediawiki tests: use \"$dir/\" instead of \"$dir.\"\n - remote-mediawiki tests: change `[]` to `test`\n - remote-mediawiki tests: guard test_cmp with test_path_is_file\n - remote-mediawiki tests: use test_cmp in tests\n - remote-mediawiki tests: use a 10 character password\n - remote-mediawiki tests: use the login/password variables\n - remote-mediawiki doc: bump recommended PHP version to 7.3\n - remote-mediawiki doc: link to MediaWiki's current version\n - remote-mediawiki doc: correct link to GitHub project\n\n Modernization and fixes to MediaWiki remote backend.\n\n Expecting a reroll.\n\n\n* ar/fetch-ipversion-in-all (2020-09-15) 1 commit\n - fetch: pass --ipv4 and --ipv6 options to sub-fetches\n\n \"git fetch --all --ipv4/--ipv6\" forgot to pass the protocol options\n to instances of the \"git fetch\" that talk to individual remotes,\n which has been corrected.\n\n Will merge to 'next'.\n\n\n* ar/fetch-transfer-ipversion (2020-09-16) 1 commit\n - config: option transfer.ipversion to set transport protocol version for network fetches\n\n Adds transfer.ipversion configuration variable.\n\n Needs more work.\n\n\n* bc/clone-with-git-default-hash-fix (2020-09-15) 1 commit\n - builtin/clone: avoid failure with GIT_DEFAULT_HASH\n\n \"git clone\" that clones from SHA-1 repository, while\n GIT_DEFAULT_HASH set to use SHA-256 already, resulted in an\n unusable repository that half-claims to be SHA-256 repository\n with SHA-1 objects and refs.  This has been corrected.\n\n Expecting a reroll.\n\n\n* cd/commit-graph-doc (2020-09-15) 1 commit\n  (merged to 'next' on 2020-09-16 at b0816b6eb0)\n + commit-graph-format.txt: fix no-parent value\n\n Doc update.\n\n Will merge to 'master'.\n\n\n* hn/reftable (2020-09-16) 13 commits\n - reftable: \"test-tool dump-reftable\" command.\n - reftable: rest of library\n - reftable: file level tests\n - reftable: read reftable files\n - reftable: write reftable files\n - reftable: a generic binary tree implementation\n - reftable: reading/writing blocks\n - reftable: (de)serialization for the polymorphic record type.\n - reftable: utility functions\n - reftable: add a barebones unittest framework\n - vcxproj: adjust for the reftable changes\n - reftable: define the public API\n - reftable: add LICENSE\n\n\n* bc/rev-parse-path-format (2020-09-08) 1 commit\n - rev-parse: add option for absolute or relative path formatting\n\n \"git rev-parse\" can be explicitly told to give output as absolute\n or relative path.\n\n\n* ds/maintenance-part-3 (2020-09-17) 7 commits\n - maintenance: add troubleshooting guide to docs\n - maintenance: recommended schedule in register/start\n - maintenance: add start/stop subcommands\n - maintenance: add [un]register subcommands\n - for-each-repo: run subcommands on configured repos\n - maintenance: add --schedule option and config\n - maintenance: optionally skip --auto process\n (this branch uses ds/maintenance-part-1 and ds/maintenance-part-2.)\n\n Parts of \"git maintenance\" to ease writing crontab entries (and\n other scheduling system configuration) for it.\n\n\n* es/format-patch-interdiff-cleanup (2020-09-08) 3 commits\n  (merged to 'next' on 2020-09-16 at d919bb3d1f)\n + format-patch: use 'origin' as start of current-series-range when known\n + diff-lib: tighten show_interdiff()'s interface\n + diff: move show_interdiff() from its own file to diff-lib\n\n Code cleanup and teach \"format-patch --range-diff=<prev>\n <origin>..HEAD\" not ignore <origin> when <prev> is a single\n version.\n\n Will merge to 'master'.\n\n\n* os/fetch-submodule-optim (2020-09-06) 1 commit\n  (merged to 'next' on 2020-09-16 at fa39e3f211)\n + fetch: do not look for submodule changes in unchanged refs\n\n Optimization around submodule handling.\n\n Will merge to 'master'.\n\n\n* pw/add-p-edit-ita-path (2020-09-09) 1 commit\n  (merged to 'next' on 2020-09-16 at 7540ed3c0e)\n + add -p: fix editing of intent-to-add paths\n\n \"add -p\" did not allow editing paths that were only added in\n intent.\n\n Will merge to 'master'.\n\n\n* hn/refs-trace-backend (2020-09-09) 1 commit\n  (merged to 'next' on 2020-09-16 at f2e065ec17)\n + refs: add GIT_TRACE_REFS debugging mechanism\n\n Developer support.\n\n Will merge to 'master'.\n\n\n* tb/bloom-improvements (2020-09-18) 13 commits\n - commit-graph: introduce 'commitGraph.maxNewFilters'\n - builtin/commit-graph.c: introduce '--max-new-filters=<n>'\n - commit-graph: rename 'split_commit_graph_opts'\n - bloom: encode out-of-bounds filters as non-empty\n - bloom/diff: properly short-circuit on max_changes\n - bloom: use provided 'struct bloom_filter_settings'\n - bloom: split 'get_bloom_filter()' in two\n - commit-graph.c: store maximum changed paths\n - commit-graph: respect 'commitGraph.readChangedPaths'\n - t/helper/test-read-graph.c: prepare repo settings\n - commit-graph: pass a 'struct repository *' in more places\n - t4216: use an '&&'-chain\n - commit-graph: introduce 'get_bloom_filter_settings()'\n\n \"git commit-graph write\" learned to limit the number of bloom\n filters that are computed from scratch with the --max-new-filters\n option.\n\n Will merge to 'next'.\n\n\n* es/config-hooks (2020-09-09) 9 commits\n - run_commit_hook: take strvec instead of varargs\n - commit: use config-based hooks\n - hook: replace run-command.h:find_hook\n - hook: add 'run' subcommand\n - parse-options: parse into strvec\n - hook: add --porcelain to list command\n - hook: add list command\n - hook: scaffolding for git-hook subcommand\n - doc: propose hooks managed by the config\n\n The \"hooks defined in config\" topic.\n\n\n* ls/mergetool-meld-auto-merge (2020-09-16) 1 commit\n  (merged to 'next' on 2020-09-16 at 01985a671b)\n + mergetool: allow auto-merge for meld to follow the vim-diff behavior\n\n The 'meld' backend of the \"git mergetool\" learned to give the\n underlying 'meld' the '--auto-merge' option, which would help\n reduce the amount of text that requires manual merging.\n\n Will merge to 'master'.\n\n\n* mt/grep-sparse-checkout (2020-09-10) 9 commits\n - config: add setting to ignore sparsity patterns in some cmds\n - grep: honor sparse checkout patterns\n - config: correctly read worktree configs in submodules\n - config: make do_git_config_sequence receive a 'struct repository'\n - t/helper/test-config: unify exit labels\n - t/helper/test-config: diagnose missing arguments\n - t/helper/test-config: be consistent with exit codes\n - t1308-config-set: avoid false positives when using test-config\n - doc: grep: unify info on configuration variables\n\n \"git grep\" has been tweaked to be limited to the sparse checkout\n paths.\n\n\n* ew/decline-core-abbrev (2020-09-01) 1 commit\n - core.abbrev <off|false|no> disables abbreviations\n\n Allow the configuration to specify no abbreviation regardless of\n the hash algorithm.\n\n Expecting a reroll.  The intent is very good.\n\n\n* mr/bisect-in-c-2 (2020-08-31) 13 commits\n - bisect--helper: retire `--bisect-autostart` subcommand\n - bisect--helper: retire `--write-terms` subcommand\n - bisect--helper: retire `--check-expected-revs` subcommand\n - bisect--helper: reimplement `bisect_state` & `bisect_head` shell functions in C\n - bisect--helper: retire `--next-all` subcommand\n - bisect--helper: retire `--bisect-clean-state` subcommand\n - bisect--helper: finish porting `bisect_start()` to C\n - bisect--helper: reimplement `bisect_next` and `bisect_auto_next` shell functions in C\n - bisect: call 'clear_commit_marks_all()' in 'bisect_next_all()'\n - bisect--helper: reimplement `bisect_autostart` shell function in C\n - bisect--helper: introduce new `write_in_file()` function\n - bisect--helper: use '-res' in 'cmd_bisect__helper' return\n - bisect--helper: BUG() in cmd_*() on invalid subcommand\n\n Rewrite of the \"git bisect\" script in C continues.\n\n At v7; getting close\n cf. <nycvar.QRO.7.76.6.2009031403510.56@tvgsbejvaqbjf.bet>\n\n\n* js/no-builtins-on-disk-option (2020-08-24) 3 commits\n - ci: stop linking built-ins to the dashed versions\n - install: optionally skip linking/copying the built-ins\n - msvc: copy the correct `.pdb` files in the Makefile target `install`\n\n The installation procedure learned to optionally omit \"git-foo\"\n executable files for each 'foo' built-in subcommand, which are only\n required by old timers that still rely on the age old promise that\n prepending \"git --exec-path\" output to PATH early in their script\n will keep the \"git-foo\" calls they wrote working.\n\n The old attempt to remove these executables from the disk failed in\n the 1.6 era; it may be worth attempting again, but I think it is\n worth to keep this topic separate from such a policy change to help\n it graduate early.\n\n Expecting a reroll to update log message for the last one.\n as it confused at least two reviewers.\n cf. <xmqqwo1baop3.fsf@gitster.c.googlers.com>\n cf. <20200903104537.GA27325@szeder.dev>\n\n\n* jt/threaded-index-pack (2020-09-08) 7 commits\n  (merged to 'next' on 2020-09-16 at 8542385cc0)\n + index-pack: make quantum of work smaller\n + index-pack: make resolve_delta() assume base data\n + index-pack: calculate {ref,ofs}_{first,last} early\n + index-pack: remove redundant child field\n + index-pack: unify threaded and unthreaded code\n + index-pack: remove redundant parameter\n + Documentation: deltaBaseCacheLimit is per-thread\n\n \"git index-pack\" learned to resolve deltified objects with greater\n parallelism.\n\n Will merge to 'master'.\n\n\n* jk/refspecs-negative (2020-09-18) 2 commits\n - SQUASH???\n - refspec: add support for negative refspecs\n\n \"negative refspecs\"\n\n Expecting a reroll.\n cf. <nycvar.QRO.7.76.6.2008221528170.56@tvgsbejvaqbjf.bet>\n cf. <xmqqzh5onea1.fsf@gitster.c.googlers.com>\n\n\n* jx/proc-receive-hook (2020-08-27) 10 commits\n  (merged to 'next' on 2020-09-18 at 344c89be7e)\n + doc: add documentation for the proc-receive hook\n + transport: parse report options for tracking refs\n + t5411: test updates of remote-tracking branches\n + receive-pack: new config receive.procReceiveRefs\n + doc: add document for capability report-status-v2\n + New capability \"report-status-v2\" for git-push\n + receive-pack: feed report options to post-receive\n + receive-pack: add new proc-receive hook\n + t5411: add basic test cases for proc-receive hook\n + transport: not report a non-head push as a branch\n\n \"git receive-pack\" that accepts requests by \"git push\" learned to\n outsource most of the ref updates to the new \"proc-receive\" hook.\n\n Will merge to 'master'.\n\n\n* ds/maintenance-part-2 (2020-09-17) 8 commits\n - maintenance: add incremental-repack auto condition\n - maintenance: auto-size incremental-repack batch\n - maintenance: add incremental-repack task\n - midx: use start_delayed_progress()\n - midx: enable core.multiPackIndex by default\n - maintenance: create auto condition for loose-objects\n - maintenance: add loose-objects task\n - maintenance: add prefetch task\n (this branch is used by ds/maintenance-part-3; uses ds/maintenance-part-1.)\n\n \"git maintenance\", an extended big brother of \"git gc\", continues\n to evolve.\n\n\n* ds/maintenance-part-1 (2020-09-17) 11 commits\n  (merged to 'next' on 2020-09-18 at 4c367d3cf6)\n + maintenance: add trace2 regions for task execution\n + maintenance: add auto condition for commit-graph task\n + maintenance: use pointers to check --auto\n + maintenance: create maintenance.<task>.enabled config\n + maintenance: take a lock on the objects directory\n + maintenance: add --task option\n + maintenance: add commit-graph task\n + maintenance: initialize task array\n + maintenance: replace run_auto_gc()\n + maintenance: add --quiet option\n + maintenance: create basic maintenance runner\n (this branch is used by ds/maintenance-part-2 and ds/maintenance-part-3.)\n\n A \"git gc\"'s big brother has been introduced to take care of more\n repository maintenance tasks, not limited to the object database\n cleaning.\n\n Will merge to 'master'.\n"},{"id":"405953","messageId":"b7ef3952-872a-40af-0f2e-c392b031a280@web.de","threadId":"54259","inReplyTo":"xmqqwo0qk0fw.fsf@gitster.c.googlers.com","subject":"Re: What's cooking in git.git (Sep 2020, #05; Fri, 18)","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2020-09-19T21:13:27Z","receivedAt":"2020-09-19T21:18:38Z","isPatch":false,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 19.09.20 um 03:41 schrieb Junio C Hamano:\n> * jc/dist-tarball-tweak (2020-09-09) 1 commit\n>   (merged to 'next' on 2020-09-10 at 36cbe7ee9e)\n>  + Makefile: allow extra tweaking of distribution tarball\n>\n>  Allow maintainers to tweak $(TAR) invocations done while making\n>  distribution tarballs.\n\nJust noticed this one.  It reminds me of an alternative solution for\narchives containing both tracked and untracked files gathering dust on\nmy disk because I didn't see much demand.  It goes the other way and\ngives untracked files the same meta data as tracked ones.  Interested?\n\n  archive: read short blobs in archive.c::write_archive_entry()\n  archive: add --add-file\n  Makefile: use git-archive --add-file\n\n Documentation/git-archive.txt |   6 ++\n Makefile                      |  41 ++++++------\n archive-tar.c                 |  22 +------\n archive-zip.c                 |  22 ++-----\n archive.c                     | 117 +++++++++++++++++++++++++++++++---\n archive.h                     |   9 ++-\n t/t5000-tar-tree.sh           |  29 +++++++++\n t/t5003-archive-zip.sh        |  28 ++++++++\n 8 files changed, 203 insertions(+), 71 deletions(-)\n\n--\n2.28.0\n"},{"id":"405954","messageId":"0951939b-7521-cf9b-1459-26d6d6774589@web.de","threadId":"54259","inReplyTo":"b7ef3952-872a-40af-0f2e-c392b031a280@web.de","subject":"[PATCH 1/3] archive: read short blobs in archive.c::write_archive_entry()","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2020-09-19T21:23:32Z","receivedAt":"2020-09-19T21:23:47Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Centralize reading of symlink destinations and the contents of regular\nfiles that are too small to be streamed.  This reduces code duplication\nand allows future patches to add support for adding non-tracked files to\narchives.  The backends are expected to stream blobs if buffer is NULL.\n\nobject_file_to_archive() is only called from archive.c and thus no\nlonger exported.\n\nSigned-off-by: René Scharfe <l.s.r@web.de>\n---\n archive-tar.c | 22 +++-------------------\n archive-zip.c | 22 +++++-----------------\n archive.c     | 31 ++++++++++++++++++++++++-------\n archive.h     |  7 ++-----\n 4 files changed, 34 insertions(+), 48 deletions(-)\n\ndiff --git a/archive-tar.c b/archive-tar.c\nindex 5ceec3684b..f1a1447ebd 100644\n--- a/archive-tar.c\n+++ b/archive-tar.c\n@@ -242,13 +242,12 @@ static void write_extended_header(struct archiver_args *args,\n static int write_tar_entry(struct archiver_args *args,\n \t\t\t   const struct object_id *oid,\n \t\t\t   const char *path, size_t pathlen,\n-\t\t\t   unsigned int mode)\n+\t\t\t   unsigned int mode,\n+\t\t\t   void *buffer, unsigned long size)\n {\n \tstruct ustar_header header;\n \tstruct strbuf ext_header = STRBUF_INIT;\n-\tunsigned int old_mode = mode;\n-\tunsigned long size, size_in_header;\n-\tvoid *buffer;\n+\tunsigned long size_in_header;\n \tint err = 0;\n\n \tmemset(&header, 0, sizeof(header));\n@@ -282,20 +281,6 @@ static int write_tar_entry(struct archiver_args *args,\n \t} else\n \t\tmemcpy(header.name, path, pathlen);\n\n-\tif (S_ISREG(mode) && !args->convert &&\n-\t    oid_object_info(args->repo, oid, &size) == OBJ_BLOB &&\n-\t    size > big_file_threshold)\n-\t\tbuffer = NULL;\n-\telse if (S_ISLNK(mode) || S_ISREG(mode)) {\n-\t\tenum object_type type;\n-\t\tbuffer = object_file_to_archive(args, path, oid, old_mode, &type, &size);\n-\t\tif (!buffer)\n-\t\t\treturn error(_(\"cannot read %s\"), oid_to_hex(oid));\n-\t} else {\n-\t\tbuffer = NULL;\n-\t\tsize = 0;\n-\t}\n-\n \tif (S_ISLNK(mode)) {\n \t\tif (size > sizeof(header.linkname)) {\n \t\t\txsnprintf(header.linkname, sizeof(header.linkname),\n@@ -326,7 +311,6 @@ static int write_tar_entry(struct archiver_args *args,\n \t\telse\n \t\t\terr = stream_blocked(args->repo, oid);\n \t}\n-\tfree(buffer);\n \treturn err;\n }\n\ndiff --git a/archive-zip.c b/archive-zip.c\nindex e9f426298b..2961e01c75 100644\n--- a/archive-zip.c\n+++ b/archive-zip.c\n@@ -285,7 +285,8 @@ static int entry_is_binary(struct index_state *istate, const char *path,\n static int write_zip_entry(struct archiver_args *args,\n \t\t\t   const struct object_id *oid,\n \t\t\t   const char *path, size_t pathlen,\n-\t\t\t   unsigned int mode)\n+\t\t\t   unsigned int mode,\n+\t\t\t   void *buffer, unsigned long size)\n {\n \tstruct zip_local_header header;\n \tuintmax_t offset = zip_offset;\n@@ -299,10 +300,8 @@ static int write_zip_entry(struct archiver_args *args,\n \tenum zip_method method;\n \tunsigned char *out;\n \tvoid *deflated = NULL;\n-\tvoid *buffer;\n \tstruct git_istream *stream = NULL;\n \tunsigned long flags = 0;\n-\tunsigned long size;\n \tint is_binary = -1;\n \tconst char *path_without_prefix = path + args->baselen;\n \tunsigned int creator_version = 0;\n@@ -328,13 +327,8 @@ static int write_zip_entry(struct archiver_args *args,\n \t\tmethod = ZIP_METHOD_STORE;\n \t\tattr2 = 16;\n \t\tout = NULL;\n-\t\tsize = 0;\n \t\tcompressed_size = 0;\n-\t\tbuffer = NULL;\n \t} else if (S_ISREG(mode) || S_ISLNK(mode)) {\n-\t\tenum object_type type = oid_object_info(args->repo, oid,\n-\t\t\t\t\t\t\t&size);\n-\n \t\tmethod = ZIP_METHOD_STORE;\n \t\tattr2 = S_ISLNK(mode) ? ((mode | 0777) << 16) :\n \t\t\t(mode & 0111) ? ((mode) << 16) : 0;\n@@ -343,21 +337,16 @@ static int write_zip_entry(struct archiver_args *args,\n \t\tif (S_ISREG(mode) && args->compression_level != 0 && size > 0)\n \t\t\tmethod = ZIP_METHOD_DEFLATE;\n\n-\t\tif (S_ISREG(mode) && type == OBJ_BLOB && !args->convert &&\n-\t\t    size > big_file_threshold) {\n+\t\tif (!buffer) {\n+\t\t\tenum object_type type;\n \t\t\tstream = open_istream(args->repo, oid, &type, &size,\n \t\t\t\t\t      NULL);\n \t\t\tif (!stream)\n \t\t\t\treturn error(_(\"cannot stream blob %s\"),\n \t\t\t\t\t     oid_to_hex(oid));\n \t\t\tflags |= ZIP_STREAM;\n-\t\t\tout = buffer = NULL;\n+\t\t\tout = NULL;\n \t\t} else {\n-\t\t\tbuffer = object_file_to_archive(args, path, oid, mode,\n-\t\t\t\t\t\t\t&type, &size);\n-\t\t\tif (!buffer)\n-\t\t\t\treturn error(_(\"cannot read %s\"),\n-\t\t\t\t\t     oid_to_hex(oid));\n \t\t\tcrc = crc32(crc, buffer, size);\n \t\t\tis_binary = entry_is_binary(args->repo->index,\n \t\t\t\t\t\t    path_without_prefix,\n@@ -511,7 +500,6 @@ static int write_zip_entry(struct archiver_args *args,\n \t}\n\n \tfree(deflated);\n-\tfree(buffer);\n\n \tif (compressed_size > 0xffffffff || size > 0xffffffff ||\n \t    offset > 0xffffffff) {\ndiff --git a/archive.c b/archive.c\nindex 0de6048bfc..4fbe5329c5 100644\n--- a/archive.c\n+++ b/archive.c\n@@ -70,10 +70,12 @@ static void format_subst(const struct commit *commit,\n \tfree(to_free);\n }\n\n-void *object_file_to_archive(const struct archiver_args *args,\n-\t\t\t     const char *path, const struct object_id *oid,\n-\t\t\t     unsigned int mode, enum object_type *type,\n-\t\t\t     unsigned long *sizep)\n+static void *object_file_to_archive(const struct archiver_args *args,\n+\t\t\t\t    const char *path,\n+\t\t\t\t    const struct object_id *oid,\n+\t\t\t\t    unsigned int mode,\n+\t\t\t\t    enum object_type *type,\n+\t\t\t\t    unsigned long *sizep)\n {\n \tvoid *buffer;\n \tconst struct commit *commit = args->convert ? args->commit : NULL;\n@@ -145,6 +147,9 @@ static int write_archive_entry(const struct object_id *oid, const char *base,\n \twrite_archive_entry_fn_t write_entry = c->write_entry;\n \tint err;\n \tconst char *path_without_prefix;\n+\tunsigned long size;\n+\tvoid *buffer;\n+\tenum object_type type;\n\n \targs->convert = 0;\n \tstrbuf_reset(&path);\n@@ -167,7 +172,7 @@ static int write_archive_entry(const struct object_id *oid, const char *base,\n \tif (S_ISDIR(mode) || S_ISGITLINK(mode)) {\n \t\tif (args->verbose)\n \t\t\tfprintf(stderr, \"%.*s\\n\", (int)path.len, path.buf);\n-\t\terr = write_entry(args, oid, path.buf, path.len, mode);\n+\t\terr = write_entry(args, oid, path.buf, path.len, mode, NULL, 0);\n \t\tif (err)\n \t\t\treturn err;\n \t\treturn (S_ISDIR(mode) ? READ_TREE_RECURSIVE : 0);\n@@ -175,7 +180,19 @@ static int write_archive_entry(const struct object_id *oid, const char *base,\n\n \tif (args->verbose)\n \t\tfprintf(stderr, \"%.*s\\n\", (int)path.len, path.buf);\n-\treturn write_entry(args, oid, path.buf, path.len, mode);\n+\n+\t/* Stream it? */\n+\tif (S_ISREG(mode) && !args->convert &&\n+\t    oid_object_info(args->repo, oid, &size) == OBJ_BLOB &&\n+\t    size > big_file_threshold)\n+\t\treturn write_entry(args, oid, path.buf, path.len, mode, NULL, size);\n+\n+\tbuffer = object_file_to_archive(args, path.buf, oid, mode, &type, &size);\n+\tif (!buffer)\n+\t\treturn error(_(\"cannot read %s\"), oid_to_hex(oid));\n+\terr = write_entry(args, oid, path.buf, path.len, mode, buffer, size);\n+\tfree(buffer);\n+\treturn err;\n }\n\n static void queue_directory(const unsigned char *sha1,\n@@ -265,7 +282,7 @@ int write_archive_entries(struct archiver_args *args,\n \t\tif (args->verbose)\n \t\t\tfprintf(stderr, \"%.*s\\n\", (int)len, args->base);\n \t\terr = write_entry(args, &args->tree->object.oid, args->base,\n-\t\t\t\t  len, 040777);\n+\t\t\t\t  len, 040777, NULL, 0);\n \t\tif (err)\n \t\t\treturn err;\n \t}\ndiff --git a/archive.h b/archive.h\nindex 3bd96bf6bb..d83b41a01f 100644\n--- a/archive.h\n+++ b/archive.h\n@@ -49,12 +49,9 @@ void init_archivers(void);\n typedef int (*write_archive_entry_fn_t)(struct archiver_args *args,\n \t\t\t\t\tconst struct object_id *oid,\n \t\t\t\t\tconst char *path, size_t pathlen,\n-\t\t\t\t\tunsigned int mode);\n+\t\t\t\t\tunsigned int mode,\n+\t\t\t\t\tvoid *buffer, unsigned long size);\n\n int write_archive_entries(struct archiver_args *args, write_archive_entry_fn_t write_entry);\n-void *object_file_to_archive(const struct archiver_args *args,\n-\t\t\t     const char *path, const struct object_id *oid,\n-\t\t\t     unsigned int mode, enum object_type *type,\n-\t\t\t     unsigned long *sizep);\n\n #endif\t/* ARCHIVE_H */\n--\n2.28.0\n\n"},{"id":"405955","messageId":"1c03ea9b-ec91-9a07-781f-626530ac5a8d@web.de","threadId":"54259","inReplyTo":"b7ef3952-872a-40af-0f2e-c392b031a280@web.de","subject":"[PATCH 2/3] archive: add --add-file","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2020-09-19T21:23:42Z","receivedAt":"2020-09-19T21:23:50Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Allow users to append non-tracked files.  This simplifies the generation\nof source packages with a few extra files, e.g. containing version\ninformation.  They get the same access times and user information as\ntracked files.\n\nSigned-off-by: René Scharfe <l.s.r@web.de>\n---\n Documentation/git-archive.txt |  6 +++\n archive.c                     | 86 ++++++++++++++++++++++++++++++++++-\n archive.h                     |  2 +\n t/t5000-tar-tree.sh           | 29 ++++++++++++\n t/t5003-archive-zip.sh        | 28 ++++++++++++\n 5 files changed, 150 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/git-archive.txt b/Documentation/git-archive.txt\nindex cfa1e4ebe4..9f8172828d 100644\n--- a/Documentation/git-archive.txt\n+++ b/Documentation/git-archive.txt\n@@ -55,6 +55,12 @@ OPTIONS\n --output=<file>::\n \tWrite the archive to <file> instead of stdout.\n\n+--add-file=<file>::\n+\tAdd a non-tracked file to the archive.  Can be repeated to add\n+\tmultiple files.  The path of the file in the archive is built\n+\tby concatenating the value for `--prefix` (if any) and the\n+\tbasename of <file>.\n+\n --worktree-attributes::\n \tLook for attributes in .gitattributes files in the working tree\n \tas well (see <<ATTRIBUTES>>).\ndiff --git a/archive.c b/archive.c\nindex 4fbe5329c5..3c1541af9e 100644\n--- a/archive.c\n+++ b/archive.c\n@@ -266,6 +266,11 @@ static int queue_or_write_archive_entry(const struct object_id *oid,\n \t\t\t\t   stage, context);\n }\n\n+struct extra_file_info {\n+\tchar *base;\n+\tstruct stat stat;\n+};\n+\n int write_archive_entries(struct archiver_args *args,\n \t\twrite_archive_entry_fn_t write_entry)\n {\n@@ -273,6 +278,10 @@ int write_archive_entries(struct archiver_args *args,\n \tstruct unpack_trees_options opts;\n \tstruct tree_desc t;\n \tint err;\n+\tstruct strbuf path_in_archive = STRBUF_INIT;\n+\tstruct strbuf content = STRBUF_INIT;\n+\tstruct object_id fake_oid = null_oid;\n+\tint i;\n\n \tif (args->baselen > 0 && args->base[args->baselen - 1] == '/') {\n \t\tsize_t len = args->baselen;\n@@ -318,6 +327,33 @@ int write_archive_entries(struct archiver_args *args,\n \t\tfree(context.bottom);\n \t\tcontext.bottom = next;\n \t}\n+\n+\tfor (i = 0; i < args->extra_files.nr; i++) {\n+\t\tstruct string_list_item *item = args->extra_files.items + i;\n+\t\tchar *path = item->string;\n+\t\tstruct extra_file_info *info = item->util;\n+\n+\t\tput_be64(fake_oid.hash, i + 1);\n+\n+\t\tstrbuf_reset(&path_in_archive);\n+\t\tif (info->base)\n+\t\t\tstrbuf_addstr(&path_in_archive, info->base);\n+\t\tstrbuf_addstr(&path_in_archive, basename(path));\n+\n+\t\tstrbuf_reset(&content);\n+\t\tif (strbuf_read_file(&content, path, info->stat.st_size) < 0)\n+\t\t\terr = error_errno(_(\"could not read '%s'\"), path);\n+\t\telse\n+\t\t\terr = write_entry(args, &fake_oid, path_in_archive.buf,\n+\t\t\t\t\t  path_in_archive.len,\n+\t\t\t\t\t  info->stat.st_mode,\n+\t\t\t\t\t  content.buf, content.len);\n+\t\tif (err)\n+\t\t\tbreak;\n+\t}\n+\tstrbuf_release(&path_in_archive);\n+\tstrbuf_release(&content);\n+\n \treturn err;\n }\n\n@@ -457,6 +493,42 @@ static void parse_treeish_arg(const char **argv,\n \tar_args->time = archive_time;\n }\n\n+static void extra_file_info_clear(void *util, const char *str)\n+{\n+\tstruct extra_file_info *info = util;\n+\tfree(info->base);\n+\tfree(info);\n+}\n+\n+static int add_file_cb(const struct option *opt, const char *arg, int unset)\n+{\n+\tstruct archiver_args *args = opt->value;\n+\tconst char **basep = (const char **)opt->defval;\n+\tconst char *base = *basep;\n+\tchar *path;\n+\tstruct string_list_item *item;\n+\tstruct extra_file_info *info;\n+\n+\tif (unset) {\n+\t\tstring_list_clear_func(&args->extra_files,\n+\t\t\t\t       extra_file_info_clear);\n+\t\treturn 0;\n+\t}\n+\n+\tif (!arg)\n+\t\treturn -1;\n+\n+\tpath = prefix_filename(args->prefix, arg);\n+\titem = string_list_append_nodup(&args->extra_files, path);\n+\titem->util = info = xmalloc(sizeof(*info));\n+\tinfo->base = xstrdup_or_null(base);\n+\tif (stat(path, &info->stat))\n+\t\tdie(_(\"File not found: %s\"), path);\n+\tif (!S_ISREG(info->stat.st_mode))\n+\t\tdie(_(\"Not a regular file: %s\"), path);\n+\treturn 0;\n+}\n+\n #define OPT__COMPR(s, v, h, p) \\\n \tOPT_SET_INT_F(s, NULL, v, h, p, PARSE_OPT_NONEG)\n #define OPT__COMPR_HIDDEN(s, v, p) \\\n@@ -481,6 +553,9 @@ static int parse_archive_args(int argc, const char **argv,\n \t\tOPT_STRING(0, \"format\", &format, N_(\"fmt\"), N_(\"archive format\")),\n \t\tOPT_STRING(0, \"prefix\", &base, N_(\"prefix\"),\n \t\t\tN_(\"prepend prefix to each pathname in the archive\")),\n+\t\t{ OPTION_CALLBACK, 0, \"add-file\", args, N_(\"file\"),\n+\t\t  N_(\"add untracked file to archive\"), 0, add_file_cb,\n+\t\t  (intptr_t)&base },\n \t\tOPT_STRING('o', \"output\", &output, N_(\"file\"),\n \t\t\tN_(\"write the archive to this file\")),\n \t\tOPT_BOOL(0, \"worktree-attributes\", &worktree_attributes,\n@@ -515,6 +590,8 @@ static int parse_archive_args(int argc, const char **argv,\n \t\tdie(_(\"Option --exec can only be used together with --remote\"));\n \tif (output)\n \t\tdie(_(\"Unexpected option --output\"));\n+\tif (is_remote && args->extra_files.nr)\n+\t\tdie(_(\"Options --add-file and --remote cannot be used together\"));\n\n \tif (!base)\n \t\tbase = \"\";\n@@ -561,11 +638,14 @@ int write_archive(int argc, const char **argv, const char *prefix,\n {\n \tconst struct archiver *ar = NULL;\n \tstruct archiver_args args;\n+\tint rc;\n\n \tgit_config_get_bool(\"uploadarchive.allowunreachable\", &remote_allow_unreachable);\n \tgit_config(git_default_config, NULL);\n\n \targs.repo = repo;\n+\targs.prefix = prefix;\n+\tstring_list_init(&args.extra_files, 1);\n \targc = parse_archive_args(argc, argv, &ar, &args, name_hint, remote);\n \tif (!startup_info->have_repository) {\n \t\t/*\n@@ -579,7 +659,11 @@ int write_archive(int argc, const char **argv, const char *prefix,\n \tparse_treeish_arg(argv, &args, prefix, remote);\n \tparse_pathspec_arg(argv + 1, &args);\n\n-\treturn ar->write_archive(ar, &args);\n+\trc = ar->write_archive(ar, &args);\n+\n+\tstring_list_clear_func(&args.extra_files, extra_file_info_clear);\n+\n+\treturn rc;\n }\n\n static int match_extension(const char *filename, const char *ext)\ndiff --git a/archive.h b/archive.h\nindex d83b41a01f..82b226011a 100644\n--- a/archive.h\n+++ b/archive.h\n@@ -9,6 +9,7 @@ struct repository;\n struct archiver_args {\n \tstruct repository *repo;\n \tconst char *refname;\n+\tconst char *prefix;\n \tconst char *base;\n \tsize_t baselen;\n \tstruct tree *tree;\n@@ -20,6 +21,7 @@ struct archiver_args {\n \tunsigned int worktree_attributes : 1;\n \tunsigned int convert : 1;\n \tint compression_level;\n+\tstruct string_list extra_files;\n };\n\n /* main api */\ndiff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\nindex 37655a237c..3ebb0d3b65 100755\n--- a/t/t5000-tar-tree.sh\n+++ b/t/t5000-tar-tree.sh\n@@ -94,6 +94,16 @@ check_tar() {\n \t'\n }\n\n+check_added() {\n+\tdir=$1\n+\tpath_in_fs=$2\n+\tpath_in_archive=$3\n+\n+\ttest_expect_success \" validate extra file $path_in_archive\" '\n+\t\tdiff -r $path_in_fs $dir/$path_in_archive\n+\t'\n+}\n+\n test_expect_success 'setup' '\n \ttest_oid_cache <<-EOF\n \tobj sha1:19f9c8273ec45a8938e6999cb59b3ff66739902a\n@@ -164,6 +174,25 @@ test_expect_success 'git-archive --prefix=olde-' '\n\n check_tar with_olde-prefix olde-\n\n+test_expect_success 'git archive --add-file' '\n+\techo untracked >untracked &&\n+\tgit archive --add-file=untracked HEAD >with_untracked.tar\n+'\n+\n+check_tar with_untracked\n+check_added with_untracked untracked untracked\n+\n+test_expect_success 'git archive --add-file twice' '\n+\techo untracked >untracked &&\n+\tgit archive --prefix=one/ --add-file=untracked \\\n+\t\t--prefix=two/ --add-file=untracked \\\n+\t\t--prefix= HEAD >with_untracked2.tar\n+'\n+\n+check_tar with_untracked2\n+check_added with_untracked2 untracked one/untracked\n+check_added with_untracked2 untracked two/untracked\n+\n test_expect_success 'git archive on large files' '\n     test_config core.bigfilethreshold 1 &&\n     git archive HEAD >b3.tar &&\ndiff --git a/t/t5003-archive-zip.sh b/t/t5003-archive-zip.sh\nindex 3b76d2eb65..1e6d18b140 100755\n--- a/t/t5003-archive-zip.sh\n+++ b/t/t5003-archive-zip.sh\n@@ -72,6 +72,16 @@ check_zip() {\n \t\"\n }\n\n+check_added() {\n+\tdir=$1\n+\tpath_in_fs=$2\n+\tpath_in_archive=$3\n+\n+\ttest_expect_success UNZIP \" validate extra file $path_in_archive\" '\n+\t\tdiff -r $path_in_fs $dir/$path_in_archive\n+\t'\n+}\n+\n test_expect_success \\\n     'populate workdir' \\\n     'mkdir a &&\n@@ -188,4 +198,22 @@ test_expect_success 'git archive --format=zip on large files' '\n\n check_zip large-compressed\n\n+test_expect_success 'git archive --format=zip --add-file' '\n+\techo untracked >untracked &&\n+\tgit archive --format=zip --add-file=untracked HEAD >with_untracked.zip\n+'\n+\n+check_zip with_untracked\n+check_added with_untracked untracked untracked\n+\n+test_expect_success 'git archive --format=zip --add-file twice' '\n+\techo untracked >untracked &&\n+\tgit archive --format=zip --prefix=one/ --add-file=untracked \\\n+\t\t--prefix=two/ --add-file=untracked \\\n+\t\t--prefix= HEAD >with_untracked2.zip\n+'\n+check_zip with_untracked2\n+check_added with_untracked2 untracked one/untracked\n+check_added with_untracked2 untracked two/untracked\n+\n test_done\n--\n2.28.0\n\n"},{"id":"405956","messageId":"f6570064-48a8-299c-6192-7c888e90c949@web.de","threadId":"54259","inReplyTo":"b7ef3952-872a-40af-0f2e-c392b031a280@web.de","subject":"[PATCH 3/3] Makefile: use git-archive --add-file","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2020-09-19T21:23:50Z","receivedAt":"2020-09-19T21:23:56Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Add untracked files for the dist target directly using git archive\ninstead of calling tar cr to append them.  This reduces the dependency\non external tools and gives the untracked files the same access times\nand user information as tracked ones, integrating them seamlessly.\n\nSigned-off-by: René Scharfe <l.s.r@web.de>\n---\n Makefile | 41 +++++++++++++++++++----------------------\n 1 file changed, 19 insertions(+), 22 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex f1b1bc8aa0..56bf12b238 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -3045,32 +3045,29 @@ quick-install-html:\n # With GNU tar, \"--mode=u+rwX,og+rX,og-w\" would be a good idea, for example.\n TAR_DIST_EXTRA_OPTS =\n GIT_TARNAME = git-$(GIT_VERSION)\n+GIT_ARCHIVE_EXTRA_FILES = \\\n+\t--prefix=$(GIT_TARNAME)/ \\\n+\t--add-file=configure \\\n+\t--add-file=$(GIT_TARNAME)/version \\\n+\t--prefix=$(GIT_TARNAME)/git-gui/ \\\n+\t--add-file=$(GIT_TARNAME)/git-gui/version\n+ifdef DC_SHA1_SUBMODULE\n+GIT_ARCHIVE_EXTRA_FILES += \\\n+\t--prefix=$(GIT_TARNAME)/sha1collisiondetection/ \\\n+\t--add-file=sha1collisiondetection/LICENSE.txt \\\n+\t--prefix=$(GIT_TARNAME)/sha1collisiondetection/lib/ \\\n+\t--add-file=sha1collisiondetection/lib/sha1.c \\\n+\t--add-file=sha1collisiondetection/lib/sha1.h \\\n+\t--add-file=sha1collisiondetection/lib/ubc_check.c \\\n+\t--add-file=sha1collisiondetection/lib/ubc_check.h\n+endif\n dist: git-archive$(X) configure\n-\t./git-archive --format=tar \\\n-\t\t--prefix=$(GIT_TARNAME)/ HEAD^{tree} > $(GIT_TARNAME).tar\n \t@mkdir -p $(GIT_TARNAME)\n-\t@cp configure $(GIT_TARNAME)\n \t@echo $(GIT_VERSION) > $(GIT_TARNAME)/version\n \t@$(MAKE) -C git-gui TARDIR=../$(GIT_TARNAME)/git-gui dist-version\n-\t$(TAR) rf $(GIT_TARNAME).tar $(TAR_DIST_EXTRA_OPTS) \\\n-\t\t$(GIT_TARNAME)/configure \\\n-\t\t$(GIT_TARNAME)/version \\\n-\t\t$(GIT_TARNAME)/git-gui/version\n-ifdef DC_SHA1_SUBMODULE\n-\t@mkdir -p $(GIT_TARNAME)/sha1collisiondetection/lib\n-\t@cp sha1collisiondetection/LICENSE.txt \\\n-\t\t$(GIT_TARNAME)/sha1collisiondetection/\n-\t@cp sha1collisiondetection/LICENSE.txt \\\n-\t\t$(GIT_TARNAME)/sha1collisiondetection/\n-\t@cp sha1collisiondetection/lib/sha1.[ch] \\\n-\t\t$(GIT_TARNAME)/sha1collisiondetection/lib/\n-\t@cp sha1collisiondetection/lib/ubc_check.[ch] \\\n-\t\t$(GIT_TARNAME)/sha1collisiondetection/lib/\n-\t$(TAR) rf $(GIT_TARNAME).tar $(TAR_DIST_EXTRA_OPTS) \\\n-\t\t$(GIT_TARNAME)/sha1collisiondetection/LICENSE.txt \\\n-\t\t$(GIT_TARNAME)/sha1collisiondetection/lib/sha1.[ch] \\\n-\t\t$(GIT_TARNAME)/sha1collisiondetection/lib/ubc_check.[ch]\n-endif\n+\t./git-archive --format=tar \\\n+\t\t$(GIT_ARCHIVE_EXTRA_FILES) \\\n+\t\t--prefix=$(GIT_TARNAME)/ HEAD^{tree} > $(GIT_TARNAME).tar\n \t@$(RM) -r $(GIT_TARNAME)\n \tgzip -f -9 $(GIT_TARNAME).tar\n\n--\n2.28.0\n\n"},{"id":"405957","messageId":"xmqqy2l5iedh.fsf@gitster.c.googlers.com","threadId":"54259","inReplyTo":"b7ef3952-872a-40af-0f2e-c392b031a280@web.de","subject":"Re: What's cooking in git.git (Sep 2020, #05; Fri, 18)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-09-19T22:35:38Z","receivedAt":"2020-09-19T22:35:46Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"René Scharfe <l.s.r@web.de> writes:\n\n> Am 19.09.20 um 03:41 schrieb Junio C Hamano:\n>> * jc/dist-tarball-tweak (2020-09-09) 1 commit\n>>   (merged to 'next' on 2020-09-10 at 36cbe7ee9e)\n>>  + Makefile: allow extra tweaking of distribution tarball\n>>\n>>  Allow maintainers to tweak $(TAR) invocations done while making\n>>  distribution tarballs.\n>\n> Just noticed this one.  It reminds me of an alternative solution for\n> archives containing both tracked and untracked files gathering dust on\n> my disk because I didn't see much demand.  It goes the other way and\n> gives untracked files the same meta data as tracked ones.  Interested?\n>\n>   archive: read short blobs in archive.c::write_archive_entry()\n>   archive: add --add-file\n>   Makefile: use git-archive --add-file\n\nOooh, so is the idea that we do not have to use $(TAR) to append\nuntracked ones to \"git archive\" output, etc.?  If we can get rid of\nall $(TAR) invocations from the build procedure, that would be an\ninteresting addition.\n\n;-)\n\n>\n>  Documentation/git-archive.txt |   6 ++\n>  Makefile                      |  41 ++++++------\n>  archive-tar.c                 |  22 +------\n>  archive-zip.c                 |  22 ++-----\n>  archive.c                     | 117 +++++++++++++++++++++++++++++++---\n>  archive.h                     |   9 ++-\n>  t/t5000-tar-tree.sh           |  29 +++++++++\n>  t/t5003-archive-zip.sh        |  28 ++++++++\n>  8 files changed, 203 insertions(+), 71 deletions(-)\n>\n> --\n> 2.28.0\n"},{"id":"405972","messageId":"eb128388-01b7-5278-aa0b-1f7d2d5222ba@web.de","threadId":"54259","inReplyTo":"xmqqy2l5iedh.fsf@gitster.c.googlers.com","subject":"Re: What's cooking in git.git (Sep 2020, #05; Fri, 18)","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2020-09-20T07:58:05Z","receivedAt":"2020-09-20T08:03:31Z","isPatch":false,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 20.09.20 um 00:35 schrieb Junio C Hamano:\n> René Scharfe <l.s.r@web.de> writes:\n>\n>> Am 19.09.20 um 03:41 schrieb Junio C Hamano:\n>>> * jc/dist-tarball-tweak (2020-09-09) 1 commit\n>>>   (merged to 'next' on 2020-09-10 at 36cbe7ee9e)\n>>>  + Makefile: allow extra tweaking of distribution tarball\n>>>\n>>>  Allow maintainers to tweak $(TAR) invocations done while making\n>>>  distribution tarballs.\n>>\n>> Just noticed this one.  It reminds me of an alternative solution for\n>> archives containing both tracked and untracked files gathering dust on\n>> my disk because I didn't see much demand.  It goes the other way and\n>> gives untracked files the same meta data as tracked ones.  Interested?\n>>\n>>   archive: read short blobs in archive.c::write_archive_entry()\n>>   archive: add --add-file\n>>   Makefile: use git-archive --add-file\n>\n> Oooh, so is the idea that we do not have to use $(TAR) to append\n> untracked ones to \"git archive\" output, etc.?  If we can get rid of\n> all $(TAR) invocations from the build procedure, that would be an\n> interesting addition.\n\nThe remaining ones are used in the targets install and install-man-perl\nfor copying po files, Perl libraries and manpages; in artifacts-tar for\narchiving binaries etc. and in dist-doc for archiving manpages and HTML\nfiles.\n\ngit archive can only solve half of the copy use case at most, so $(TAR)\nwill still be used -- unless it's replaced by cp+chmod or something\nelse.\n\nNot sure how to support artifacts-tar.  Allowing git-archive calls\nwithout commit or tree might be a start.  Letting --add-file record the\nfull relative path of an untracked entry instead of its basename would\nhelp, perhaps counterbalanced with an additional --strip option similar\nto the one of patch(1).\n\ndist-doc tars up directories.  This would require adding support for\nreading directories to --add-file or adding --add-directory.\n\nRené\n"}]}