{"thread":{"id":"50123","subject":"What's cooking in git.git (Dec 2018, #02; Fri, 28)","startedAt":"2018-12-28T18:04:21Z","lastAt":"2019-01-10T06:17:40Z","messageCount":45,"participants":["Junio C Hamano","Elijah Newren","Alban Gruin","Denton Liu","Johannes Schindelin","René Scharfe","Ævar Arnfjörð Bjarmason","Jeff King","Philip Oakley","Derrick Stolee","Stefan Beller"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"365905","messageId":"xmqqh8explya.fsf@gitster-ct.c.googlers.com","threadId":"50123","inReplyTo":null,"subject":"What's cooking in git.git (Dec 2018, #02; Fri, 28)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-12-28T18:04:13Z","receivedAt":"2018-12-28T18:04:21Z","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\n'-' are only in 'pu' (proposed updates) while commits prefixed with\n'+' are in 'next'.  The ones marked with '.' do not appear in any of\nthe integration branches, but I am still holding onto them.\n\nThe current state is that 'next' has been rewound, a few topics have\nbeen updated, and almost no new topics have been picked up (yet),\neven though many of them seem to have been reviewed on-list and I've\nalso looked at some of them.\n\nSorry for being slow to recover from the year-end slowness; the 2.20\nrelease being rather large-ish and needed brown-paper-bag fixes soon\nafter it, my temporary trans-pacific migration, or me catching cold\nthat I haven't shaken off, did not help X-<.\n\nYou can find the changes described here in the integration branches\nof the repositories listed at\n\n    http://git-blame.blogspot.com/p/git-public-repositories.html\n\n--------------------------------------------------\n[Graduated to \"master\"]\n\n* ds/hash-independent-tests-fix (2018-12-12) 1 commit\n + .gitattributes: ensure t/oid-info/* has eol=lf\n\n Test portability fix.\n\n\n* jc/run-command-report-exec-failure-fix (2018-12-12) 1 commit\n + run-command: report exec failure\n\n A recent update accidentally squelched an error message when the\n run_command API failed to run a missing command, which has been\n corrected.\n\n\n* js/help-commands-verbose-by-default-fix (2018-12-12) 2 commits\n + help -a: handle aliases with long names gracefully\n + help.h: fix coding style\n\n \"git help -a\" did not work well when an overly long alias is\n defined, which has been corrected.\n\n\n* js/mailinfo-format-flowed-fix (2018-12-13) 1 commit\n + t4256: mark support files as LF-only\n\n Test portability fix.\n\n\n* nd/show-gitcomp-compilation-fix (2018-12-12) 1 commit\n + parse-options: fix SunCC compiler warning\n\n Portability fix for a recent update to parse-options API.\n\n--------------------------------------------------\n[New Topics]\n\n* ds/midx-expire-repack (2018-12-11) 5 commits\n - multi-pack-index: implement midx_repack()\n - multi-pack-index: prepare 'repack' verb\n - multi-pack-index: implement 'expire' verb\n - multi-pack-index: refactor permutation logic\n - multi-pack-index: prepare for 'expire' verb\n\n\n* ds/push-sparse-tree-walk (2018-12-11) 6 commits\n - pack-objects: create GIT_TEST_PACK_SPARSE\n - pack-objects: create pack.useSparse setting\n - revision: implement sparse algorithm\n - pack-objects: add --sparse option\n - list-objects: consume sparse tree walk\n - revision: add mark_tree_uninteresting_sparse\n\n\n* js/rebase-i-redo-exec (2018-12-11) 3 commits\n - rebase: introduce a shortcut for --reschedule-failed-exec\n - rebase: add a config option to default to --reschedule-failed-exec\n - rebase: introduce --reschedule-failed-exec\n\n\n* md/list-objects-filter-by-depth (2018-12-11) 4 commits\n - tree:<depth>: skip some trees even when collecting omits\n - list-objects-filter: teach tree:# how to handle >0\n - Merge branch 'nd/the-index' into md/list-objects-filter-by-depth\n - Merge branch 'sb/more-repo-in-api' into md/list-objects-filter-by-depth\n (this branch uses nd/the-index and sb/more-repo-in-api; is tangled with jt/get-reference-with-commit-graph.)\n\n Needs to be rebuilt when sb/more-repo-in-api is rewound.\n\n\n* nd/backup-log (2018-12-10) 24 commits\n - FIXME\n - rebase: keep backup of overwritten files on --skip or --abort\n - am: keep backup of overwritten files on --skip or --abort\n - checkout -f: keep backup of overwritten files\n - reset --hard: keep backup of overwritten files\n - unpack-trees.c: keep backup of ignored files being overwritten\n - refs: keep backup of deleted reflog\n - config --edit: support backup log\n - sha1-file.c: let index_path() accept NULL istate\n - backup-log: keep all blob references around\n - gc: prune backup logs\n - backup-log: add prune command\n - backup-log: add log command\n - backup-log: add diff command\n - backup-log: add cat command\n - backup-log.c: add API for walking backup log\n - add--interactive: support backup log\n - apply: support backup log with --keep-backup\n - commit: support backup log\n - update-index: support backup log with --keep-backup\n - add: support backup log\n - read-cache.c: new flag for add_index_entry() to write to backup log\n - backup-log: add \"update\" subcommand\n - doc: introduce new \"backup log\" concept\n\n\n* nd/style-opening-brace (2018-12-10) 1 commit\n - style: the opening '{' of a function is in a separate line\n\n Code clean-up.\n\n\n* sg/stress-test (2018-12-10) 8 commits\n - fixup! test-lib: add the '--stress' option to run a test repeatedly under load\n - test-lib: add the '--stress' option to run a test repeatedly under load\n - test-lib-functions: introduce the 'test_set_port' helper function\n - test-lib: extract Bash version check for '-x' tracing\n - test-lib: set $TRASH_DIRECTORY earlier\n - test-lib: consolidate naming of test-results paths\n - test-lib: parse some --options earlier\n - test-lib: translate SIGTERM and SIGHUP to an exit\n\n\n* tg/checkout-no-overlay (2018-12-10) 8 commits\n - stash: use git checkout --no-overlay\n - checkout: allow ignoring unmatched pathspec\n - checkout: add --cached option\n - checkout: introduce --{,no-}overlay option\n - read-cache: add invalidate parameter to remove_marked_cache_entries\n - entry: support CE_WT_REMOVE flag in checkout_entry\n - entry: factor out unlink_entry function\n - move worktree tests to t24*\n\n\n* jk/proto-v2-hidden-refs-fix (2018-12-14) 3 commits\n - upload-pack: support hidden refs with protocol v2\n - parse_hide_refs_config: handle NULL section\n - serve: pass \"config context\" through to individual commands\n\n\n* la/quiltimport-keep-non-patch (2018-12-14) 1 commit\n - git-quiltimport: Add --keep-non-patch option\n\n\n* sb/submodule-fetchjobs-default-to-one (2018-12-14) 1 commit\n - submodule update: run at most one fetch job unless otherwise set\n\n--------------------------------------------------\n[Stalled]\n\n* lt/date-human (2018-07-09) 1 commit\n - Add 'human' date format\n\n A new date format \"--date=human\" that morphs its output depending\n on how far the time is from the current time has been introduced.\n \"--date=auto\" can be used to use this new format when the output is\n goint to the pager or to the terminal and otherwise the default\n format.\n\n--------------------------------------------------\n[Cooking]\n\n* cb/openbsd-allows-reading-directory (2018-12-03) 1 commit\n - config.mak.uname: OpenBSD uses BSD semantics with fread for directories\n\n BSD port update.\n\n Will merge to 'next'.\n\n\n* cb/t5004-empty-tar-archive-fix (2018-12-03) 1 commit\n - t5004: avoid using tar for empty packages\n\n BSD port update.\n\n Will merge to 'next'.\n\n\n* cb/test-lint-cp-a (2018-12-03) 1 commit\n - tests: add lint for non portable cp -a\n\n BSD port update.\n\n Will merge to 'next'.\n\n\n* hb/t0061-dot-in-path-fix (2018-12-03) 1 commit\n - t0061: do not fail test if '.' is part of $PATH\n\n Test update.\n\n Will merge to 'next'.\n\n\n* hn/highlight-sideband-keywords (2018-12-04) 1 commit\n - sideband: color lines with keyword only\n\n Lines that begin with a certain keyword that come over the wire, as\n well as lines that consist only of one of these keywords, ought to\n be painted in color for easier eyeballing, but the latter was\n broken ever since the feature was introduced in 2.19, which has\n been corrected.\n\n Will merge to 'next'.\n\n\n* js/commit-graph-chunk-table-fix (2018-12-14) 3 commits\n - Makefile: correct example fuzz build\n - commit-graph: fix buffer read-overflow\n - commit-graph, fuzz: add fuzzer for commit-graph\n\n The codepath to read from the commit-graph file attempted to read\n past the end of it when the file's table-of-contents was corrupt.\n\n\n* jt/get-reference-with-commit-graph (2018-12-06) 1 commit\n - revision: use commit graph in get_reference()\n (this branch uses sb/more-repo-in-api; is tangled with md/list-objects-filter-by-depth.)\n\n Micro-optimize the code that prepares commit objects to be walked\n by \"git rev-list\" when the commit-graph is available.\n\n Needs to be rebuilt when sb/more-repo-in-api is rewound.\n\n\n* md/exclude-promisor-objects-fix-cleanup (2018-12-06) 1 commit\n - revision.c: put promisor option in specialized struct\n\n Code clean-up.\n\n Will merge to 'next'.\n\n\n* bw/mailmap (2018-12-09) 1 commit\n - mailmap: update brandon williams's email address\n\n Will merge to 'next'.\n\n\n* do/gitweb-strict-export-conf-doc (2018-12-09) 1 commit\n - docs: fix $strict_export text in gitweb.conf.txt\n\n Doc update.\n\n Will merge to 'next'.\n\n\n* en/directory-renames-nothanks-doc-update (2018-12-09) 1 commit\n - git-rebase.txt: update note about directory rename detection and am\n\n Doc update.\n\n Will merge to 'next'.\n\n\n* fd/gitweb-snapshot-conf-doc-fix (2018-12-09) 1 commit\n - docs/gitweb.conf: config variable typo\n\n Doc update.\n\n Will merge to 'next'.\n\n\n* km/rebase-doc-typofix (2018-12-10) 1 commit\n - rebase docs: drop stray word in merge command description\n\n Doc update.\n\n Will merge to 'next'.\n\n\n* nd/indentation-fix (2018-12-09) 1 commit\n - Indent code with TABs\n\n Code cleanup.\n\n Will merge to 'next'.\n\n\n* tb/use-common-win32-pathfuncs-on-cygwin (2018-12-26) 1 commit\n - git clone <url> C:\\cygwin\\home\\USER\\repo' is working (again)\n\n Cygwin update.\n\n Will merge to 'next'.\n\n\n* mk/http-backend-kill-children-before-exit (2018-11-26) 1 commit\n  (merged to 'next' on 2018-12-28 at 81188d93c3)\n + http-backend: enable cleaning up forked upload/receive-pack on exit\n\n Originally merged to 'next' on 2018-11-29\n\n The http-backend CGI process did not correctly clean up the child\n processes it spawns to run upload-pack etc. when it dies itself,\n which has been corrected.\n\n Will merge to 'master'.\n\n\n* tb/log-G-binary (2018-12-26) 1 commit\n - log -G: ignore binary files\n\n \"git log -G<regex>\" looked for a hunk in the \"git log -p\" patch\n output that contained a string that matches the given pattern.\n Optimize this code to ignore binary files, which by default will\n not show any hunk that would match any pattern (unless textconv or\n the --text option is in effect, that is).\n\n Will merge to 'next'.\n\n\n* dl/merge-cleanup-scissors-fix (2018-11-21) 2 commits\n - merge: add scissors line on merge conflict\n - t7600: clean up 'merge --squash c3 with c7' test\n\n The list of conflicted paths shown in the editor while concluding a\n conflicted merge was shown above the scissors line when the\n clean-up mode is set to \"scissors\", even though it was commented\n out just like the list of updated paths and other information to\n help the user explain the merge better.\n\n Kicked out of 'next', to replace with a newer iteration.\n cf. <cover.1545745331.git.liu.denton@gmail.com>\n\n\n* aw/pretty-trailers (2018-12-09) 7 commits\n - pretty: add support for separator option in %(trailers)\n - strbuf: separate callback for strbuf_expand:ing literals\n - pretty: add support for \"valueonly\" option in %(trailers)\n - pretty: allow showing specific trailers\n - pretty: single return path in %(trailers) handling\n - pretty: allow %(trailers) options with explicit value\n - doc: group pretty-format.txt placeholders descriptions\n\n The %(trailers) formatter in \"git log --format=...\"  now allows to\n optionally pick trailers selectively by keyword, show only values,\n etc.\n\n How's the doneness of this one?\n\n\n* nd/attr-pathspec-in-tree-walk (2018-11-19) 5 commits\n - tree-walk: support :(attr) matching\n - dir.c: move, rename and export match_attrs()\n - pathspec.h: clean up \"extern\" in function declarations\n - tree-walk.c: make tree_entry_interesting() take an index\n - tree.c: make read_tree*() take 'struct repository *'\n\n The traversal over tree objects has learned to honor\n \":(attr:label)\" pathspec match, which has been implemented only for\n enumerating paths on the filesystem.\n\n Will merge to 'next'.\n\n\n* ab/commit-graph-progress-fix (2018-11-20) 1 commit\n - commit-graph: split up close_reachable() progress output\n\n Will merge to 'next'.\n\n\n* jn/unknown-index-extensions (2018-11-21) 2 commits\n - index: offer advice for unknown index extensions\n - index: do not warn about unrecognized extensions\n\n A bit too alarming warning given when unknown index extensions\n exist is getting revamped.\n\n Expecting a reroll.\n\n\n* en/fast-export-import (2018-11-17) 11 commits\n  (merged to 'next' on 2018-12-28 at a1b09cf515)\n + fast-export: add a --show-original-ids option to show original names\n + fast-import: remove unmaintained duplicate documentation\n + fast-export: add --reference-excluded-parents option\n + fast-export: ensure we export requested refs\n + fast-export: when using paths, avoid corrupt stream with non-existent mark\n + fast-export: move commit rewriting logic into a function for reuse\n + fast-export: avoid dying when filtering by paths and old tags exist\n + fast-export: use value from correct enum\n + git-fast-export.txt: clarify misleading documentation about rev-list args\n + git-fast-import.txt: fix documentation for --quiet option\n + fast-export: convert sha1 to oid\n\n Originally merged to 'next' on 2018-11-18\n\n Small fixes and features for fast-export and fast-import, mostly on\n the fast-export side.\n\n Will merge to 'master'.\n\n\n* nd/checkout-dwim-fix (2018-11-14) 1 commit\n  (merged to 'next' on 2018-12-28 at 3183c9305b)\n + checkout: disambiguate dwim tracking branches and local files\n\n Originally merged to 'next' on 2018-11-18\n\n \"git checkout frotz\" (without any double-dash) avoids ambiguity by\n making sure 'frotz' cannot be interpreted as a revision and as a\n path at the same time.  This safety has been updated to check also\n a unique remote-tracking branch 'frotz' in a remote, when dwimming\n to create a local branch 'frotz' out of a remote-tracking branch\n 'frotz' from a remote.\n\n Will merge to 'master'.\n\n\n* nd/checkout-noisy (2018-11-20) 2 commits\n - t0027: squelch checkout path run outside test_expect_* block\n - checkout: print something when checking out paths\n\n \"git checkout [<tree-ish>] path...\" learned to report the number of\n paths that have been checked out of the index or the tree-ish,\n which gives it the same degree of noisy-ness as the case in which\n the command checks out a branch.\n\n Will merge to 'next'.\n\n\n* sg/clone-initial-fetch-configuration (2018-11-16) 3 commits\n  (merged to 'next' on 2018-12-28 at 82e104f221)\n + Documentation/clone: document ignored configuration variables\n + clone: respect additional configured fetch refspecs during initial fetch\n + clone: use a more appropriate variable name for the default refspec\n\n Originally merged to 'next' on 2018-11-18\n\n Refspecs configured with \"git -c var=val clone\" did not propagate\n to the resulting repository, which has been corrected.\n\n Will merge to 'master'.\n\n\n* en/rebase-merge-on-sequencer (2018-11-08) 2 commits\n - rebase: implement --merge via git-rebase--interactive\n - git-rebase, sequencer: extend --quiet option for the interactive machinery\n\n \"git rebase --merge\" as been reimplemented by reusing the internal\n machinery used for \"git rebase -i\".\n\n Expecting a reroll.\n cf. <CABPp-BF8RupyfP69iqAVTXxEhBGyzVd-wUgp3y0pf+CbBFAQeg@mail.gmail.com>\n\n\n* fc/http-version (2018-11-09) 1 commit\n  (merged to 'next' on 2018-12-28 at 56bcbb0fa9)\n + http: add support selecting http version\n\n Originally merged to 'next' on 2018-11-18\n\n The \"http.version\" configuration variable can be used with recent\n enough cURL library to force the version of HTTP used to talk when\n fetching and pushing.\n\n Will merge to 'master'.\n\n\n* dl/remote-save-to-push (2018-12-11) 1 commit\n - remote: add --save-to-push option to git remote set-url\n\n \"git remote set-url\" learned a new option that moves existing value\n of the URL field to pushURL field of the remote before replacing\n the URL field with a new value.\n\n I am personally not yet quite convinced if this is worth pursuing.\n\n\n* jk/loose-object-cache (2018-11-24) 10 commits\n  (merged to 'next' on 2018-12-28 at 5a5faf384e)\n + odb_load_loose_cache: fix strbuf leak\n + fetch-pack: drop custom loose object cache\n + sha1-file: use loose object cache for quick existence check\n + object-store: provide helpers for loose_objects_cache\n + sha1-file: use an object_directory for the main object dir\n + handle alternates paths the same as the main object dir\n + sha1_file_name(): overwrite buffer instead of appending\n + rename \"alternate_object_database\" to \"object_directory\"\n + submodule--helper: prefer strip_suffix() to ends_with()\n + fsck: do not reuse child_process structs\n\n Originally merged to 'next' on 2018-11-24\n\n Code clean-up with optimization for the codepath that checks\n (non-)existence of loose objects.\n\n Will merge to 'master'.\n\n\n* js/protocol-advertise-multi (2018-11-17) 1 commit\n - protocol: advertise multiple supported versions\n\n The transport layer has been updated so that the protocol version\n used can be negotiated between the parties, by the initiator\n listing the protocol versions it is willing to talk, and the other\n side choosing from one of them.\n\n Expecting a reroll.\n cf. <20181218230514.GH37614@google.com>\n\n\n* js/smart-http-detect-remote-error (2018-12-12) 4 commits\n - lib-httpd, t5551: check server-side HTTP errors\n - remote-curl: tighten \"version 2\" check for smart-http\n - remote-curl: refactor smart-http discovery\n - pack-protocol.txt: accept error packets in any context\n\n Some errors from the other side coming over smart HTTP transport\n were not noticed, which has been corrected.\n\n Will merge to 'next'.\n\n\n* nb/branch-show-other-worktrees-head (2018-11-12) 2 commits\n - branch: mark and colorize a branch differently if it is checked out in a linked worktree\n - ref-filter: add worktree atom\n\n \"git branch --list\" learned to show branches that are checked out\n in other worktrees connected to the same repository prefixed with\n '+', similar to the way the currently checked out branch is shown\n with '*' in front.\n\n Expecting a reroll.\n\n\n* nd/the-index (2018-11-12) 22 commits\n  (merged to 'next' on 2018-12-28 at 6bbd3befbe)\n + rebase-interactive.c: remove the_repository references\n + rerere.c: remove the_repository references\n + pack-*.c: remove the_repository references\n + pack-check.c: remove the_repository references\n + notes-cache.c: remove the_repository references\n + line-log.c: remove the_repository reference\n + diff-lib.c: remove the_repository references\n + delta-islands.c: remove the_repository references\n + cache-tree.c: remove the_repository references\n + bundle.c: remove the_repository references\n + branch.c: remove the_repository reference\n + bisect.c: remove the_repository reference\n + blame.c: remove implicit dependency the_repository\n + sequencer.c: remove implicit dependency on the_repository\n + sequencer.c: remove implicit dependency on the_index\n + transport.c: remove implicit dependency on the_index\n + notes-merge.c: remove implicit dependency the_repository\n + notes-merge.c: remove implicit dependency on the_index\n + list-objects.c: reduce the_repository references\n + list-objects-filter.c: remove implicit dependency on the_index\n + wt-status.c: remove implicit dependency the_repository\n + wt-status.c: remove implicit dependency on the_index\n (this branch is used by md/list-objects-filter-by-depth.)\n\n Originally merged to 'next' on 2018-11-18\n\n More codepaths become aware of working with in-core repository\n instance other than the default \"the_repository\".\n\n Will merge to 'master'.\n\n\n* ot/ref-filter-object-info (2018-11-24) 6 commits\n - ref-filter: replace unportable `%lld` format with %PRIdMAX\n - ref-filter: add docs for new options\n - ref-filter: add tests for deltabase\n - ref-filter: add deltabase option\n - ref-filter: add tests for objectsize:disk\n - ref-filter: add objectsize:disk option\n\n The \"--format=<placeholder>\" option of for-each-ref, branch and tag\n learned to show a few more traits of objects that can be learned by\n the object_info API.\n\n Kicked out of 'next'; will replace with a reroll.\n cf. <01020167e063687c-37a43a09-0a5f-4335-8c21-ec15a0a67882-000000@eu-west-1.amazonses.com>\n\n\n* sb/diff-color-moved-config-option-fixup (2018-11-14) 1 commit\n - diff: align move detection error handling with other options\n\n Minor inconsistency fix.\n\n Will merge to 'next'.\n\n\n* ab/push-dwim-dst (2018-11-14) 7 commits\n  (merged to 'next' on 2018-12-28 at d9f618de10)\n + push doc: document the DWYM behavior pushing to unqualified <dst>\n + push: test that <src> doesn't DWYM if <dst> is unqualified\n + push: add an advice on unqualified <dst> push\n + push: move unqualified refname error into a function\n + push: improve the error shown on unqualified <dst> push\n + i18n: remote.c: mark error(...) messages for translation\n + remote.c: add braces in anticipation of a follow-up change\n\n Originally merged to 'next' on 2018-11-18\n\n \"git push $there $src:$dst\" rejects when $dst is not a fully\n qualified refname and not clear what the end user meant.  The\n codepath has been taught to give a clearer error message, and also\n guess where the push should go by taking the type of the pushed\n object into account (e.g. a tag object would want to go under\n refs/tags/).\n\n Will merge to 'master'.\n\n\n* md/list-lazy-objects-fix (2018-12-06) 1 commit\n - list-objects.c: don't segfault for missing cmdline objects\n\n \"git rev-list --exclude-promissor-objects\" had to take an object\n that does not exist locally (and is lazily available) from the\n command line without barfing, but the code dereferenced NULL.\n\n Will merge to 'next'.\n\n\n* nd/i18n (2018-11-12) 16 commits\n  (merged to 'next' on 2018-12-28 at 8e2de8338e)\n + fsck: mark strings for translation\n + fsck: reduce word legos to help i18n\n + parse-options.c: mark more strings for translation\n + parse-options.c: turn some die() to BUG()\n + parse-options: replace opterror() with optname()\n + repack: mark more strings for translation\n + remote.c: mark messages for translation\n + remote.c: turn some error() or die() to BUG()\n + reflog: mark strings for translation\n + read-cache.c: add missing colon separators\n + read-cache.c: mark more strings for translation\n + read-cache.c: turn die(\"internal error\") to BUG()\n + attr.c: mark more string for translation\n + archive.c: mark more strings for translation\n + alias.c: mark split_cmdline_strerror() strings for translation\n + git.c: mark more strings for translation\n\n Originally merged to 'next' on 2018-11-18\n\n More _(\"i18n\") markings.\n\n Will merge to 'master'.\n\n\n* sb/more-repo-in-api (2018-11-14) 23 commits\n - t/helper/test-repository: celebrate independence from the_repository\n - path.h: make REPO_GIT_PATH_FUNC repository agnostic\n - commit: prepare free_commit_buffer and release_commit_memory for any repo\n - commit-graph: convert remaining functions to handle any repo\n - submodule: don't add submodule as odb for push\n - submodule: use submodule repos for object lookup\n - pretty: prepare format_commit_message to handle arbitrary repositories\n - commit: prepare logmsg_reencode to handle arbitrary repositories\n - commit: prepare repo_unuse_commit_buffer to handle any repo\n - commit: prepare get_commit_buffer to handle any repo\n - commit-reach: prepare in_merge_bases[_many] to handle any repo\n - commit-reach: prepare get_merge_bases to handle any repo\n - commit-reach.c: allow get_merge_bases_many_0 to handle any repo\n - commit-reach.c: allow remove_redundant to handle any repo\n - commit-reach.c: allow merge_bases_many to handle any repo\n - commit-reach.c: allow paint_down_to_common to handle any repo\n - commit: allow parse_commit* to handle any repo\n - object: parse_object to honor its repository argument\n - object-store: prepare has_{sha1, object}_file to handle any repo\n - object-store: prepare read_object_file to deal with any repo\n - object-store: allow read_object_file_extended to read from any repo\n - packfile: allow has_packed_and_bad to handle arbitrary repositories\n - sha1_file: allow read_object to read objects in arbitrary repositories\n (this branch is used by jt/get-reference-with-commit-graph and md/list-objects-filter-by-depth.)\n\n Originally merged to 'next' on 2018-11-19\n\n The in-core repository instances are passed through more codepaths.\n\n Kicked out of 'next'; will replace with a reroll.\n cf. <20181215000942.46033-2-sbeller@google.com>\n\n\n* en/merge-path-collision (2018-12-01) 11 commits\n  (merged to 'next' on 2018-12-28 at b50d3eee25)\n + t6036: avoid non-portable \"cp -a\"\n + merge-recursive: combine error handling\n + t6036, t6043: increase code coverage for file collision handling\n + merge-recursive: improve rename/rename(1to2)/add[/add] handling\n + merge-recursive: use handle_file_collision for add/add conflicts\n + merge-recursive: improve handling for rename/rename(2to1) conflicts\n + merge-recursive: fix rename/add conflict handling\n + merge-recursive: new function for better colliding conflict resolutions\n + merge-recursive: increase marker length with depth of recursion\n + t6036, t6042: testcases for rename collision of already conflicting files\n + t6042: add tests for consistency in file collision conflict handling\n\n Originally merged to 'next' on 2018-12-01\n\n Updates for corner cases in merge-recursive.\n\n Will merge to 'master'.\n\n\n* sd/stash-wo-user-name (2018-11-19) 1 commit\n  (merged to 'next' on 2018-12-28 at 99197ef5a1)\n + stash: tolerate missing user identity\n\n Originally merged to 'next' on 2018-11-19\n\n A properly configured username/email is required under\n user.useConfigOnly in order to create commits; now \"git stash\"\n (even though it creates commit objects to represent stash entries)\n command is excempt from the requirement.\n\n Will merge to 'master'.\n\n\n* bc/sha-256 (2018-11-14) 12 commits\n - hash: add an SHA-256 implementation using OpenSSL\n - sha256: add an SHA-256 implementation using libgcrypt\n - Add a base implementation of SHA-256 support\n - commit-graph: convert to using the_hash_algo\n - t/helper: add a test helper to compute hash speed\n - sha1-file: add a constant for hash block size\n - t: make the sha1 test-tool helper generic\n - t: add basic tests for our SHA-1 implementation\n - cache: make hashcmp and hasheq work with larger hashes\n - hex: introduce functions to print arbitrary hashes\n - sha1-file: provide functions to look up hash algorithms\n - sha1-file: rename algorithm to \"sha1\"\n\n Add sha-256 hash and plug it through the code to allow building Git\n with the \"NewHash\".\n\n\n* js/vsts-ci (2018-10-16) 13 commits\n . travis: fix skipping tagged releases\n . README: add a build badge (status of the Azure Pipelines build)\n . tests: record more stderr with --write-junit-xml in case of failure\n . tests: include detailed trace logs with --write-junit-xml upon failure\n . git-p4: use `test_atexit` to kill the daemon\n . git-daemon: use `test_atexit` in the tests\n . tests: introduce `test_atexit`\n . ci: add a build definition for Azure DevOps\n . ci/lib.sh: add support for Azure Pipelines\n . tests: optionally write results as JUnit-style .xml\n . test-date: add a subcommand to measure times in shell scripts\n . ci/lib.sh: encapsulate Travis-specific things\n . ci: rename the library of common functions\n\n Prepare to run test suite on Azure DevOps.\n\n Ejected out of 'pu', as doing so seems to help other topics get\n tested at TravisCI.\n\n https://travis-ci.org/git/git/builds/452713184 is a sample of a\n build whose tests on 4 hang (with this series in).  Ejecting it\n gave us https://travis-ci.org/git/git/builds/452778963 which still\n shows breakages from other topics not yet in 'next', but at least\n the tests do not stall.\n\n\n* du/branch-show-current (2018-10-26) 1 commit\n - branch: introduce --show-current display option\n\n \"git branch\" learned a new subcommand \"--show-current\".\n\n I am personally not yet quite convinced if this is worth pursuing.\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* ag/sequencer-reduce-rewriting-todo (2018-11-12) 16 commits\n . rebase--interactive: move transform_todo_file() to rebase--interactive.c\n . sequencer: fix a call to error() in transform_todo_file()\n . sequencer: use edit_todo_list() in complete_action()\n . rebase-interactive: rewrite edit_todo_list() to handle the initial edit\n . rebase-interactive: append_todo_help() changes\n . rebase-interactive: use todo_list_write_to_file() in edit_todo_list()\n . sequencer: refactor skip_unnecessary_picks() to work on a todo_list\n . sequencer: change complete_action() to use the refactored functions\n . sequencer: make sequencer_make_script() write its script to a strbuf\n . sequencer: refactor rearrange_squash() to work on a todo_list\n . sequencer: refactor sequencer_add_exec_commands() to work on a todo_list\n . sequencer: refactor check_todo_list() to work on a todo_list\n . sequencer: introduce todo_list_write_to_file()\n . sequencer: refactor transform_todos() to work on a todo_list\n . sequencer: make the todo_list structure public\n . sequencer: changes in parse_insn_buffer()\n\n The scripted version of \"git rebase -i\" wrote and rewrote the todo\n list many times during a single step of its operation, and the\n recent C-rewrite made a faithful conversion of the logic to C.  The\n implementation has been updated to carry necessary information\n around in-core to avoid rewriting the same file over and over\n unnecessarily.\n\n With too many topics in-flight that touch sequencer and rebaser,\n this need to wait giving precedence to other topics that fix bugs.\n\n\n* sb/submodule-recursive-fetch-gets-the-tip (2018-12-09) 9 commits\n - fetch: ensure submodule objects fetched\n - submodule.c: fetch in submodules git directory instead of in worktree\n - submodule: migrate get_next_submodule to use repository structs\n - repository: repo_submodule_init to take a submodule struct\n - submodule: store OIDs in changed_submodule_names\n - submodule.c: tighten scope of changed_submodule_names struct\n - submodule.c: sort changed_submodule_names before searching it\n - submodule.c: fix indentation\n - sha1-array: provide oid_array_filter\n\n \"git fetch --recurse-submodules\" may not fetch the necessary commit\n that is bound to the superproject, which is getting corrected.\n\n Ready?\n\n\n* js/add-i-coalesce-after-editing-hunk (2018-08-28) 1 commit\n - add -p: coalesce hunks before testing applicability\n\n Applicability check after a patch is edited in a \"git add -i/p\"\n session has been improved.\n\n Will hold.\n cf. <e5b2900a-0558-d3bf-8ea1-d526b078bbc2@talktalk.net>\n\n\n* ps/stash-in-c (2018-11-26) 22 commits\n . stash: replace all `write-tree` child processes with API calls\n . stash: optimize `get_untracked_files()` and `check_changes()`\n . stash: convert `stash--helper.c` into `stash.c`\n . stash: convert save to builtin\n . stash: make push -q quiet\n . stash: convert push to builtin\n . stash: convert create to builtin\n . stash: convert store to builtin\n . stash: convert show to builtin\n . stash: convert list to builtin\n . stash: convert pop to builtin\n . stash: convert branch to builtin\n . stash: convert drop and clear to builtin\n . stash: convert apply to builtin\n . stash: mention options in `show` synopsis\n . stash: add tests for `git stash show` config\n . stash: rename test cases to be more descriptive\n . t3903: modernize style\n . stash: improve option parsing test coverage\n . strbuf.c: add `strbuf_insertf()` and `strbuf_vinsertf()`\n . strbuf.c: add `strbuf_join_argv()`\n . sha1-name.c: add `get_oidf()` which acts like `get_oid()`\n\n \"git stash\" rewritten in C.\n\n Expecting a reroll, probably on top of the sd/stash-wo-user-name\n topic after it stabilizes, with an escape hatch like the one in\n \"rebase in C\".\n\n\n* pw/add-p-select (2018-07-26) 4 commits\n - add -p: optimize line selection for short hunks\n - add -p: allow line selection to be inverted\n - add -p: select modified lines correctly\n - add -p: select individual hunk lines\n\n \"git add -p\" interactive interface learned to let users choose\n individual added/removed lines to be used in the operation, instead\n of accepting or rejecting a whole hunk.\n\n Will discard.\n No further feedbacks on the topic for quite some time.\n\n cf. <d622a95b-7302-43d4-4ec9-b2cf3388c653@talktalk.net>\n I found the feature to be hard to explain, and may result in more\n end-user complaints, but let's see.\n\n--------------------------------------------------\n[Discarded]\n\n* ab/reject-alias-loop (2018-10-19) 1 commit\n . alias: detect loops in mixed execution mode\n\n Two (or more) aliases that mutually refer to each other can form an\n infinite loop; we now attempt to notice and stop.\n\n Discarded.\n Reverted out of 'next'.\n cf. <87sh0slvxm.fsf@evledraar.gmail.com>\n\n\n* gl/bundle-unlock-before-aborting (2018-11-14) 1 commit\n . bundle: rollback lock file while refusing to create an empty bundle\n\n Superseded by jk/close-duped-fd-before-unlock-for-bundle\n\n\n* js/remote-archive-v2 (2018-09-28) 4 commits\n . archive: allow archive over HTTP(S) with proto v2\n . archive: implement protocol v2 archive command\n . archive: use packet_reader for communications\n . archive: follow test standards around assertions\n\n The original implementation of \"git archive --remote\" more or less\n bypassed the transport layer and did not work over http(s).  The\n version 2 of the protocol is defined to allow going over http(s) as\n well as Git native transport.\n\n Retracted; reverted out of next.\n cf. <20181114195142.GI126896@google.com>\n\n\n* ab/format-patch-rangediff-not-stat (2018-11-24) 1 commit\n . format-patch: don't include --stat with --range-diff output\n\n The \"--rangediff\" option recently added to \"format-patch\"\n interspersed a bogus and useless \"--stat\" information by mistake,\n which is being corrected.\n\n Reverted out of 'next'.\n\n\n* jc/postpone-rebase-in-c (2018-11-26) 1 commit\n . rebase: mark the C reimplementation as an experimental opt-in feature\n\n People seem to be still finding latent bugs in the \"rebase in C\"\n reimplementation.  For the upcoming release, use the scripted\n version by default and adjust the documentation accordingly.\n\n Reverted out of 'next'.\n"},{"id":"365907","messageId":"CABPp-BEd5-0Vcv8YApUxo0jK_ofxCORSG5H0wU=kiR2aOY1ztQ@mail.gmail.com","threadId":"50123","inReplyTo":"xmqqh8explya.fsf@gitster-ct.c.googlers.com","subject":"Re: What's cooking in git.git (Dec 2018, #02; Fri, 28)","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2018-12-28T18:23:48Z","receivedAt":"2018-12-28T18:23:55Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Fri, Dec 28, 2018 at 10:04 AM Junio C Hamano <gitster@pobox.com> wrote:\n> Sorry for being slow to recover from the year-end slowness; the 2.20\n> release being rather large-ish and needed brown-paper-bag fixes soon\n> after it, my temporary trans-pacific migration, or me catching cold\n> that I haven't shaken off, did not help X-<.\n\nI hope you feel better soon.\n\n> * en/rebase-merge-on-sequencer (2018-11-08) 2 commits\n>  - rebase: implement --merge via git-rebase--interactive\n>  - git-rebase, sequencer: extend --quiet option for the interactive machinery\n>\n>  \"git rebase --merge\" as been reimplemented by reusing the internal\n>  machinery used for \"git rebase -i\".\n>\n>  Expecting a reroll.\n>  cf. <CABPp-BF8RupyfP69iqAVTXxEhBGyzVd-wUgp3y0pf+CbBFAQeg@mail.gmail.com>\n\nQuick update: Two re-rolls have been sent in[1]; v3 on November 22 and\nv4 with only a minor error message tweak on Dec 11.  I think I've\naddressed all review comments from v2, but neither v3 nor v4 has\nreceived much review -- Dscho was also heavily busy during the run up\nto 2.20 and needed some recovery time afterward.  I was going to\nre-ping in early January.  Anyway, it may be worth at least updating\nyour note to \"reroll exists\".\n\nThanks,\nElijah\n\n[1] Latest at https://public-inbox.org/git/20181211161139.31686-1-newren@gmail.com/\n"},{"id":"365908","messageId":"202be141-cc57-cf2a-dc15-59647e7bca09@gmail.com","threadId":"50123","inReplyTo":"xmqqh8explya.fsf@gitster-ct.c.googlers.com","subject":"ag/sequencer-reduce-rewriting-todo, was Re: What's cooking in git.git (Dec 2018, #02; Fri, 28)","fromName":"Alban Gruin","fromEmail":"alban.gruin@gmail.com","sentAt":"2018-12-28T19:21:48Z","receivedAt":"2018-12-28T19:22:09Z","isPatch":false,"sender":{"key":"alban.gruin@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6310153?v=4"},"body":"Hi Junio,\n\nLe 28/12/2018 à 19:04, Junio C Hamano a écrit :\n> * ag/sequencer-reduce-rewriting-todo (2018-11-12) 16 commits\n>  . rebase--interactive: move transform_todo_file() to rebase--interactive.c\n>  . sequencer: fix a call to error() in transform_todo_file()\n>  . sequencer: use edit_todo_list() in complete_action()\n>  . rebase-interactive: rewrite edit_todo_list() to handle the initial edit\n>  . rebase-interactive: append_todo_help() changes\n>  . rebase-interactive: use todo_list_write_to_file() in edit_todo_list()\n>  . sequencer: refactor skip_unnecessary_picks() to work on a todo_list\n>  . sequencer: change complete_action() to use the refactored functions\n>  . sequencer: make sequencer_make_script() write its script to a strbuf\n>  . sequencer: refactor rearrange_squash() to work on a todo_list\n>  . sequencer: refactor sequencer_add_exec_commands() to work on a todo_list\n>  . sequencer: refactor check_todo_list() to work on a todo_list\n>  . sequencer: introduce todo_list_write_to_file()\n>  . sequencer: refactor transform_todos() to work on a todo_list\n>  . sequencer: make the todo_list structure public\n>  . sequencer: changes in parse_insn_buffer()\n> \n>  The scripted version of \"git rebase -i\" wrote and rewrote the todo\n>  list many times during a single step of its operation, and the\n>  recent C-rewrite made a faithful conversion of the logic to C.  The\n>  implementation has been updated to carry necessary information\n>  around in-core to avoid rewriting the same file over and over\n>  unnecessarily.\n> \n>  With too many topics in-flight that touch sequencer and rebaser,\n>  this need to wait giving precedence to other topics that fix bugs.\n> \n> \n\nMost of these topics have reached master and have been released in git\n2.20.  Currently, there is four topics actually touching rebase,\ninteractive rebase and/or the sequencer (js/rebase-i-redo-exec,\nnd/backup-log, en/rebase-merge-on-sequencer and nd/the-index).  Among\nthese, only nd/the-index conflicts with my series.\n\nShould I consider this comment as outdated, and reroll my series\n(rebased on top of nd/the-index) in the next few days?\n\nCheers,\nAlban\n\n"},{"id":"365928","messageId":"xmqqzhspl7kk.fsf@gitster-ct.c.googlers.com","threadId":"50123","inReplyTo":"202be141-cc57-cf2a-dc15-59647e7bca09@gmail.com","subject":"Re: ag/sequencer-reduce-rewriting-todo, was Re: What's cooking in git.git (Dec 2018, #02; Fri, 28)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-12-28T20:28:27Z","receivedAt":"2018-12-28T20:28:31Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alban Gruin <alban.gruin@gmail.com> writes:\n\n>>  With too many topics in-flight that touch sequencer and rebaser,\n>>  this need to wait giving precedence to other topics that fix bugs.\n>> \n>\n> Most of these topics have reached master and have been released in git\n> 2.20.  Currently, there is four topics actually touching rebase,\n> interactive rebase and/or the sequencer (js/rebase-i-redo-exec,\n> nd/backup-log, en/rebase-merge-on-sequencer and nd/the-index).  Among\n> these, only nd/the-index conflicts with my series.\n\nOK, so now it's turn for this topic ;-)  Thanks.\n"},{"id":"365947","messageId":"20181229120843.GA5937@archbookpro.localdomain","threadId":"50123","inReplyTo":"xmqqh8explya.fsf@gitster-ct.c.googlers.com","subject":"Re: What's cooking in git.git (Dec 2018, #02; Fri, 28)","fromName":"Denton Liu","fromEmail":"liu.denton@gmail.com","sentAt":"2018-12-29T12:08:43Z","receivedAt":"2018-12-29T12:16:18Z","isPatch":false,"sender":{"key":"liu.denton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9620836?v=4"},"body":"On Fri, Dec 28, 2018 at 10:04:13AM -0800, Junio C Hamano wrote:\n> * dl/remote-save-to-push (2018-12-11) 1 commit\n>  - remote: add --save-to-push option to git remote set-url\n> \n>  \"git remote set-url\" learned a new option that moves existing value\n>  of the URL field to pushURL field of the remote before replacing\n>  the URL field with a new value.\n> \n>  I am personally not yet quite convinced if this is worth pursuing.\n\nHi Junio, just wondering from our previous discussions, is this comment\noutdated or is it still valid?\n\nThanks,\n\n-Denton\n"},{"id":"366088","messageId":"nycvar.QRO.7.76.6.1901031423090.45@tvgsbejvaqbjf.bet","threadId":"50123","inReplyTo":"xmqqh8explya.fsf@gitster-ct.c.googlers.com","subject":"ps/stash-in-c, was Re: What's cooking in git.git (Dec 2018, #02; Fri, 28)","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2019-01-03T13:23:57Z","receivedAt":"2019-01-03T13:24:04Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Fri, 28 Dec 2018, Junio C Hamano wrote:\n\n> * ps/stash-in-c (2018-11-26) 22 commits\n>  . stash: replace all `write-tree` child processes with API calls\n>  . stash: optimize `get_untracked_files()` and `check_changes()`\n>  . stash: convert `stash--helper.c` into `stash.c`\n>  . stash: convert save to builtin\n>  . stash: make push -q quiet\n>  . stash: convert push to builtin\n>  . stash: convert create to builtin\n>  . stash: convert store to builtin\n>  . stash: convert show to builtin\n>  . stash: convert list to builtin\n>  . stash: convert pop to builtin\n>  . stash: convert branch to builtin\n>  . stash: convert drop and clear to builtin\n>  . stash: convert apply to builtin\n>  . stash: mention options in `show` synopsis\n>  . stash: add tests for `git stash show` config\n>  . stash: rename test cases to be more descriptive\n>  . t3903: modernize style\n>  . stash: improve option parsing test coverage\n>  . strbuf.c: add `strbuf_insertf()` and `strbuf_vinsertf()`\n>  . strbuf.c: add `strbuf_join_argv()`\n>  . sha1-name.c: add `get_oidf()` which acts like `get_oid()`\n> \n>  \"git stash\" rewritten in C.\n> \n>  Expecting a reroll, probably on top of the sd/stash-wo-user-name\n>  topic after it stabilizes, with an escape hatch like the one in\n>  \"rebase in C\".\n\nThere you go:\nhttps://public-inbox.org/git/cover.1545331726.git.ungureanupaulsebastian@gmail.com/\n\nHappy new year!\nDscho\n"},{"id":"366089","messageId":"nycvar.QRO.7.76.6.1901031424340.45@tvgsbejvaqbjf.bet","threadId":"50123","inReplyTo":"CABPp-BEd5-0Vcv8YApUxo0jK_ofxCORSG5H0wU=kiR2aOY1ztQ@mail.gmail.com","subject":"Re: What's cooking in git.git (Dec 2018, #02; Fri, 28)","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2019-01-03T13:27:39Z","receivedAt":"2019-01-03T13:27:46Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Elijah,\n\nOn Fri, 28 Dec 2018, Elijah Newren wrote:\n\n> On Fri, Dec 28, 2018 at 10:04 AM Junio C Hamano <gitster@pobox.com> wrote:\n> \n> > * en/rebase-merge-on-sequencer (2018-11-08) 2 commits\n> >  - rebase: implement --merge via git-rebase--interactive\n> >  - git-rebase, sequencer: extend --quiet option for the interactive machinery\n> >\n> >  \"git rebase --merge\" as been reimplemented by reusing the internal\n> >  machinery used for \"git rebase -i\".\n> >\n> >  Expecting a reroll.\n> >  cf. <CABPp-BF8RupyfP69iqAVTXxEhBGyzVd-wUgp3y0pf+CbBFAQeg@mail.gmail.com>\n> \n> Quick update: Two re-rolls have been sent in[1]; v3 on November 22 and\n> v4 with only a minor error message tweak on Dec 11.  I think I've\n> addressed all review comments from v2, but neither v3 nor v4 has\n> received much review -- Dscho was also heavily busy during the run up\n> to 2.20 and needed some recovery time afterward.\n\nYep. There have been quite a few problems in the -rc period, and at least\none frantic bug fix of mine introduced another regression, and then there\nwas the problem with cURL where it would try to use HTTP/2 with NTLM\n(which does not work, and probably never will) and as you probably\nsuspect, NTLM/Kerberos authentication is *quite* common on Windows, so\nthat would have been a total non-starter if we had shipped Git for Windows\nv2.20.0 with an unfixed cURL.\n\nSo yes, I was quite exhausted after those weeks.\n\n> I was going to re-ping in early January.  Anyway, it may be worth at\n> least updating your note to \"reroll exists\".\n\nIt is early January! ;-)\n\nCiao,\nDscho\n"},{"id":"366213","messageId":"3512c798-aa42-6fba-ee82-d33a8985be91@web.de","threadId":"50123","inReplyTo":"xmqqh8explya.fsf@gitster-ct.c.googlers.com","subject":"jk/loose-object-cache","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2019-01-06T16:39:14Z","receivedAt":"2019-01-06T16:39:33Z","isPatch":false,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 28.12.2018 um 19:04 schrieb Junio C Hamano:\n> * jk/loose-object-cache (2018-11-24) 10 commits\n>   (merged to 'next' on 2018-12-28 at 5a5faf384e)\n>  + odb_load_loose_cache: fix strbuf leak\n>  + fetch-pack: drop custom loose object cache\n>  + sha1-file: use loose object cache for quick existence check\n>  + object-store: provide helpers for loose_objects_cache\n>  + sha1-file: use an object_directory for the main object dir\n>  + handle alternates paths the same as the main object dir\n>  + sha1_file_name(): overwrite buffer instead of appending\n>  + rename \"alternate_object_database\" to \"object_directory\"\n>  + submodule--helper: prefer strip_suffix() to ends_with()\n>  + fsck: do not reuse child_process structs\n> \n>  Originally merged to 'next' on 2018-11-24\n> \n>  Code clean-up with optimization for the codepath that checks\n>  (non-)existence of loose objects.\n> \n>  Will merge to 'master'.\n\nSo this has hit master in the meantime.  We discussed a sort performance\nfix in [1]; I'll reply with a short series containing a cleaned-up and\nrebased version as a follow-up.\n\n  object-store: factor out odb_loose_cache()\n  object-store: factor out odb_clear_loose_cache()\n  object-store: use one oid_array per subdirectory for loose cache\n\n object-store.h | 12 +++++++++++-\n object.c       |  2 +-\n packfile.c     |  7 ++-----\n sha1-file.c    | 24 ++++++++++++++++++++----\n sha1-name.c    | 10 +++++-----\n 5 files changed, 39 insertions(+), 16 deletions(-)\n\n[1] https://public-inbox.org/git/221cb2e4-a024-e301-2b3f-e37dcd93795e@web.de/\n"},{"id":"366214","messageId":"b87e7e01-baa6-6fb2-7081-0042ecd3b6b7@web.de","threadId":"50123","inReplyTo":"3512c798-aa42-6fba-ee82-d33a8985be91@web.de","subject":"[PATCH 1/3] object-store: factor out odb_loose_cache()","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2019-01-06T16:45:30Z","receivedAt":"2019-01-06T16:45:45Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Add and use a function for loading the entries if a loose object\nsubdirectory for a given object ID.  It frees callers from deriving the\nfanout key; they can use the returned oid_array reference for lookups or\nforward range scans.\n\nSuggested-by: Jeff King <peff@peff.net>\nSigned-off-by: Rene Scharfe <l.s.r@web.de>\n---\n object-store.h |  7 +++++++\n sha1-file.c    | 12 +++++++++---\n sha1-name.c    | 10 +++++-----\n 3 files changed, 21 insertions(+), 8 deletions(-)\n\ndiff --git a/object-store.h b/object-store.h\nindex 60758efad8..7236c571c0 100644\n--- a/object-store.h\n+++ b/object-store.h\n@@ -54,6 +54,13 @@ void add_to_alternates_memory(const char *dir);\n  */\n void odb_load_loose_cache(struct object_directory *odb, int subdir_nr);\n \n+/*\n+ * Populate and return the loose object cache array corresponding to the\n+ * given object ID.\n+ */\n+struct oid_array *odb_loose_cache(struct object_directory *odb,\n+\t\t\t\t  const struct object_id *oid);\n+\n struct packed_git {\n \tstruct packed_git *next;\n \tstruct list_head mru;\ndiff --git a/sha1-file.c b/sha1-file.c\nindex 5a272f70de..cb8583b634 100644\n--- a/sha1-file.c\n+++ b/sha1-file.c\n@@ -924,7 +924,6 @@ static int open_sha1_file(struct repository *r,\n static int quick_has_loose(struct repository *r,\n \t\t\t   const unsigned char *sha1)\n {\n-\tint subdir_nr = sha1[0];\n \tstruct object_id oid;\n \tstruct object_directory *odb;\n \n@@ -932,8 +931,7 @@ static int quick_has_loose(struct repository *r,\n \n \tprepare_alt_odb(r);\n \tfor (odb = r->objects->odb; odb; odb = odb->next) {\n-\t\todb_load_loose_cache(odb, subdir_nr);\n-\t\tif (oid_array_lookup(&odb->loose_objects_cache, &oid) >= 0)\n+\t\tif (oid_array_lookup(odb_loose_cache(odb, &oid), &oid) >= 0)\n \t\t\treturn 1;\n \t}\n \treturn 0;\n@@ -2152,6 +2150,14 @@ static int append_loose_object(const struct object_id *oid, const char *path,\n \treturn 0;\n }\n \n+struct oid_array *odb_loose_cache(struct object_directory *odb,\n+\t\t\t\t  const struct object_id *oid)\n+{\n+\tint subdir_nr = oid->hash[0];\n+\todb_load_loose_cache(odb, subdir_nr);\n+\treturn &odb->loose_objects_cache;\n+}\n+\n void odb_load_loose_cache(struct object_directory *odb, int subdir_nr)\n {\n \tstruct strbuf buf = STRBUF_INIT;\ndiff --git a/sha1-name.c b/sha1-name.c\nindex b24502811b..a656481c6a 100644\n--- a/sha1-name.c\n+++ b/sha1-name.c\n@@ -87,21 +87,21 @@ static int match_sha(unsigned, const unsigned char *, const unsigned char *);\n \n static void find_short_object_filename(struct disambiguate_state *ds)\n {\n-\tint subdir_nr = ds->bin_pfx.hash[0];\n \tstruct object_directory *odb;\n \n \tfor (odb = the_repository->objects->odb;\n \t     odb && !ds->ambiguous;\n \t     odb = odb->next) {\n \t\tint pos;\n+\t\tstruct oid_array *loose_objects;\n \n-\t\todb_load_loose_cache(odb, subdir_nr);\n-\t\tpos = oid_array_lookup(&odb->loose_objects_cache, &ds->bin_pfx);\n+\t\tloose_objects = odb_loose_cache(odb, &ds->bin_pfx);\n+\t\tpos = oid_array_lookup(loose_objects, &ds->bin_pfx);\n \t\tif (pos < 0)\n \t\t\tpos = -1 - pos;\n-\t\twhile (!ds->ambiguous && pos < odb->loose_objects_cache.nr) {\n+\t\twhile (!ds->ambiguous && pos < loose_objects->nr) {\n \t\t\tconst struct object_id *oid;\n-\t\t\toid = odb->loose_objects_cache.oid + pos;\n+\t\t\toid = loose_objects->oid + pos;\n \t\t\tif (!match_sha(ds->len, ds->bin_pfx.hash, oid->hash))\n \t\t\t\tbreak;\n \t\t\tupdate_candidates(ds, oid);\n-- \n2.20.1\n"},{"id":"366215","messageId":"6e8c3e47-4f11-e26f-64a6-ea4cfd8e2942@web.de","threadId":"50123","inReplyTo":"3512c798-aa42-6fba-ee82-d33a8985be91@web.de","subject":"[PATCH 2/3] object-store: factor out odb_clear_loose_cache()","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2019-01-06T16:45:39Z","receivedAt":"2019-01-06T16:45:52Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Add and use a function for emptying the loose object cache, so callers\ndon't have to know any of its implementation details.\n\nSigned-off-by: Rene Scharfe <l.s.r@web.de>\n---\n object-store.h | 3 +++\n object.c       | 2 +-\n packfile.c     | 7 ++-----\n sha1-file.c    | 7 +++++++\n 4 files changed, 13 insertions(+), 6 deletions(-)\n\ndiff --git a/object-store.h b/object-store.h\nindex 7236c571c0..709bf856b6 100644\n--- a/object-store.h\n+++ b/object-store.h\n@@ -61,6 +61,9 @@ void odb_load_loose_cache(struct object_directory *odb, int subdir_nr);\n struct oid_array *odb_loose_cache(struct object_directory *odb,\n \t\t\t\t  const struct object_id *oid);\n \n+/* Empty the loose object cache for the specified object directory. */\n+void odb_clear_loose_cache(struct object_directory *odb);\n+\n struct packed_git {\n \tstruct packed_git *next;\n \tstruct list_head mru;\ndiff --git a/object.c b/object.c\nindex 79d636091c..a5c5cf830f 100644\n--- a/object.c\n+++ b/object.c\n@@ -485,7 +485,7 @@ struct raw_object_store *raw_object_store_new(void)\n static void free_object_directory(struct object_directory *odb)\n {\n \tfree(odb->path);\n-\toid_array_clear(&odb->loose_objects_cache);\n+\todb_clear_loose_cache(odb);\n \tfree(odb);\n }\n \ndiff --git a/packfile.c b/packfile.c\nindex 8c6b47cc77..0fe9c21bf1 100644\n--- a/packfile.c\n+++ b/packfile.c\n@@ -994,11 +994,8 @@ void reprepare_packed_git(struct repository *r)\n {\n \tstruct object_directory *odb;\n \n-\tfor (odb = r->objects->odb; odb; odb = odb->next) {\n-\t\toid_array_clear(&odb->loose_objects_cache);\n-\t\tmemset(&odb->loose_objects_subdir_seen, 0,\n-\t\t       sizeof(odb->loose_objects_subdir_seen));\n-\t}\n+\tfor (odb = r->objects->odb; odb; odb = odb->next)\n+\t\todb_clear_loose_cache(odb);\n \n \tr->objects->approximate_object_count_valid = 0;\n \tr->objects->packed_git_initialized = 0;\ndiff --git a/sha1-file.c b/sha1-file.c\nindex cb8583b634..2f965b2688 100644\n--- a/sha1-file.c\n+++ b/sha1-file.c\n@@ -2178,6 +2178,13 @@ void odb_load_loose_cache(struct object_directory *odb, int subdir_nr)\n \tstrbuf_release(&buf);\n }\n \n+void odb_clear_loose_cache(struct object_directory *odb)\n+{\n+\toid_array_clear(&odb->loose_objects_cache);\n+\tmemset(&odb->loose_objects_subdir_seen, 0,\n+\t       sizeof(odb->loose_objects_subdir_seen));\n+}\n+\n static int check_stream_sha1(git_zstream *stream,\n \t\t\t     const char *hdr,\n \t\t\t     unsigned long size,\n-- \n2.20.1\n"},{"id":"366216","messageId":"c8dd851f-0a18-848f-8e58-cc0ee5f8e705@web.de","threadId":"50123","inReplyTo":"3512c798-aa42-6fba-ee82-d33a8985be91@web.de","subject":"[PATCH 3/3] object-store: use one oid_array per subdirectory for loose cache","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2019-01-06T16:45:52Z","receivedAt":"2019-01-06T16:51:10Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"The loose objects cache is filled one subdirectory at a time as needed.\nIt is stored in an oid_array, which has to be resorted after each add\noperation.  So when querying a wide range of objects, the partially\nfilled array needs to be resorted up to 255 times, which takes over 100\ntimes longer than sorting once.\n\nUse one oid_array for each subdirectory.  This ensures that entries have\nto only be sorted a single time.  It also avoids eight binary search\nsteps for each cache lookup as a small bonus.\n\nThe cache is used for collision checks for the log placeholders %h, %t\nand %p, and we can see the change speeding them up in a repository with\nca. 100 objects per subdirectory:\n\n$ git count-objects\n26733 objects, 68808 kilobytes\n\nTest                        HEAD^             HEAD\n--------------------------------------------------------------------\n4205.1: log with %H         0.51(0.47+0.04)   0.51(0.49+0.02) +0.0%\n4205.2: log with %h         0.84(0.82+0.02)   0.60(0.57+0.03) -28.6%\n4205.3: log with %T         0.53(0.49+0.04)   0.52(0.48+0.03) -1.9%\n4205.4: log with %t         0.84(0.80+0.04)   0.60(0.59+0.01) -28.6%\n4205.5: log with %P         0.52(0.48+0.03)   0.51(0.50+0.01) -1.9%\n4205.6: log with %p         0.85(0.78+0.06)   0.61(0.56+0.05) -28.2%\n4205.7: log with %h-%h-%h   0.96(0.92+0.03)   0.69(0.64+0.04) -28.1%\n\nReported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Rene Scharfe <l.s.r@web.de>\n---\n object-store.h | 2 +-\n sha1-file.c    | 9 ++++++---\n 2 files changed, 7 insertions(+), 4 deletions(-)\n\ndiff --git a/object-store.h b/object-store.h\nindex 709bf856b6..2fb6c0e4db 100644\n--- a/object-store.h\n+++ b/object-store.h\n@@ -20,7 +20,7 @@ struct object_directory {\n \t * Be sure to call odb_load_loose_cache() before using.\n \t */\n \tchar loose_objects_subdir_seen[256];\n-\tstruct oid_array loose_objects_cache;\n+\tstruct oid_array loose_objects_cache[256];\n \n \t/*\n \t * Path to the alternative object store. If this is a relative path,\ndiff --git a/sha1-file.c b/sha1-file.c\nindex 2f965b2688..c3c6e50704 100644\n--- a/sha1-file.c\n+++ b/sha1-file.c\n@@ -2155,7 +2155,7 @@ struct oid_array *odb_loose_cache(struct object_directory *odb,\n {\n \tint subdir_nr = oid->hash[0];\n \todb_load_loose_cache(odb, subdir_nr);\n-\treturn &odb->loose_objects_cache;\n+\treturn &odb->loose_objects_cache[subdir_nr];\n }\n \n void odb_load_loose_cache(struct object_directory *odb, int subdir_nr)\n@@ -2173,14 +2173,17 @@ void odb_load_loose_cache(struct object_directory *odb, int subdir_nr)\n \tfor_each_file_in_obj_subdir(subdir_nr, &buf,\n \t\t\t\t    append_loose_object,\n \t\t\t\t    NULL, NULL,\n-\t\t\t\t    &odb->loose_objects_cache);\n+\t\t\t\t    &odb->loose_objects_cache[subdir_nr]);\n \todb->loose_objects_subdir_seen[subdir_nr] = 1;\n \tstrbuf_release(&buf);\n }\n \n void odb_clear_loose_cache(struct object_directory *odb)\n {\n-\toid_array_clear(&odb->loose_objects_cache);\n+\tint i;\n+\n+\tfor (i = 0; i < ARRAY_SIZE(odb->loose_objects_cache); i++)\n+\t\toid_array_clear(&odb->loose_objects_cache[i]);\n \tmemset(&odb->loose_objects_subdir_seen, 0,\n \t       sizeof(odb->loose_objects_subdir_seen));\n }\n-- \n2.20.1\n"},{"id":"366224","messageId":"87imz1ed25.fsf@evledraar.gmail.com","threadId":"50123","inReplyTo":"c8dd851f-0a18-848f-8e58-cc0ee5f8e705@web.de","subject":"Re: [PATCH 3/3] object-store: use one oid_array per subdirectory for loose cache","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2019-01-06T20:38:58Z","receivedAt":"2019-01-06T20:38:45Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Sun, Jan 06 2019, René Scharfe wrote:\n\nThanks. I haven't done my own performance testing but at a glance this\nlooks good.\n\n> The cache is used for collision checks for the log placeholders %h, %t\n> and %p, and we can see the change speeding them up in a repository with\n> ca. 100 objects per subdirectory:\n>\n> $ git count-objects\n> 26733 objects, 68808 kilobytes\n>\n> Test                        HEAD^             HEAD\n> --------------------------------------------------------------------\n> 4205.1: log with %H         0.51(0.47+0.04)   0.51(0.49+0.02) +0.0%\n> 4205.2: log with %h         0.84(0.82+0.02)   0.60(0.57+0.03) -28.6%\n> 4205.3: log with %T         0.53(0.49+0.04)   0.52(0.48+0.03) -1.9%\n> 4205.4: log with %t         0.84(0.80+0.04)   0.60(0.59+0.01) -28.6%\n> 4205.5: log with %P         0.52(0.48+0.03)   0.51(0.50+0.01) -1.9%\n> 4205.6: log with %p         0.85(0.78+0.06)   0.61(0.56+0.05) -28.2%\n> 4205.7: log with %h-%h-%h   0.96(0.92+0.03)   0.69(0.64+0.04) -28.1%\n\nCan you elaborate on the test setup required to get to the point where\nyou got these numbers for subsequent comparison, i.e. how you generated\nthe approx 100 objects per dir, what OS/version & storage type etc.\n"},{"id":"366228","messageId":"949fb568-295f-de4a-dc87-bc721e8aea29@web.de","threadId":"50123","inReplyTo":"87imz1ed25.fsf@evledraar.gmail.com","subject":"Re: [PATCH 3/3] object-store: use one oid_array per subdirectory for loose cache","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2019-01-06T22:58:55Z","receivedAt":"2019-01-06T22:59:16Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 06.01.2019 um 21:38 schrieb Ævar Arnfjörð Bjarmason:\n>> $ git count-objects\n>> 26733 objects, 68808 kilobytes\n>>\n>> Test                        HEAD^             HEAD\n>> --------------------------------------------------------------------\n>> 4205.1: log with %H         0.51(0.47+0.04)   0.51(0.49+0.02) +0.0%\n>> 4205.2: log with %h         0.84(0.82+0.02)   0.60(0.57+0.03) -28.6%\n>> 4205.3: log with %T         0.53(0.49+0.04)   0.52(0.48+0.03) -1.9%\n>> 4205.4: log with %t         0.84(0.80+0.04)   0.60(0.59+0.01) -28.6%\n>> 4205.5: log with %P         0.52(0.48+0.03)   0.51(0.50+0.01) -1.9%\n>> 4205.6: log with %p         0.85(0.78+0.06)   0.61(0.56+0.05) -28.2%\n>> 4205.7: log with %h-%h-%h   0.96(0.92+0.03)   0.69(0.64+0.04) -28.1%\n> \n> Can you elaborate on the test setup required to get to the point where\n> you got these numbers for subsequent comparison, i.e. how you generated\n> the approx 100 objects per dir, what OS/version & storage type etc.\n\nI happened to have that many loose objects lying around.  Numbers are\nfor Debian Testing on a Hyper-V VM on Windows 10 1893 on an SSD.\n\nYou could fake object directory entries with something like this:\n\n    for d in .git/objects/??\n    do\n        for i in $(seq 0 9)\n        do\n            >\"$d/0000000000000000000000000000000000000$i\"\n        done\n    done\n\nRené\n"},{"id":"366232","messageId":"20190107082702.GB21362@sigill.intra.peff.net","threadId":"50123","inReplyTo":"b87e7e01-baa6-6fb2-7081-0042ecd3b6b7@web.de","subject":"Re: [PATCH 1/3] object-store: factor out odb_loose_cache()","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-01-07T08:27:02Z","receivedAt":"2019-01-07T08:27:05Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Jan 06, 2019 at 05:45:30PM +0100, René Scharfe wrote:\n\n> Add and use a function for loading the entries if a loose object\n> subdirectory for a given object ID.  It frees callers from deriving the\n> fanout key; they can use the returned oid_array reference for lookups or\n> forward range scans.\n\nMuch nicer.\n\n> diff --git a/object-store.h b/object-store.h\n> index 60758efad8..7236c571c0 100644\n> --- a/object-store.h\n> +++ b/object-store.h\n> @@ -54,6 +54,13 @@ void add_to_alternates_memory(const char *dir);\n>   */\n>  void odb_load_loose_cache(struct object_directory *odb, int subdir_nr);\n>  \n> +/*\n> + * Populate and return the loose object cache array corresponding to the\n> + * given object ID.\n> + */\n> +struct oid_array *odb_loose_cache(struct object_directory *odb,\n> +\t\t\t\t  const struct object_id *oid);\n> +\n\nI think the ugly-interfaced odb_load_loose_cache() can become \"static\"\nnow, as the only outside caller (from sha1-name.c) has gone away.\n\n> +struct oid_array *odb_loose_cache(struct object_directory *odb,\n> +\t\t\t\t  const struct object_id *oid)\n> +{\n> +\tint subdir_nr = oid->hash[0];\n> +\todb_load_loose_cache(odb, subdir_nr);\n> +\treturn &odb->loose_objects_cache;\n> +}\n> +\n>  void odb_load_loose_cache(struct object_directory *odb, int subdir_nr)\n\nYou'd need to re-order these definitions, of course (or alternatively,\njust fold the load function inline into odb_loose_cache()).\n\n-Peff\n"},{"id":"366233","messageId":"20190107083150.GC21362@sigill.intra.peff.net","threadId":"50123","inReplyTo":"3512c798-aa42-6fba-ee82-d33a8985be91@web.de","subject":"[PATCH 0/11] jk/loose-object-cache sha1/object_id fixups","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-01-07T08:31:51Z","receivedAt":"2019-01-07T08:31:54Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Jan 06, 2019 at 05:39:14PM +0100, René Scharfe wrote:\n\n> Am 28.12.2018 um 19:04 schrieb Junio C Hamano:\n> > * jk/loose-object-cache (2018-11-24) 10 commits\n> >   (merged to 'next' on 2018-12-28 at 5a5faf384e)\n> >  + odb_load_loose_cache: fix strbuf leak\n> >  + fetch-pack: drop custom loose object cache\n> >  + sha1-file: use loose object cache for quick existence check\n> >  + object-store: provide helpers for loose_objects_cache\n> >  + sha1-file: use an object_directory for the main object dir\n> >  + handle alternates paths the same as the main object dir\n> >  + sha1_file_name(): overwrite buffer instead of appending\n> >  + rename \"alternate_object_database\" to \"object_directory\"\n> >  + submodule--helper: prefer strip_suffix() to ends_with()\n> >  + fsck: do not reuse child_process structs\n> > \n> >  Originally merged to 'next' on 2018-11-24\n> > \n> >  Code clean-up with optimization for the codepath that checks\n> >  (non-)existence of loose objects.\n> > \n> >  Will merge to 'master'.\n> \n> So this has hit master in the meantime.  We discussed a sort performance\n> fix in [1]; I'll reply with a short series containing a cleaned-up and\n> rebased version as a follow-up.\n> \n>   object-store: factor out odb_loose_cache()\n>   object-store: factor out odb_clear_loose_cache()\n>   object-store: use one oid_array per subdirectory for loose cache\n\nThanks! With the exception of one tiny nit, this looks good to me.\n\nI also cleaned up my sha1/object_id patch and rebased it on top of what\nyou have here. Though as I worked on it, it expanded in scope a bit.\nPossibly it should be a separate series entirely, but that would create\nsome annoying textual conflicts on merge.\n\n  [01/11]: sha1-file: fix outdated sha1 comment references\n  [02/11]: update comment references to sha1_object_info()\n  [03/11]: http: use struct object_id instead of bare sha1\n  [04/11]: sha1-file: modernize loose object file functions\n  [05/11]: sha1-file: modernize loose header/stream functions\n  [06/11]: sha1-file: convert pass-through functions to object_id\n  [07/11]: convert has_sha1_file() callers to has_object_file()\n  [08/11]: sha1-file: drop has_sha1_file()\n  [09/11]: sha1-file: prefer \"loose object file\" to \"sha1 file\" in messages\n  [10/11]: sha1-file: avoid \"sha1 file\" for generic use in messages\n  [11/11]: prefer \"hash mismatch\" to \"sha1 mismatch\"\n\n Documentation/git-fsck.txt |   6 +-\n apply.c                    |   2 +-\n builtin/cat-file.c         |   6 +-\n builtin/fetch.c            |   7 +-\n builtin/index-pack.c       |   2 +-\n builtin/pack-objects.c     |   4 +-\n builtin/reflog.c           |   2 +-\n builtin/show-ref.c         |   2 +-\n bulk-checkin.c             |   2 +-\n cache-tree.c               |   4 +-\n cache.h                    |   6 +-\n http-push.c                |   2 +-\n http-walker.c              |  10 +-\n http.c                     |  14 +--\n http.h                     |   6 +-\n object-store.h             |  20 ++--\n object.c                   |   4 +-\n refs.c                     |   2 +-\n send-pack.c                |   2 +-\n sha1-file.c                | 219 +++++++++++++++++--------------------\n streaming.c                |  16 +--\n t/t1450-fsck.sh            |   2 +-\n 22 files changed, 161 insertions(+), 179 deletions(-)\n\n-Peff\n"},{"id":"366234","messageId":"20190107083352.GA29431@sigill.intra.peff.net","threadId":"50123","inReplyTo":"20190107083150.GC21362@sigill.intra.peff.net","subject":"[PATCH 01/11] sha1-file: fix outdated sha1 comment references","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-01-07T08:33:52Z","receivedAt":"2019-01-07T08:33:55Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"Commit 17e65451e3 (sha1_file: convert check_sha1_signature to struct\nobject_id, 2018-03-12) switched to using the name \"oid\", but forgot to\nupdate the variable name in the comment.\n\nLikewise, b4f5aca40e (sha1_file: convert read_sha1_file to struct\nobject_id, 2018-03-12) dropped the name read_sha1_file(), but missed a\ncomment which mentions it.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n sha1-file.c | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/sha1-file.c b/sha1-file.c\nindex c3c6e50704..e86bb28320 100644\n--- a/sha1-file.c\n+++ b/sha1-file.c\n@@ -124,7 +124,7 @@ const char *empty_blob_oid_hex(void)\n \n /*\n  * This is meant to hold a *small* number of objects that you would\n- * want read_sha1_file() to be able to return, but yet you do not want\n+ * want read_object_file() to be able to return, but yet you do not want\n  * to write them into the object store (e.g. a browse-only\n  * application).\n  */\n@@ -798,8 +798,8 @@ void *xmmap(void *start, size_t length,\n \n /*\n  * With an in-core object data in \"map\", rehash it to make sure the\n- * object name actually matches \"sha1\" to detect object corruption.\n- * With \"map\" == NULL, try reading the object named with \"sha1\" using\n+ * object name actually matches \"oid\" to detect object corruption.\n+ * With \"map\" == NULL, try reading the object named with \"oid\" using\n  * the streaming interface and rehash it to do the same.\n  */\n int check_object_signature(const struct object_id *oid, void *map,\n-- \n2.20.1.470.g640a3e2614\n\n"},{"id":"366235","messageId":"20190107083412.GB29431@sigill.intra.peff.net","threadId":"50123","inReplyTo":"20190107083150.GC21362@sigill.intra.peff.net","subject":"[PATCH 02/11] update comment references to sha1_object_info()","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-01-07T08:34:12Z","receivedAt":"2019-01-07T08:34:15Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"Commit abef9020e3 (sha1_file: convert sha1_object_info* to object_id,\n2018-03-12) renamed the function to oid_object_info(), but missed some\ncomments which mention it.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n builtin/cat-file.c     | 6 +++---\n builtin/pack-objects.c | 4 ++--\n cache.h                | 2 +-\n 3 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/builtin/cat-file.c b/builtin/cat-file.c\nindex 2ca56fd086..baaafbdcf3 100644\n--- a/builtin/cat-file.c\n+++ b/builtin/cat-file.c\n@@ -209,14 +209,14 @@ struct expand_data {\n \n \t/*\n \t * After a mark_query run, this object_info is set up to be\n-\t * passed to sha1_object_info_extended. It will point to the data\n+\t * passed to oid_object_info_extended. It will point to the data\n \t * elements above, so you can retrieve the response from there.\n \t */\n \tstruct object_info info;\n \n \t/*\n \t * This flag will be true if the requested batch format and options\n-\t * don't require us to call sha1_object_info, which can then be\n+\t * don't require us to call oid_object_info, which can then be\n \t * optimized out.\n \t */\n \tunsigned skip_object_info : 1;\n@@ -490,7 +490,7 @@ static int batch_objects(struct batch_options *opt)\n \n \t/*\n \t * Expand once with our special mark_query flag, which will prime the\n-\t * object_info to be handed to sha1_object_info_extended for each\n+\t * object_info to be handed to oid_object_info_extended for each\n \t * object.\n \t */\n \tmemset(&data, 0, sizeof(data));\ndiff --git a/builtin/pack-objects.c b/builtin/pack-objects.c\nindex 24bba8147f..d4c3987f3e 100644\n--- a/builtin/pack-objects.c\n+++ b/builtin/pack-objects.c\n@@ -1642,7 +1642,7 @@ static void check_object(struct object_entry *entry)\n \n \t\t/*\n \t\t * No choice but to fall back to the recursive delta walk\n-\t\t * with sha1_object_info() to find about the object type\n+\t\t * with oid_object_info() to find about the object type\n \t\t * at this point...\n \t\t */\n \t\tgive_up:\n@@ -1718,7 +1718,7 @@ static void drop_reused_delta(struct object_entry *entry)\n \tif (packed_object_info(the_repository, IN_PACK(entry), entry->in_pack_offset, &oi) < 0) {\n \t\t/*\n \t\t * We failed to get the info from this pack for some reason;\n-\t\t * fall back to sha1_object_info, which may find another copy.\n+\t\t * fall back to oid_object_info, which may find another copy.\n \t\t * And if that fails, the error will be recorded in oe_type(entry)\n \t\t * and dealt with in prepare_pack().\n \t\t */\ndiff --git a/cache.h b/cache.h\nindex ca36b44ee0..587512747b 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -1592,7 +1592,7 @@ extern int odb_mkstemp(struct strbuf *temp_filename, const char *pattern);\n extern int odb_pack_keep(const char *name);\n \n /*\n- * Set this to 0 to prevent sha1_object_info_extended() from fetching missing\n+ * Set this to 0 to prevent oid_object_info_extended() from fetching missing\n  * blobs. This has a difference only if extensions.partialClone is set.\n  *\n  * Its default value is 1.\n-- \n2.20.1.470.g640a3e2614\n\n"},{"id":"366236","messageId":"20190107083440.GC29431@sigill.intra.peff.net","threadId":"50123","inReplyTo":"20190107083150.GC21362@sigill.intra.peff.net","subject":"[PATCH 03/11] http: use struct object_id instead of bare sha1","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-01-07T08:34:40Z","receivedAt":"2019-01-07T08:34:43Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"The dumb-http walker code still passes around and stores object ids as\n\"unsigned char *sha1\". Let's modernize it.\n\nThere's probably still more work to be done to handle dumb-http fetches\nwith a new, larger hash. But that can wait; this is enough that we can\nnow convert some of the low-level object routines that we call into from\nhere (and in fact, some of the \"oid.hash\" references added here will be\nfurther improved in the next patch).\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n http-push.c   |  2 +-\n http-walker.c |  6 +++---\n http.c        | 14 +++++++-------\n http.h        |  6 +++---\n 4 files changed, 14 insertions(+), 14 deletions(-)\n\ndiff --git a/http-push.c b/http-push.c\nindex cd48590912..0141b0ad53 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -255,7 +255,7 @@ static void start_fetch_loose(struct transfer_request *request)\n \tstruct active_request_slot *slot;\n \tstruct http_object_request *obj_req;\n \n-\tobj_req = new_http_object_request(repo->url, request->obj->oid.hash);\n+\tobj_req = new_http_object_request(repo->url, &request->obj->oid);\n \tif (obj_req == NULL) {\n \t\trequest->state = ABORTED;\n \t\treturn;\ndiff --git a/http-walker.c b/http-walker.c\nindex 0a392c85b6..856716c63d 100644\n--- a/http-walker.c\n+++ b/http-walker.c\n@@ -58,7 +58,7 @@ static void start_object_request(struct walker *walker,\n \tstruct active_request_slot *slot;\n \tstruct http_object_request *req;\n \n-\treq = new_http_object_request(obj_req->repo->base, obj_req->oid.hash);\n+\treq = new_http_object_request(obj_req->repo->base, &obj_req->oid);\n \tif (req == NULL) {\n \t\tobj_req->state = ABORTED;\n \t\treturn;\n@@ -543,11 +543,11 @@ static int fetch_object(struct walker *walker, unsigned char *sha1)\n \t} else if (req->zret != Z_STREAM_END) {\n \t\twalker->corrupt_object_found++;\n \t\tret = error(\"File %s (%s) corrupt\", hex, req->url);\n-\t} else if (!hasheq(obj_req->oid.hash, req->real_sha1)) {\n+\t} else if (!oideq(&obj_req->oid, &req->real_oid)) {\n \t\tret = error(\"File %s has bad hash\", hex);\n \t} else if (req->rename < 0) {\n \t\tstruct strbuf buf = STRBUF_INIT;\n-\t\tloose_object_path(the_repository, &buf, req->sha1);\n+\t\tloose_object_path(the_repository, &buf, req->oid.hash);\n \t\tret = error(\"unable to write sha1 filename %s\", buf.buf);\n \t\tstrbuf_release(&buf);\n \t}\ndiff --git a/http.c b/http.c\nindex 0b6807cef9..8d42154792 100644\n--- a/http.c\n+++ b/http.c\n@@ -2337,9 +2337,9 @@ static size_t fwrite_sha1_file(char *ptr, size_t eltsize, size_t nmemb,\n }\n \n struct http_object_request *new_http_object_request(const char *base_url,\n-\tunsigned char *sha1)\n+\t\t\t\t\t\t    const struct object_id *oid)\n {\n-\tchar *hex = sha1_to_hex(sha1);\n+\tchar *hex = oid_to_hex(oid);\n \tstruct strbuf filename = STRBUF_INIT;\n \tstruct strbuf prevfile = STRBUF_INIT;\n \tint prevlocal;\n@@ -2350,10 +2350,10 @@ struct http_object_request *new_http_object_request(const char *base_url,\n \n \tfreq = xcalloc(1, sizeof(*freq));\n \tstrbuf_init(&freq->tmpfile, 0);\n-\thashcpy(freq->sha1, sha1);\n+\toidcpy(&freq->oid, oid);\n \tfreq->localfile = -1;\n \n-\tloose_object_path(the_repository, &filename, sha1);\n+\tloose_object_path(the_repository, &filename, oid->hash);\n \tstrbuf_addf(&freq->tmpfile, \"%s.temp\", filename.buf);\n \n \tstrbuf_addf(&prevfile, \"%s.prev\", filename.buf);\n@@ -2495,16 +2495,16 @@ int finish_http_object_request(struct http_object_request *freq)\n \t}\n \n \tgit_inflate_end(&freq->stream);\n-\tgit_SHA1_Final(freq->real_sha1, &freq->c);\n+\tgit_SHA1_Final(freq->real_oid.hash, &freq->c);\n \tif (freq->zret != Z_STREAM_END) {\n \t\tunlink_or_warn(freq->tmpfile.buf);\n \t\treturn -1;\n \t}\n-\tif (!hasheq(freq->sha1, freq->real_sha1)) {\n+\tif (!oideq(&freq->oid, &freq->real_oid)) {\n \t\tunlink_or_warn(freq->tmpfile.buf);\n \t\treturn -1;\n \t}\n-\tloose_object_path(the_repository, &filename, freq->sha1);\n+\tloose_object_path(the_repository, &filename, freq->oid.hash);\n \tfreq->rename = finalize_object_file(freq->tmpfile.buf, filename.buf);\n \tstrbuf_release(&filename);\n \ndiff --git a/http.h b/http.h\nindex d305ca1dc7..66c52b2e1e 100644\n--- a/http.h\n+++ b/http.h\n@@ -224,8 +224,8 @@ struct http_object_request {\n \tCURLcode curl_result;\n \tchar errorstr[CURL_ERROR_SIZE];\n \tlong http_code;\n-\tunsigned char sha1[20];\n-\tunsigned char real_sha1[20];\n+\tstruct object_id oid;\n+\tstruct object_id real_oid;\n \tgit_SHA_CTX c;\n \tgit_zstream stream;\n \tint zret;\n@@ -234,7 +234,7 @@ struct http_object_request {\n };\n \n extern struct http_object_request *new_http_object_request(\n-\tconst char *base_url, unsigned char *sha1);\n+\tconst char *base_url, const struct object_id *oid);\n extern void process_http_object_request(struct http_object_request *freq);\n extern int finish_http_object_request(struct http_object_request *freq);\n extern void abort_http_object_request(struct http_object_request *freq);\n-- \n2.20.1.470.g640a3e2614\n\n"},{"id":"366237","messageId":"20190107083542.GD29431@sigill.intra.peff.net","threadId":"50123","inReplyTo":"20190107083150.GC21362@sigill.intra.peff.net","subject":"[PATCH 04/11] sha1-file: modernize loose object file functions","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-01-07T08:35:42Z","receivedAt":"2019-01-07T08:35:47Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"The loose object access code in sha1-file.c is some of the oldest in\nGit, and could use some modernizing. It mostly uses \"unsigned char *\"\nfor object ids, which these days should be \"struct object_id\".\n\nIt also uses the term \"sha1_file\" in many functions, which is confusing.\nThe term \"loose_objects\" is much better. It clearly distinguishes\nthem from packed objects (which didn't even exist back when the name\n\"sha1_file\" came into being). And it also distinguishes it from the\nchecksummed-file concept in csum-file.c (which until recently was\nactually called \"struct sha1file\"!).\n\nThis patch converts the functions {open,close,map,stat}_sha1_file() into\nopen_loose_object(), etc, and switches their sha1 arguments for\nobject_id structs. Similarly, path functions like fill_sha1_path()\nbecome fill_loose_path() and use object_ids.\n\nThe function sha1_loose_object_info() already says \"loose\", so we can\njust drop the \"sha1\" (and teach it to use object_id).\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n http-walker.c  |  2 +-\n http.c         |  4 +--\n object-store.h |  8 +++--\n sha1-file.c    | 81 +++++++++++++++++++++++++-------------------------\n streaming.c    |  4 +--\n 5 files changed, 51 insertions(+), 48 deletions(-)\n\ndiff --git a/http-walker.c b/http-walker.c\nindex 856716c63d..29b59e2fe0 100644\n--- a/http-walker.c\n+++ b/http-walker.c\n@@ -547,7 +547,7 @@ static int fetch_object(struct walker *walker, unsigned char *sha1)\n \t\tret = error(\"File %s has bad hash\", hex);\n \t} else if (req->rename < 0) {\n \t\tstruct strbuf buf = STRBUF_INIT;\n-\t\tloose_object_path(the_repository, &buf, req->oid.hash);\n+\t\tloose_object_path(the_repository, &buf, &req->oid);\n \t\tret = error(\"unable to write sha1 filename %s\", buf.buf);\n \t\tstrbuf_release(&buf);\n \t}\ndiff --git a/http.c b/http.c\nindex 8d42154792..43d06dd074 100644\n--- a/http.c\n+++ b/http.c\n@@ -2353,7 +2353,7 @@ struct http_object_request *new_http_object_request(const char *base_url,\n \toidcpy(&freq->oid, oid);\n \tfreq->localfile = -1;\n \n-\tloose_object_path(the_repository, &filename, oid->hash);\n+\tloose_object_path(the_repository, &filename, oid);\n \tstrbuf_addf(&freq->tmpfile, \"%s.temp\", filename.buf);\n \n \tstrbuf_addf(&prevfile, \"%s.prev\", filename.buf);\n@@ -2504,7 +2504,7 @@ int finish_http_object_request(struct http_object_request *freq)\n \t\tunlink_or_warn(freq->tmpfile.buf);\n \t\treturn -1;\n \t}\n-\tloose_object_path(the_repository, &filename, freq->oid.hash);\n+\tloose_object_path(the_repository, &filename, &freq->oid);\n \tfreq->rename = finalize_object_file(freq->tmpfile.buf, filename.buf);\n \tstrbuf_release(&filename);\n \ndiff --git a/object-store.h b/object-store.h\nindex 2fb6c0e4db..6b1c408753 100644\n--- a/object-store.h\n+++ b/object-store.h\n@@ -161,11 +161,13 @@ void raw_object_store_clear(struct raw_object_store *o);\n \n /*\n  * Put in `buf` the name of the file in the local object database that\n- * would be used to store a loose object with the specified sha1.\n+ * would be used to store a loose object with the specified oid.\n  */\n-const char *loose_object_path(struct repository *r, struct strbuf *buf, const unsigned char *sha1);\n+const char *loose_object_path(struct repository *r, struct strbuf *buf,\n+\t\t\t      const struct object_id *oid);\n \n-void *map_sha1_file(struct repository *r, const unsigned char *sha1, unsigned long *size);\n+void *map_loose_object(struct repository *r, const struct object_id *oid,\n+\t\t       unsigned long *size);\n \n extern void *read_object_file_extended(const struct object_id *oid,\n \t\t\t\t       enum object_type *type,\ndiff --git a/sha1-file.c b/sha1-file.c\nindex e86bb28320..cd8e5f005a 100644\n--- a/sha1-file.c\n+++ b/sha1-file.c\n@@ -333,12 +333,12 @@ int raceproof_create_file(const char *path, create_file_fn fn, void *cb)\n \treturn ret;\n }\n \n-static void fill_sha1_path(struct strbuf *buf, const unsigned char *sha1)\n+static void fill_loose_path(struct strbuf *buf, const struct object_id *oid)\n {\n \tint i;\n \tfor (i = 0; i < the_hash_algo->rawsz; i++) {\n \t\tstatic char hex[] = \"0123456789abcdef\";\n-\t\tunsigned int val = sha1[i];\n+\t\tunsigned int val = oid->hash[i];\n \t\tstrbuf_addch(buf, hex[val >> 4]);\n \t\tstrbuf_addch(buf, hex[val & 0xf]);\n \t\tif (!i)\n@@ -348,19 +348,19 @@ static void fill_sha1_path(struct strbuf *buf, const unsigned char *sha1)\n \n static const char *odb_loose_path(struct object_directory *odb,\n \t\t\t\t  struct strbuf *buf,\n-\t\t\t\t  const unsigned char *sha1)\n+\t\t\t\t  const struct object_id *oid)\n {\n \tstrbuf_reset(buf);\n \tstrbuf_addstr(buf, odb->path);\n \tstrbuf_addch(buf, '/');\n-\tfill_sha1_path(buf, sha1);\n+\tfill_loose_path(buf, oid);\n \treturn buf->buf;\n }\n \n const char *loose_object_path(struct repository *r, struct strbuf *buf,\n-\t\t\t      const unsigned char *sha1)\n+\t\t\t      const struct object_id *oid)\n {\n-\treturn odb_loose_path(r->objects->odb, buf, sha1);\n+\treturn odb_loose_path(r->objects->odb, buf, oid);\n }\n \n /*\n@@ -721,7 +721,7 @@ static int check_and_freshen_odb(struct object_directory *odb,\n \t\t\t\t int freshen)\n {\n \tstatic struct strbuf path = STRBUF_INIT;\n-\todb_loose_path(odb, &path, oid->hash);\n+\todb_loose_path(odb, &path, oid);\n \treturn check_and_freshen_file(path.buf, freshen);\n }\n \n@@ -872,22 +872,22 @@ int git_open_cloexec(const char *name, int flags)\n }\n \n /*\n- * Find \"sha1\" as a loose object in the local repository or in an alternate.\n+ * Find \"oid\" as a loose object in the local repository or in an alternate.\n  * Returns 0 on success, negative on failure.\n  *\n  * The \"path\" out-parameter will give the path of the object we found (if any).\n  * Note that it may point to static storage and is only valid until another\n- * call to stat_sha1_file().\n+ * call to stat_loose_object().\n  */\n-static int stat_sha1_file(struct repository *r, const unsigned char *sha1,\n-\t\t\t  struct stat *st, const char **path)\n+static int stat_loose_object(struct repository *r, const struct object_id *oid,\n+\t\t\t     struct stat *st, const char **path)\n {\n \tstruct object_directory *odb;\n \tstatic struct strbuf buf = STRBUF_INIT;\n \n \tprepare_alt_odb(r);\n \tfor (odb = r->objects->odb; odb; odb = odb->next) {\n-\t\t*path = odb_loose_path(odb, &buf, sha1);\n+\t\t*path = odb_loose_path(odb, &buf, oid);\n \t\tif (!lstat(*path, st))\n \t\t\treturn 0;\n \t}\n@@ -896,11 +896,11 @@ static int stat_sha1_file(struct repository *r, const unsigned char *sha1,\n }\n \n /*\n- * Like stat_sha1_file(), but actually open the object and return the\n+ * Like stat_loose_object(), but actually open the object and return the\n  * descriptor. See the caveats on the \"path\" parameter above.\n  */\n-static int open_sha1_file(struct repository *r,\n-\t\t\t  const unsigned char *sha1, const char **path)\n+static int open_loose_object(struct repository *r,\n+\t\t\t     const struct object_id *oid, const char **path)\n {\n \tint fd;\n \tstruct object_directory *odb;\n@@ -909,7 +909,7 @@ static int open_sha1_file(struct repository *r,\n \n \tprepare_alt_odb(r);\n \tfor (odb = r->objects->odb; odb; odb = odb->next) {\n-\t\t*path = odb_loose_path(odb, &buf, sha1);\n+\t\t*path = odb_loose_path(odb, &buf, oid);\n \t\tfd = git_open(*path);\n \t\tif (fd >= 0)\n \t\t\treturn fd;\n@@ -939,10 +939,10 @@ static int quick_has_loose(struct repository *r,\n \n /*\n  * Map the loose object at \"path\" if it is not NULL, or the path found by\n- * searching for a loose object named \"sha1\".\n+ * searching for a loose object named \"oid\".\n  */\n-static void *map_sha1_file_1(struct repository *r, const char *path,\n-\t\t\t     const unsigned char *sha1, unsigned long *size)\n+static void *map_loose_object_1(struct repository *r, const char *path,\n+\t\t\t     const struct object_id *oid, unsigned long *size)\n {\n \tvoid *map;\n \tint fd;\n@@ -950,7 +950,7 @@ static void *map_sha1_file_1(struct repository *r, const char *path,\n \tif (path)\n \t\tfd = git_open(path);\n \telse\n-\t\tfd = open_sha1_file(r, sha1, &path);\n+\t\tfd = open_loose_object(r, oid, &path);\n \tmap = NULL;\n \tif (fd >= 0) {\n \t\tstruct stat st;\n@@ -969,10 +969,11 @@ static void *map_sha1_file_1(struct repository *r, const char *path,\n \treturn map;\n }\n \n-void *map_sha1_file(struct repository *r,\n-\t\t    const unsigned char *sha1, unsigned long *size)\n+void *map_loose_object(struct repository *r,\n+\t\t       const struct object_id *oid,\n+\t\t       unsigned long *size)\n {\n-\treturn map_sha1_file_1(r, NULL, sha1, size);\n+\treturn map_loose_object_1(r, NULL, oid, size);\n }\n \n static int unpack_sha1_short_header(git_zstream *stream,\n@@ -1161,9 +1162,9 @@ int parse_sha1_header(const char *hdr, unsigned long *sizep)\n \treturn parse_sha1_header_extended(hdr, &oi, 0);\n }\n \n-static int sha1_loose_object_info(struct repository *r,\n-\t\t\t\t  const unsigned char *sha1,\n-\t\t\t\t  struct object_info *oi, int flags)\n+static int loose_object_info(struct repository *r,\n+\t\t\t     const struct object_id *oid,\n+\t\t\t     struct object_info *oi, int flags)\n {\n \tint status = 0;\n \tunsigned long mapsize;\n@@ -1188,15 +1189,15 @@ static int sha1_loose_object_info(struct repository *r,\n \t\tconst char *path;\n \t\tstruct stat st;\n \t\tif (!oi->disk_sizep && (flags & OBJECT_INFO_QUICK))\n-\t\t\treturn quick_has_loose(r, sha1) ? 0 : -1;\n-\t\tif (stat_sha1_file(r, sha1, &st, &path) < 0)\n+\t\t\treturn quick_has_loose(r, oid->hash) ? 0 : -1;\n+\t\tif (stat_loose_object(r, oid, &st, &path) < 0)\n \t\t\treturn -1;\n \t\tif (oi->disk_sizep)\n \t\t\t*oi->disk_sizep = st.st_size;\n \t\treturn 0;\n \t}\n \n-\tmap = map_sha1_file(r, sha1, &mapsize);\n+\tmap = map_loose_object(r, oid, &mapsize);\n \tif (!map)\n \t\treturn -1;\n \n@@ -1208,22 +1209,22 @@ static int sha1_loose_object_info(struct repository *r,\n \tif ((flags & OBJECT_INFO_ALLOW_UNKNOWN_TYPE)) {\n \t\tif (unpack_sha1_header_to_strbuf(&stream, map, mapsize, hdr, sizeof(hdr), &hdrbuf) < 0)\n \t\t\tstatus = error(_(\"unable to unpack %s header with --allow-unknown-type\"),\n-\t\t\t\t       sha1_to_hex(sha1));\n+\t\t\t\t       oid_to_hex(oid));\n \t} else if (unpack_sha1_header(&stream, map, mapsize, hdr, sizeof(hdr)) < 0)\n \t\tstatus = error(_(\"unable to unpack %s header\"),\n-\t\t\t       sha1_to_hex(sha1));\n+\t\t\t       oid_to_hex(oid));\n \tif (status < 0)\n \t\t; /* Do nothing */\n \telse if (hdrbuf.len) {\n \t\tif ((status = parse_sha1_header_extended(hdrbuf.buf, oi, flags)) < 0)\n \t\t\tstatus = error(_(\"unable to parse %s header with --allow-unknown-type\"),\n-\t\t\t\t       sha1_to_hex(sha1));\n+\t\t\t\t       oid_to_hex(oid));\n \t} else if ((status = parse_sha1_header_extended(hdr, oi, flags)) < 0)\n-\t\tstatus = error(_(\"unable to parse %s header\"), sha1_to_hex(sha1));\n+\t\tstatus = error(_(\"unable to parse %s header\"), oid_to_hex(oid));\n \n \tif (status >= 0 && oi->contentp) {\n \t\t*oi->contentp = unpack_sha1_rest(&stream, hdr,\n-\t\t\t\t\t\t *oi->sizep, sha1);\n+\t\t\t\t\t\t *oi->sizep, oid->hash);\n \t\tif (!*oi->contentp) {\n \t\t\tgit_inflate_end(&stream);\n \t\t\tstatus = -1;\n@@ -1289,7 +1290,7 @@ int oid_object_info_extended(struct repository *r, const struct object_id *oid,\n \t\t\treturn -1;\n \n \t\t/* Most likely it's a loose object. */\n-\t\tif (!sha1_loose_object_info(r, real->hash, oi, flags))\n+\t\tif (!loose_object_info(r, real, oi, flags))\n \t\t\treturn 0;\n \n \t\t/* Not a loose object; someone else may have just packed it. */\n@@ -1417,7 +1418,7 @@ void *read_object_file_extended(const struct object_id *oid,\n \t\tdie(_(\"replacement %s not found for %s\"),\n \t\t    oid_to_hex(repl), oid_to_hex(oid));\n \n-\tif (!stat_sha1_file(the_repository, repl->hash, &st, &path))\n+\tif (!stat_loose_object(the_repository, repl, &st, &path))\n \t\tdie(_(\"loose object %s (stored in %s) is corrupt\"),\n \t\t    oid_to_hex(repl), path);\n \n@@ -1552,7 +1553,7 @@ int hash_object_file(const void *buf, unsigned long len, const char *type,\n }\n \n /* Finalize a file on disk, and close it. */\n-static void close_sha1_file(int fd)\n+static void close_loose_object(int fd)\n {\n \tif (fsync_object_files)\n \t\tfsync_or_die(fd, \"sha1 file\");\n@@ -1617,7 +1618,7 @@ static int write_loose_object(const struct object_id *oid, char *hdr,\n \tstatic struct strbuf tmp_file = STRBUF_INIT;\n \tstatic struct strbuf filename = STRBUF_INIT;\n \n-\tloose_object_path(the_repository, &filename, oid->hash);\n+\tloose_object_path(the_repository, &filename, oid);\n \n \tfd = create_tmpfile(&tmp_file, filename.buf);\n \tif (fd < 0) {\n@@ -1665,7 +1666,7 @@ static int write_loose_object(const struct object_id *oid, char *hdr,\n \t\tdie(_(\"confused by unstable object source data for %s\"),\n \t\t    oid_to_hex(oid));\n \n-\tclose_sha1_file(fd);\n+\tclose_loose_object(fd);\n \n \tif (mtime) {\n \t\tstruct utimbuf utb;\n@@ -2260,7 +2261,7 @@ int read_loose_object(const char *path,\n \n \t*contents = NULL;\n \n-\tmap = map_sha1_file_1(the_repository, path, NULL, &mapsize);\n+\tmap = map_loose_object_1(the_repository, path, NULL, &mapsize);\n \tif (!map) {\n \t\terror_errno(_(\"unable to mmap %s\"), path);\n \t\tgoto out;\ndiff --git a/streaming.c b/streaming.c\nindex ac7c7a22f9..9049146bc1 100644\n--- a/streaming.c\n+++ b/streaming.c\n@@ -338,8 +338,8 @@ static struct stream_vtbl loose_vtbl = {\n \n static open_method_decl(loose)\n {\n-\tst->u.loose.mapped = map_sha1_file(the_repository,\n-\t\t\t\t\t   oid->hash, &st->u.loose.mapsize);\n+\tst->u.loose.mapped = map_loose_object(the_repository,\n+\t\t\t\t\t      oid, &st->u.loose.mapsize);\n \tif (!st->u.loose.mapped)\n \t\treturn -1;\n \tif ((unpack_sha1_header(&st->z,\n-- \n2.20.1.470.g640a3e2614\n\n"},{"id":"366238","messageId":"20190107083702.GE29431@sigill.intra.peff.net","threadId":"50123","inReplyTo":"20190107083150.GC21362@sigill.intra.peff.net","subject":"[PATCH 05/11] sha1-file: modernize loose header/stream functions","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-01-07T08:37:02Z","receivedAt":"2019-01-07T08:37:07Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"As with the open/map/close functions for loose objects that were\nrecently converted, the functions for parsing the loose object stream\nuse the name \"sha1\" and a bare \"unsigned char *\". Let's fix that so that\nunpack_sha1_header() becomes unpack_loose_header(), etc.\n\nThese conversions are less clear-cut than the file access functions.\nYou could argue that the they are parsing Git's canonical object format\n(i.e., \"type size\\0contents\", over which we compute the hash), which is\nnot strictly tied to loose storage. But in practice these functions are\nused only for loose objects, and using the term \"loose_header\" (instead\nof \"object_header\") distinguishes it from the object header found in\npackfiles (which contains the same information in a different format).\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nOf course \"loose_object_header\" would be even more exact, but is quite\nlong. ;)\n\n cache.h     |  4 +--\n sha1-file.c | 84 +++++++++++++++++++++++++++--------------------------\n streaming.c | 12 ++++----\n 3 files changed, 51 insertions(+), 49 deletions(-)\n\ndiff --git a/cache.h b/cache.h\nindex 587512747b..653c36d0b7 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -1269,8 +1269,8 @@ extern char *xdg_cache_home(const char *filename);\n \n extern int git_open_cloexec(const char *name, int flags);\n #define git_open(name) git_open_cloexec(name, O_RDONLY)\n-extern int unpack_sha1_header(git_zstream *stream, unsigned char *map, unsigned long mapsize, void *buffer, unsigned long bufsiz);\n-extern int parse_sha1_header(const char *hdr, unsigned long *sizep);\n+extern int unpack_loose_header(git_zstream *stream, unsigned char *map, unsigned long mapsize, void *buffer, unsigned long bufsiz);\n+extern int parse_loose_header(const char *hdr, unsigned long *sizep);\n \n extern int check_object_signature(const struct object_id *oid, void *buf, unsigned long size, const char *type);\n \ndiff --git a/sha1-file.c b/sha1-file.c\nindex cd8e5f005a..4938258ed1 100644\n--- a/sha1-file.c\n+++ b/sha1-file.c\n@@ -976,9 +976,9 @@ void *map_loose_object(struct repository *r,\n \treturn map_loose_object_1(r, NULL, oid, size);\n }\n \n-static int unpack_sha1_short_header(git_zstream *stream,\n-\t\t\t\t    unsigned char *map, unsigned long mapsize,\n-\t\t\t\t    void *buffer, unsigned long bufsiz)\n+static int unpack_loose_short_header(git_zstream *stream,\n+\t\t\t\t     unsigned char *map, unsigned long mapsize,\n+\t\t\t\t     void *buffer, unsigned long bufsiz)\n {\n \t/* Get the data stream */\n \tmemset(stream, 0, sizeof(*stream));\n@@ -991,12 +991,12 @@ static int unpack_sha1_short_header(git_zstream *stream,\n \treturn git_inflate(stream, 0);\n }\n \n-int unpack_sha1_header(git_zstream *stream,\n-\t\t       unsigned char *map, unsigned long mapsize,\n-\t\t       void *buffer, unsigned long bufsiz)\n+int unpack_loose_header(git_zstream *stream,\n+\t\t\tunsigned char *map, unsigned long mapsize,\n+\t\t\tvoid *buffer, unsigned long bufsiz)\n {\n-\tint status = unpack_sha1_short_header(stream, map, mapsize,\n-\t\t\t\t\t      buffer, bufsiz);\n+\tint status = unpack_loose_short_header(stream, map, mapsize,\n+\t\t\t\t\t       buffer, bufsiz);\n \n \tif (status < Z_OK)\n \t\treturn status;\n@@ -1007,13 +1007,13 @@ int unpack_sha1_header(git_zstream *stream,\n \treturn 0;\n }\n \n-static int unpack_sha1_header_to_strbuf(git_zstream *stream, unsigned char *map,\n-\t\t\t\t\tunsigned long mapsize, void *buffer,\n-\t\t\t\t\tunsigned long bufsiz, struct strbuf *header)\n+static int unpack_loose_header_to_strbuf(git_zstream *stream, unsigned char *map,\n+\t\t\t\t\t unsigned long mapsize, void *buffer,\n+\t\t\t\t\t unsigned long bufsiz, struct strbuf *header)\n {\n \tint status;\n \n-\tstatus = unpack_sha1_short_header(stream, map, mapsize, buffer, bufsiz);\n+\tstatus = unpack_loose_short_header(stream, map, mapsize, buffer, bufsiz);\n \tif (status < Z_OK)\n \t\treturn -1;\n \n@@ -1043,7 +1043,9 @@ static int unpack_sha1_header_to_strbuf(git_zstream *stream, unsigned char *map,\n \treturn -1;\n }\n \n-static void *unpack_sha1_rest(git_zstream *stream, void *buffer, unsigned long size, const unsigned char *sha1)\n+static void *unpack_loose_rest(git_zstream *stream,\n+\t\t\t       void *buffer, unsigned long size,\n+\t\t\t       const struct object_id *oid)\n {\n \tint bytes = strlen(buffer) + 1;\n \tunsigned char *buf = xmallocz(size);\n@@ -1080,10 +1082,10 @@ static void *unpack_sha1_rest(git_zstream *stream, void *buffer, unsigned long s\n \t}\n \n \tif (status < 0)\n-\t\terror(_(\"corrupt loose object '%s'\"), sha1_to_hex(sha1));\n+\t\terror(_(\"corrupt loose object '%s'\"), oid_to_hex(oid));\n \telse if (stream->avail_in)\n \t\terror(_(\"garbage at end of loose object '%s'\"),\n-\t\t      sha1_to_hex(sha1));\n+\t\t      oid_to_hex(oid));\n \tfree(buf);\n \treturn NULL;\n }\n@@ -1093,8 +1095,8 @@ static void *unpack_sha1_rest(git_zstream *stream, void *buffer, unsigned long s\n  * too permissive for what we want to check. So do an anal\n  * object header parse by hand.\n  */\n-static int parse_sha1_header_extended(const char *hdr, struct object_info *oi,\n-\t\t\t       unsigned int flags)\n+static int parse_loose_header_extended(const char *hdr, struct object_info *oi,\n+\t\t\t\t       unsigned int flags)\n {\n \tconst char *type_buf = hdr;\n \tunsigned long size;\n@@ -1154,12 +1156,12 @@ static int parse_sha1_header_extended(const char *hdr, struct object_info *oi,\n \treturn *hdr ? -1 : type;\n }\n \n-int parse_sha1_header(const char *hdr, unsigned long *sizep)\n+int parse_loose_header(const char *hdr, unsigned long *sizep)\n {\n \tstruct object_info oi = OBJECT_INFO_INIT;\n \n \toi.sizep = sizep;\n-\treturn parse_sha1_header_extended(hdr, &oi, 0);\n+\treturn parse_loose_header_extended(hdr, &oi, 0);\n }\n \n static int loose_object_info(struct repository *r,\n@@ -1207,24 +1209,24 @@ static int loose_object_info(struct repository *r,\n \tif (oi->disk_sizep)\n \t\t*oi->disk_sizep = mapsize;\n \tif ((flags & OBJECT_INFO_ALLOW_UNKNOWN_TYPE)) {\n-\t\tif (unpack_sha1_header_to_strbuf(&stream, map, mapsize, hdr, sizeof(hdr), &hdrbuf) < 0)\n+\t\tif (unpack_loose_header_to_strbuf(&stream, map, mapsize, hdr, sizeof(hdr), &hdrbuf) < 0)\n \t\t\tstatus = error(_(\"unable to unpack %s header with --allow-unknown-type\"),\n \t\t\t\t       oid_to_hex(oid));\n-\t} else if (unpack_sha1_header(&stream, map, mapsize, hdr, sizeof(hdr)) < 0)\n+\t} else if (unpack_loose_header(&stream, map, mapsize, hdr, sizeof(hdr)) < 0)\n \t\tstatus = error(_(\"unable to unpack %s header\"),\n \t\t\t       oid_to_hex(oid));\n \tif (status < 0)\n \t\t; /* Do nothing */\n \telse if (hdrbuf.len) {\n-\t\tif ((status = parse_sha1_header_extended(hdrbuf.buf, oi, flags)) < 0)\n+\t\tif ((status = parse_loose_header_extended(hdrbuf.buf, oi, flags)) < 0)\n \t\t\tstatus = error(_(\"unable to parse %s header with --allow-unknown-type\"),\n \t\t\t\t       oid_to_hex(oid));\n-\t} else if ((status = parse_sha1_header_extended(hdr, oi, flags)) < 0)\n+\t} else if ((status = parse_loose_header_extended(hdr, oi, flags)) < 0)\n \t\tstatus = error(_(\"unable to parse %s header\"), oid_to_hex(oid));\n \n \tif (status >= 0 && oi->contentp) {\n-\t\t*oi->contentp = unpack_sha1_rest(&stream, hdr,\n-\t\t\t\t\t\t *oi->sizep, oid->hash);\n+\t\t*oi->contentp = unpack_loose_rest(&stream, hdr,\n+\t\t\t\t\t\t  *oi->sizep, oid);\n \t\tif (!*oi->contentp) {\n \t\t\tgit_inflate_end(&stream);\n \t\t\tstatus = -1;\n@@ -2189,14 +2191,14 @@ void odb_clear_loose_cache(struct object_directory *odb)\n \t       sizeof(odb->loose_objects_subdir_seen));\n }\n \n-static int check_stream_sha1(git_zstream *stream,\n-\t\t\t     const char *hdr,\n-\t\t\t     unsigned long size,\n-\t\t\t     const char *path,\n-\t\t\t     const unsigned char *expected_sha1)\n+static int check_stream_oid(git_zstream *stream,\n+\t\t\t    const char *hdr,\n+\t\t\t    unsigned long size,\n+\t\t\t    const char *path,\n+\t\t\t    const struct object_id *expected_oid)\n {\n \tgit_hash_ctx c;\n-\tunsigned char real_sha1[GIT_MAX_RAWSZ];\n+\tstruct object_id real_oid;\n \tunsigned char buf[4096];\n \tunsigned long total_read;\n \tint status = Z_OK;\n@@ -2212,7 +2214,7 @@ static int check_stream_sha1(git_zstream *stream,\n \n \t/*\n \t * This size comparison must be \"<=\" to read the final zlib packets;\n-\t * see the comment in unpack_sha1_rest for details.\n+\t * see the comment in unpack_loose_rest for details.\n \t */\n \twhile (total_read <= size &&\n \t       (status == Z_OK ||\n@@ -2228,19 +2230,19 @@ static int check_stream_sha1(git_zstream *stream,\n \tgit_inflate_end(stream);\n \n \tif (status != Z_STREAM_END) {\n-\t\terror(_(\"corrupt loose object '%s'\"), sha1_to_hex(expected_sha1));\n+\t\terror(_(\"corrupt loose object '%s'\"), oid_to_hex(expected_oid));\n \t\treturn -1;\n \t}\n \tif (stream->avail_in) {\n \t\terror(_(\"garbage at end of loose object '%s'\"),\n-\t\t      sha1_to_hex(expected_sha1));\n+\t\t      oid_to_hex(expected_oid));\n \t\treturn -1;\n \t}\n \n-\tthe_hash_algo->final_fn(real_sha1, &c);\n-\tif (!hasheq(expected_sha1, real_sha1)) {\n+\tthe_hash_algo->final_fn(real_oid.hash, &c);\n+\tif (!oideq(expected_oid, &real_oid)) {\n \t\terror(_(\"sha1 mismatch for %s (expected %s)\"), path,\n-\t\t      sha1_to_hex(expected_sha1));\n+\t\t      oid_to_hex(expected_oid));\n \t\treturn -1;\n \t}\n \n@@ -2267,12 +2269,12 @@ int read_loose_object(const char *path,\n \t\tgoto out;\n \t}\n \n-\tif (unpack_sha1_header(&stream, map, mapsize, hdr, sizeof(hdr)) < 0) {\n+\tif (unpack_loose_header(&stream, map, mapsize, hdr, sizeof(hdr)) < 0) {\n \t\terror(_(\"unable to unpack header of %s\"), path);\n \t\tgoto out;\n \t}\n \n-\t*type = parse_sha1_header(hdr, size);\n+\t*type = parse_loose_header(hdr, size);\n \tif (*type < 0) {\n \t\terror(_(\"unable to parse header of %s\"), path);\n \t\tgit_inflate_end(&stream);\n@@ -2280,10 +2282,10 @@ int read_loose_object(const char *path,\n \t}\n \n \tif (*type == OBJ_BLOB && *size > big_file_threshold) {\n-\t\tif (check_stream_sha1(&stream, hdr, *size, path, expected_oid->hash) < 0)\n+\t\tif (check_stream_oid(&stream, hdr, *size, path, expected_oid) < 0)\n \t\t\tgoto out;\n \t} else {\n-\t\t*contents = unpack_sha1_rest(&stream, hdr, *size, expected_oid->hash);\n+\t\t*contents = unpack_loose_rest(&stream, hdr, *size, expected_oid);\n \t\tif (!*contents) {\n \t\t\terror(_(\"unable to unpack contents of %s\"), path);\n \t\t\tgit_inflate_end(&stream);\ndiff --git a/streaming.c b/streaming.c\nindex 9049146bc1..998e6285d7 100644\n--- a/streaming.c\n+++ b/streaming.c\n@@ -342,12 +342,12 @@ static open_method_decl(loose)\n \t\t\t\t\t      oid, &st->u.loose.mapsize);\n \tif (!st->u.loose.mapped)\n \t\treturn -1;\n-\tif ((unpack_sha1_header(&st->z,\n-\t\t\t\tst->u.loose.mapped,\n-\t\t\t\tst->u.loose.mapsize,\n-\t\t\t\tst->u.loose.hdr,\n-\t\t\t\tsizeof(st->u.loose.hdr)) < 0) ||\n-\t    (parse_sha1_header(st->u.loose.hdr, &st->size) < 0)) {\n+\tif ((unpack_loose_header(&st->z,\n+\t\t\t\t st->u.loose.mapped,\n+\t\t\t\t st->u.loose.mapsize,\n+\t\t\t\t st->u.loose.hdr,\n+\t\t\t\t sizeof(st->u.loose.hdr)) < 0) ||\n+\t    (parse_loose_header(st->u.loose.hdr, &st->size) < 0)) {\n \t\tgit_inflate_end(&st->z);\n \t\tmunmap(st->u.loose.mapped, st->u.loose.mapsize);\n \t\treturn -1;\n-- \n2.20.1.470.g640a3e2614\n\n"},{"id":"366239","messageId":"20190107083729.GF29431@sigill.intra.peff.net","threadId":"50123","inReplyTo":"20190107083150.GC21362@sigill.intra.peff.net","subject":"[PATCH 06/11] sha1-file: convert pass-through functions to object_id","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-01-07T08:37:29Z","receivedAt":"2019-01-07T08:37:32Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"These two static functions, read_object() and quick_has_loose(), both\nhave to hashcpy() their bare-sha1 arguments into object_id structs to\npass them along. Since all of their callers actually have object_id\nstructs in the first place, we can eliminate the copying by adjusting\ntheir input parameters.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n sha1-file.c | 20 +++++++-------------\n 1 file changed, 7 insertions(+), 13 deletions(-)\n\ndiff --git a/sha1-file.c b/sha1-file.c\nindex 4938258ed1..589a666686 100644\n--- a/sha1-file.c\n+++ b/sha1-file.c\n@@ -922,16 +922,13 @@ static int open_loose_object(struct repository *r,\n }\n \n static int quick_has_loose(struct repository *r,\n-\t\t\t   const unsigned char *sha1)\n+\t\t\t   const struct object_id *oid)\n {\n-\tstruct object_id oid;\n \tstruct object_directory *odb;\n \n-\thashcpy(oid.hash, sha1);\n-\n \tprepare_alt_odb(r);\n \tfor (odb = r->objects->odb; odb; odb = odb->next) {\n-\t\tif (oid_array_lookup(odb_loose_cache(odb, &oid), &oid) >= 0)\n+\t\tif (oid_array_lookup(odb_loose_cache(odb, oid), oid) >= 0)\n \t\t\treturn 1;\n \t}\n \treturn 0;\n@@ -1191,7 +1188,7 @@ static int loose_object_info(struct repository *r,\n \t\tconst char *path;\n \t\tstruct stat st;\n \t\tif (!oi->disk_sizep && (flags & OBJECT_INFO_QUICK))\n-\t\t\treturn quick_has_loose(r, oid->hash) ? 0 : -1;\n+\t\t\treturn quick_has_loose(r, oid) ? 0 : -1;\n \t\tif (stat_loose_object(r, oid, &st, &path) < 0)\n \t\t\treturn -1;\n \t\tif (oi->disk_sizep)\n@@ -1355,19 +1352,16 @@ int oid_object_info(struct repository *r,\n \treturn type;\n }\n \n-static void *read_object(const unsigned char *sha1, enum object_type *type,\n+static void *read_object(const struct object_id *oid, enum object_type *type,\n \t\t\t unsigned long *size)\n {\n-\tstruct object_id oid;\n \tstruct object_info oi = OBJECT_INFO_INIT;\n \tvoid *content;\n \toi.typep = type;\n \toi.sizep = size;\n \toi.contentp = &content;\n \n-\thashcpy(oid.hash, sha1);\n-\n-\tif (oid_object_info_extended(the_repository, &oid, &oi, 0) < 0)\n+\tif (oid_object_info_extended(the_repository, oid, &oi, 0) < 0)\n \t\treturn NULL;\n \treturn content;\n }\n@@ -1408,7 +1402,7 @@ void *read_object_file_extended(const struct object_id *oid,\n \t\tlookup_replace_object(the_repository, oid) : oid;\n \n \terrno = 0;\n-\tdata = read_object(repl->hash, type, size);\n+\tdata = read_object(repl, type, size);\n \tif (data)\n \t\treturn data;\n \n@@ -1748,7 +1742,7 @@ int force_object_loose(const struct object_id *oid, time_t mtime)\n \n \tif (has_loose_object(oid))\n \t\treturn 0;\n-\tbuf = read_object(oid->hash, &type, &len);\n+\tbuf = read_object(oid, &type, &len);\n \tif (!buf)\n \t\treturn error(_(\"cannot read sha1_file for %s\"), oid_to_hex(oid));\n \thdrlen = xsnprintf(hdr, sizeof(hdr), \"%s %\"PRIuMAX , type_name(type), (uintmax_t)len) + 1;\n-- \n2.20.1.470.g640a3e2614\n\n"},{"id":"366240","messageId":"20190107083754.GG29431@sigill.intra.peff.net","threadId":"50123","inReplyTo":"20190107083150.GC21362@sigill.intra.peff.net","subject":"[PATCH 07/11] convert has_sha1_file() callers to has_object_file()","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-01-07T08:37:54Z","receivedAt":"2019-01-07T08:37:59Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"The only remaining callers of has_sha1_file() actually have an object_id\nalready. They can use the \"object\" variant, rather than dereferencing\nthe hash themselves.\n\nThe code changes here were completely generated by the included\ncoccinelle patch.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n apply.c                            |  2 +-\n builtin/fetch.c                    |  7 +++----\n builtin/index-pack.c               |  2 +-\n builtin/reflog.c                   |  2 +-\n builtin/show-ref.c                 |  2 +-\n bulk-checkin.c                     |  2 +-\n cache-tree.c                       |  4 ++--\n contrib/coccinelle/object_id.cocci | 32 ++++++++++++++++++++++++++++++\n http-walker.c                      |  4 ++--\n refs.c                             |  2 +-\n send-pack.c                        |  2 +-\n sha1-file.c                        |  2 +-\n 12 files changed, 47 insertions(+), 16 deletions(-)\n\ndiff --git a/apply.c b/apply.c\nindex 01793d6126..b8e257ead2 100644\n--- a/apply.c\n+++ b/apply.c\n@@ -3183,7 +3183,7 @@ static int apply_binary(struct apply_state *state,\n \t\treturn 0; /* deletion patch */\n \t}\n \n-\tif (has_sha1_file(oid.hash)) {\n+\tif (has_object_file(&oid)) {\n \t\t/* We already have the postimage */\n \t\tenum object_type type;\n \t\tunsigned long size;\ndiff --git a/builtin/fetch.c b/builtin/fetch.c\nindex e0140327aa..57f35c6a0a 100644\n--- a/builtin/fetch.c\n+++ b/builtin/fetch.c\n@@ -317,8 +317,7 @@ static void find_non_local_tags(const struct ref *refs,\n \t\t\t    !has_object_file_with_flags(&ref->old_oid,\n \t\t\t\t\t\t\tOBJECT_INFO_QUICK) &&\n \t\t\t    !will_fetch(head, ref->old_oid.hash) &&\n-\t\t\t    !has_sha1_file_with_flags(item->oid.hash,\n-\t\t\t\t\t\t      OBJECT_INFO_QUICK) &&\n+\t\t\t    !has_object_file_with_flags(&item->oid, OBJECT_INFO_QUICK) &&\n \t\t\t    !will_fetch(head, item->oid.hash))\n \t\t\t\toidclr(&item->oid);\n \t\t\titem = NULL;\n@@ -332,7 +331,7 @@ static void find_non_local_tags(const struct ref *refs,\n \t\t * fetch.\n \t\t */\n \t\tif (item &&\n-\t\t    !has_sha1_file_with_flags(item->oid.hash, OBJECT_INFO_QUICK) &&\n+\t\t    !has_object_file_with_flags(&item->oid, OBJECT_INFO_QUICK) &&\n \t\t    !will_fetch(head, item->oid.hash))\n \t\t\toidclr(&item->oid);\n \n@@ -353,7 +352,7 @@ static void find_non_local_tags(const struct ref *refs,\n \t * checked to see if it needs fetching.\n \t */\n \tif (item &&\n-\t    !has_sha1_file_with_flags(item->oid.hash, OBJECT_INFO_QUICK) &&\n+\t    !has_object_file_with_flags(&item->oid, OBJECT_INFO_QUICK) &&\n \t    !will_fetch(head, item->oid.hash))\n \t\toidclr(&item->oid);\n \ndiff --git a/builtin/index-pack.c b/builtin/index-pack.c\nindex ac1f4ea9a7..31046c7a0a 100644\n--- a/builtin/index-pack.c\n+++ b/builtin/index-pack.c\n@@ -772,7 +772,7 @@ static void sha1_object(const void *data, struct object_entry *obj_entry,\n \tif (startup_info->have_repository) {\n \t\tread_lock();\n \t\tcollision_test_needed =\n-\t\t\thas_sha1_file_with_flags(oid->hash, OBJECT_INFO_QUICK);\n+\t\t\thas_object_file_with_flags(oid, OBJECT_INFO_QUICK);\n \t\tread_unlock();\n \t}\n \ndiff --git a/builtin/reflog.c b/builtin/reflog.c\nindex 64a8df4f25..45e9e15006 100644\n--- a/builtin/reflog.c\n+++ b/builtin/reflog.c\n@@ -94,7 +94,7 @@ static int tree_is_complete(const struct object_id *oid)\n \tinit_tree_desc(&desc, tree->buffer, tree->size);\n \tcomplete = 1;\n \twhile (tree_entry(&desc, &entry)) {\n-\t\tif (!has_sha1_file(entry.oid->hash) ||\n+\t\tif (!has_object_file(entry.oid) ||\n \t\t    (S_ISDIR(entry.mode) && !tree_is_complete(entry.oid))) {\n \t\t\ttree->object.flags |= INCOMPLETE;\n \t\t\tcomplete = 0;\ndiff --git a/builtin/show-ref.c b/builtin/show-ref.c\nindex ed888ffa48..6a706c02a6 100644\n--- a/builtin/show-ref.c\n+++ b/builtin/show-ref.c\n@@ -23,7 +23,7 @@ static void show_one(const char *refname, const struct object_id *oid)\n \tconst char *hex;\n \tstruct object_id peeled;\n \n-\tif (!has_sha1_file(oid->hash))\n+\tif (!has_object_file(oid))\n \t\tdie(\"git show-ref: bad ref %s (%s)\", refname,\n \t\t    oid_to_hex(oid));\n \ndiff --git a/bulk-checkin.c b/bulk-checkin.c\nindex 409ecb566b..39ee7d6107 100644\n--- a/bulk-checkin.c\n+++ b/bulk-checkin.c\n@@ -67,7 +67,7 @@ static int already_written(struct bulk_checkin_state *state, struct object_id *o\n \tint i;\n \n \t/* The object may already exist in the repository */\n-\tif (has_sha1_file(oid->hash))\n+\tif (has_object_file(oid))\n \t\treturn 1;\n \n \t/* Might want to keep the list sorted */\ndiff --git a/cache-tree.c b/cache-tree.c\nindex 190c6e5aa6..47f3464a1f 100644\n--- a/cache-tree.c\n+++ b/cache-tree.c\n@@ -225,7 +225,7 @@ int cache_tree_fully_valid(struct cache_tree *it)\n \tint i;\n \tif (!it)\n \t\treturn 0;\n-\tif (it->entry_count < 0 || !has_sha1_file(it->oid.hash))\n+\tif (it->entry_count < 0 || !has_object_file(&it->oid))\n \t\treturn 0;\n \tfor (i = 0; i < it->subtree_nr; i++) {\n \t\tif (!cache_tree_fully_valid(it->down[i]->cache_tree))\n@@ -253,7 +253,7 @@ static int update_one(struct cache_tree *it,\n \n \t*skip_count = 0;\n \n-\tif (0 <= it->entry_count && has_sha1_file(it->oid.hash))\n+\tif (0 <= it->entry_count && has_object_file(&it->oid))\n \t\treturn it->entry_count;\n \n \t/*\ndiff --git a/contrib/coccinelle/object_id.cocci b/contrib/coccinelle/object_id.cocci\nindex 6a7cf3e02d..73886ae583 100644\n--- a/contrib/coccinelle/object_id.cocci\n+++ b/contrib/coccinelle/object_id.cocci\n@@ -147,3 +147,35 @@ expression E1, E2;\n - hashcmp(E1, E2) != 0\n + !hasheq(E1, E2)\n   ...>}\n+\n+@@\n+struct object_id OID;\n+@@\n+- has_sha1_file(OID.hash)\n++ has_object_file(&OID)\n+\n+@@\n+identifier f != has_object_file;\n+struct object_id *OIDPTR;\n+@@\n+  f(...) {<...\n+- has_sha1_file(OIDPTR->hash)\n++ has_object_file(OIDPTR)\n+  ...>}\n+\n+@@\n+struct object_id OID;\n+expression E;\n+@@\n+- has_sha1_file_with_flags(OID.hash, E)\n++ has_object_file_with_flags(&OID, E)\n+\n+@@\n+identifier f != has_object_file_with_flags;\n+struct object_id *OIDPTR;\n+expression E;\n+@@\n+  f(...) {<...\n+- has_sha1_file_with_flags(OIDPTR->hash, E)\n++ has_object_file_with_flags(OIDPTR, E)\n+  ...>}\ndiff --git a/http-walker.c b/http-walker.c\nindex 29b59e2fe0..8ae5d76c6a 100644\n--- a/http-walker.c\n+++ b/http-walker.c\n@@ -131,7 +131,7 @@ static int fill_active_slot(struct walker *walker)\n \tlist_for_each_safe(pos, tmp, head) {\n \t\tobj_req = list_entry(pos, struct object_request, node);\n \t\tif (obj_req->state == WAITING) {\n-\t\t\tif (has_sha1_file(obj_req->oid.hash))\n+\t\t\tif (has_object_file(&obj_req->oid))\n \t\t\t\tobj_req->state = COMPLETE;\n \t\t\telse {\n \t\t\t\tstart_object_request(walker, obj_req);\n@@ -489,7 +489,7 @@ static int fetch_object(struct walker *walker, unsigned char *sha1)\n \tif (obj_req == NULL)\n \t\treturn error(\"Couldn't find request for %s in the queue\", hex);\n \n-\tif (has_sha1_file(obj_req->oid.hash)) {\n+\tif (has_object_file(&obj_req->oid)) {\n \t\tif (obj_req->req != NULL)\n \t\t\tabort_http_object_request(obj_req->req);\n \t\tabort_object_request(obj_req);\ndiff --git a/refs.c b/refs.c\nindex f9936355cd..142888a40a 100644\n--- a/refs.c\n+++ b/refs.c\n@@ -188,7 +188,7 @@ int ref_resolves_to_object(const char *refname,\n {\n \tif (flags & REF_ISBROKEN)\n \t\treturn 0;\n-\tif (!has_sha1_file(oid->hash)) {\n+\tif (!has_object_file(oid)) {\n \t\terror(_(\"%s does not point to a valid object!\"), refname);\n \t\treturn 0;\n \t}\ndiff --git a/send-pack.c b/send-pack.c\nindex f692686770..c673d3ed06 100644\n--- a/send-pack.c\n+++ b/send-pack.c\n@@ -40,7 +40,7 @@ int option_parse_push_signed(const struct option *opt,\n \n static void feed_object(const struct object_id *oid, FILE *fh, int negative)\n {\n-\tif (negative && !has_sha1_file(oid->hash))\n+\tif (negative && !has_object_file(oid))\n \t\treturn;\n \n \tif (negative)\ndiff --git a/sha1-file.c b/sha1-file.c\nindex 589a666686..449456f2ad 100644\n--- a/sha1-file.c\n+++ b/sha1-file.c\n@@ -1372,7 +1372,7 @@ int pretend_object_file(void *buf, unsigned long len, enum object_type type,\n \tstruct cached_object *co;\n \n \thash_object_file(buf, len, type_name(type), oid);\n-\tif (has_sha1_file(oid->hash) || find_cached_object(oid))\n+\tif (has_object_file(oid) || find_cached_object(oid))\n \t\treturn 0;\n \tALLOC_GROW(cached_objects, cached_object_nr + 1, cached_object_alloc);\n \tco = &cached_objects[cached_object_nr++];\n-- \n2.20.1.470.g640a3e2614\n\n"},{"id":"366241","messageId":"20190107083900.GH29431@sigill.intra.peff.net","threadId":"50123","inReplyTo":"20190107083150.GC21362@sigill.intra.peff.net","subject":"[PATCH 08/11] sha1-file: drop has_sha1_file()","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-01-07T08:39:00Z","receivedAt":"2019-01-07T08:39:03Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"There are no callers left of has_sha1_file() or its with_flags()\nvariant. Let's drop them, and convert has_object_file() from a wrapper\ninto the \"real\" function. Ironically, the sha1 variant was just copying\ninto an object_id internally, so the resulting code is actually shorter!\n\nWe can also drop the coccinelle rules for catching has_sha1_file()\ncallers. Since the function no longer exists, the compiler will do that\nfor us.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n contrib/coccinelle/object_id.cocci | 32 ------------------------------\n object-store.h                     | 12 ++++-------\n sha1-file.c                        | 16 ++-------------\n 3 files changed, 6 insertions(+), 54 deletions(-)\n\ndiff --git a/contrib/coccinelle/object_id.cocci b/contrib/coccinelle/object_id.cocci\nindex 73886ae583..6a7cf3e02d 100644\n--- a/contrib/coccinelle/object_id.cocci\n+++ b/contrib/coccinelle/object_id.cocci\n@@ -147,35 +147,3 @@ expression E1, E2;\n - hashcmp(E1, E2) != 0\n + !hasheq(E1, E2)\n   ...>}\n-\n-@@\n-struct object_id OID;\n-@@\n-- has_sha1_file(OID.hash)\n-+ has_object_file(&OID)\n-\n-@@\n-identifier f != has_object_file;\n-struct object_id *OIDPTR;\n-@@\n-  f(...) {<...\n-- has_sha1_file(OIDPTR->hash)\n-+ has_object_file(OIDPTR)\n-  ...>}\n-\n-@@\n-struct object_id OID;\n-expression E;\n-@@\n-- has_sha1_file_with_flags(OID.hash, E)\n-+ has_object_file_with_flags(&OID, E)\n-\n-@@\n-identifier f != has_object_file_with_flags;\n-struct object_id *OIDPTR;\n-expression E;\n-@@\n-  f(...) {<...\n-- has_sha1_file_with_flags(OIDPTR->hash, E)\n-+ has_object_file_with_flags(OIDPTR, E)\n-  ...>}\ndiff --git a/object-store.h b/object-store.h\nindex 6b1c408753..9e8ac6a1d4 100644\n--- a/object-store.h\n+++ b/object-store.h\n@@ -209,20 +209,16 @@ int read_loose_object(const char *path,\n \t\t      void **contents);\n \n /*\n- * Convenience for sha1_object_info_extended() with a NULL struct\n+ * Convenience for oid_object_info_extended() with a NULL struct\n  * object_info. OBJECT_INFO_SKIP_CACHED is automatically set; pass\n  * nonzero flags to also set other flags.\n  */\n-extern int has_sha1_file_with_flags(const unsigned char *sha1, int flags);\n-static inline int has_sha1_file(const unsigned char *sha1)\n+int has_object_file_with_flags(const struct object_id *oid, int flags);\n+static inline int has_object_file(const struct object_id *oid)\n {\n-\treturn has_sha1_file_with_flags(sha1, 0);\n+\treturn has_object_file_with_flags(oid, 0);\n }\n \n-/* Same as the above, except for struct object_id. */\n-extern int has_object_file(const struct object_id *oid);\n-extern int has_object_file_with_flags(const struct object_id *oid, int flags);\n-\n /*\n  * Return true iff an alternate object database has a loose object\n  * with the specified name.  This function does not respect replace\ndiff --git a/sha1-file.c b/sha1-file.c\nindex 449456f2ad..da6d78976f 100644\n--- a/sha1-file.c\n+++ b/sha1-file.c\n@@ -1752,26 +1752,14 @@ int force_object_loose(const struct object_id *oid, time_t mtime)\n \treturn ret;\n }\n \n-int has_sha1_file_with_flags(const unsigned char *sha1, int flags)\n+int has_object_file_with_flags(const struct object_id *oid, int flags)\n {\n-\tstruct object_id oid;\n \tif (!startup_info->have_repository)\n \t\treturn 0;\n-\thashcpy(oid.hash, sha1);\n-\treturn oid_object_info_extended(the_repository, &oid, NULL,\n+\treturn oid_object_info_extended(the_repository, oid, NULL,\n \t\t\t\t\tflags | OBJECT_INFO_SKIP_CACHED) >= 0;\n }\n \n-int has_object_file(const struct object_id *oid)\n-{\n-\treturn has_sha1_file(oid->hash);\n-}\n-\n-int has_object_file_with_flags(const struct object_id *oid, int flags)\n-{\n-\treturn has_sha1_file_with_flags(oid->hash, flags);\n-}\n-\n static void check_tree(const void *buf, size_t size)\n {\n \tstruct tree_desc desc;\n-- \n2.20.1.470.g640a3e2614\n\n"},{"id":"366242","messageId":"20190107083924.GI29431@sigill.intra.peff.net","threadId":"50123","inReplyTo":"20190107083150.GC21362@sigill.intra.peff.net","subject":"[PATCH 09/11] sha1-file: prefer \"loose object file\" to \"sha1 file\" in messages","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-01-07T08:39:24Z","receivedAt":"2019-01-07T08:39:28Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"When we're reporting an error for a loose object, let's use that term.\nIt's more consistent with other parts of Git, and it is future-proof\nagainst changes to the hash function.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n sha1-file.c | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/sha1-file.c b/sha1-file.c\nindex da6d78976f..07cc9b548b 100644\n--- a/sha1-file.c\n+++ b/sha1-file.c\n@@ -1552,9 +1552,9 @@ int hash_object_file(const void *buf, unsigned long len, const char *type,\n static void close_loose_object(int fd)\n {\n \tif (fsync_object_files)\n-\t\tfsync_or_die(fd, \"sha1 file\");\n+\t\tfsync_or_die(fd, \"loose object file\");\n \tif (close(fd) != 0)\n-\t\tdie_errno(_(\"error when closing sha1 file\"));\n+\t\tdie_errno(_(\"error when closing loose object file\"));\n }\n \n /* Size of directory component, including the ending '/' */\n@@ -1645,7 +1645,7 @@ static int write_loose_object(const struct object_id *oid, char *hdr,\n \t\tret = git_deflate(&stream, Z_FINISH);\n \t\tthe_hash_algo->update_fn(&c, in0, stream.next_in - in0);\n \t\tif (write_buffer(fd, compressed, stream.next_out - compressed) < 0)\n-\t\t\tdie(_(\"unable to write sha1 file\"));\n+\t\t\tdie(_(\"unable to write loose object file\"));\n \t\tstream.next_out = compressed;\n \t\tstream.avail_out = sizeof(compressed);\n \t} while (ret == Z_OK);\n-- \n2.20.1.470.g640a3e2614\n\n"},{"id":"366243","messageId":"20190107083933.GJ29431@sigill.intra.peff.net","threadId":"50123","inReplyTo":"20190107083150.GC21362@sigill.intra.peff.net","subject":"[PATCH 10/11] sha1-file: avoid \"sha1 file\" for generic use in messages","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-01-07T08:39:33Z","receivedAt":"2019-01-07T08:39:36Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"These error messages say \"sha1 file\", which is vague and not common in\nuser-facing documentation. Unlike the conversions from the previous\ncommit, these do not always refer to loose objects.\n\nIn finalize_object_file() we could be dealing with a packfile. Let's\njust say \"unable to write file\" instead; since we include the filename,\nthe nature of the file is clear from the rest of the message.\n\nIn force_object_loose(), we're calling into read_object(), which could\nactually be _any_ type of object. Just say \"object\".\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n sha1-file.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/sha1-file.c b/sha1-file.c\nindex 07cc9b548b..55a4782844 100644\n--- a/sha1-file.c\n+++ b/sha1-file.c\n@@ -1521,7 +1521,7 @@ int finalize_object_file(const char *tmpfile, const char *filename)\n \tunlink_or_warn(tmpfile);\n \tif (ret) {\n \t\tif (ret != EEXIST) {\n-\t\t\treturn error_errno(_(\"unable to write sha1 filename %s\"), filename);\n+\t\t\treturn error_errno(_(\"unable to write file %s\"), filename);\n \t\t}\n \t\t/* FIXME!!! Collision check here ? */\n \t}\n@@ -1744,7 +1744,7 @@ int force_object_loose(const struct object_id *oid, time_t mtime)\n \t\treturn 0;\n \tbuf = read_object(oid, &type, &len);\n \tif (!buf)\n-\t\treturn error(_(\"cannot read sha1_file for %s\"), oid_to_hex(oid));\n+\t\treturn error(_(\"cannot read object for %s\"), oid_to_hex(oid));\n \thdrlen = xsnprintf(hdr, sizeof(hdr), \"%s %\"PRIuMAX , type_name(type), (uintmax_t)len) + 1;\n \tret = write_loose_object(oid, hdr, hdrlen, buf, len, mtime);\n \tfree(buf);\n-- \n2.20.1.470.g640a3e2614\n\n"},{"id":"366244","messageId":"20190107084033.GK29431@sigill.intra.peff.net","threadId":"50123","inReplyTo":"20190107083150.GC21362@sigill.intra.peff.net","subject":"[PATCH 11/11] prefer \"hash mismatch\" to \"sha1 mismatch\"","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-01-07T08:40:34Z","receivedAt":"2019-01-07T08:40:37Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"To future-proof ourselves against a change in the hash, let's use the\nmore generic \"hash mismatch\" to refer to integrity problems. Note that\nwe do advertise this exact string in git-fsck(1). However, the message\nitself is marked for translation, meaning we do not expect it to be\nmachine-readable.\n\nWhile we're touching that documentation, let's also update it for\ngrammar and clarity.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nI'm actually a little nervous that we _shouldn't_ have marked the\nmessages that fsck produces for translation (and nor should we change\nthem here, but then we're stuck with the word \"sha1\" forever).\n\nI actually think fsck ought to have a machine-readable output format,\nbut of course that does not help any existing scripts.\n\n Documentation/git-fsck.txt | 6 +++---\n object.c                   | 4 ++--\n sha1-file.c                | 4 ++--\n t/t1450-fsck.sh            | 2 +-\n 4 files changed, 8 insertions(+), 8 deletions(-)\n\ndiff --git a/Documentation/git-fsck.txt b/Documentation/git-fsck.txt\nindex ab9a93fb9b..55950d9eea 100644\n--- a/Documentation/git-fsck.txt\n+++ b/Documentation/git-fsck.txt\n@@ -140,9 +140,9 @@ dangling <type> <object>::\n \tThe <type> object <object>, is present in the database but never\n \t'directly' used. A dangling commit could be a root node.\n \n-sha1 mismatch <object>::\n-\tThe database has an object who's sha1 doesn't match the\n-\tdatabase value.\n+hash mismatch <object>::\n+\tThe database has an object whose hash doesn't match the\n+\tobject database value.\n \tThis indicates a serious data integrity problem.\n \n Environment Variables\ndiff --git a/object.c b/object.c\nindex a5c5cf830f..df72914bdc 100644\n--- a/object.c\n+++ b/object.c\n@@ -263,7 +263,7 @@ struct object *parse_object(struct repository *r, const struct object_id *oid)\n \t    (!obj && has_object_file(oid) &&\n \t     oid_object_info(r, oid, NULL) == OBJ_BLOB)) {\n \t\tif (check_object_signature(repl, NULL, 0, NULL) < 0) {\n-\t\t\terror(_(\"sha1 mismatch %s\"), oid_to_hex(oid));\n+\t\t\terror(_(\"hash mismatch %s\"), oid_to_hex(oid));\n \t\t\treturn NULL;\n \t\t}\n \t\tparse_blob_buffer(lookup_blob(r, oid), NULL, 0);\n@@ -274,7 +274,7 @@ struct object *parse_object(struct repository *r, const struct object_id *oid)\n \tif (buffer) {\n \t\tif (check_object_signature(repl, buffer, size, type_name(type)) < 0) {\n \t\t\tfree(buffer);\n-\t\t\terror(_(\"sha1 mismatch %s\"), oid_to_hex(repl));\n+\t\t\terror(_(\"hash mismatch %s\"), oid_to_hex(repl));\n \t\t\treturn NULL;\n \t\t}\n \ndiff --git a/sha1-file.c b/sha1-file.c\nindex 55a4782844..a5726c3e73 100644\n--- a/sha1-file.c\n+++ b/sha1-file.c\n@@ -2223,7 +2223,7 @@ static int check_stream_oid(git_zstream *stream,\n \n \tthe_hash_algo->final_fn(real_oid.hash, &c);\n \tif (!oideq(expected_oid, &real_oid)) {\n-\t\terror(_(\"sha1 mismatch for %s (expected %s)\"), path,\n+\t\terror(_(\"hash mismatch for %s (expected %s)\"), path,\n \t\t      oid_to_hex(expected_oid));\n \t\treturn -1;\n \t}\n@@ -2275,7 +2275,7 @@ int read_loose_object(const char *path,\n \t\t}\n \t\tif (check_object_signature(expected_oid, *contents,\n \t\t\t\t\t *size, type_name(*type))) {\n-\t\t\terror(_(\"sha1 mismatch for %s (expected %s)\"), path,\n+\t\t\terror(_(\"hash mismatch for %s (expected %s)\"), path,\n \t\t\t      oid_to_hex(expected_oid));\n \t\t\tfree(*contents);\n \t\t\tgoto out;\ndiff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh\nindex 2e5e979336..c61f972141 100755\n--- a/t/t1450-fsck.sh\n+++ b/t/t1450-fsck.sh\n@@ -406,7 +406,7 @@ test_expect_success 'rev-list --verify-objects with bad sha1' '\n \n \ttest_might_fail git rev-list --verify-objects refs/heads/bogus >/dev/null 2>out &&\n \tcat out &&\n-\ttest_i18ngrep -q \"error: sha1 mismatch 63ffffffffffffffffffffffffffffffffffffff\" out\n+\ttest_i18ngrep -q \"error: hash mismatch 63ffffffffffffffffffffffffffffffffffffff\" out\n '\n \n test_expect_success 'force fsck to ignore double author' '\n-- \n2.20.1.470.g640a3e2614\n"},{"id":"366248","messageId":"0797a920-32f3-aaaf-9321-528f78d980ae@iee.org","threadId":"50123","inReplyTo":"b87e7e01-baa6-6fb2-7081-0042ecd3b6b7@web.de","subject":"Re: [PATCH 1/3] object-store: factor out odb_loose_cache()","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2019-01-07T11:27:06Z","receivedAt":"2019-01-07T11:27:10Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"On 06/01/2019 16:45, René Scharfe wrote:\n> Add and use a function for loading the entries if a loose object\n> subdirectory for a given object ID.\n\nThe second part of the sentence 'a loose object subdirectory for a given \nobject ID' does not scan for me. Is there a word missing?\n\n>    It frees callers from deriving the\n> fanout key; they can use the returned oid_array reference for lookups or\n> forward range scans.\n>\n> Suggested-by: Jeff King<peff@peff.net>\n> Signed-off-by: Rene Scharfe<l.s.r@web.de>\n\n-- \n\nPhilip\n\n"},{"id":"366250","messageId":"20190107123012.GA6032@sigill.intra.peff.net","threadId":"50123","inReplyTo":"0797a920-32f3-aaaf-9321-528f78d980ae@iee.org","subject":"Re: [PATCH 1/3] object-store: factor out odb_loose_cache()","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-01-07T12:30:12Z","receivedAt":"2019-01-07T12:30:16Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Jan 07, 2019 at 11:27:06AM +0000, Philip Oakley wrote:\n\n> On 06/01/2019 16:45, René Scharfe wrote:\n> > Add and use a function for loading the entries if a loose object\n> > subdirectory for a given object ID.\n> \n> The second part of the sentence 'a loose object subdirectory for a given\n> object ID' does not scan for me. Is there a word missing?\n\nI think s/if/in/ ?\n\n-Peff\n"},{"id":"366253","messageId":"54fdfe9f-e3ec-411d-5b3c-f7f712bae5e7@web.de","threadId":"50123","inReplyTo":"20190107123012.GA6032@sigill.intra.peff.net","subject":"Re: [PATCH 1/3] object-store: factor out odb_loose_cache()","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2019-01-07T13:11:27Z","receivedAt":"2019-01-07T13:11:43Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 07.01.2019 um 13:30 schrieb Jeff King:\n> On Mon, Jan 07, 2019 at 11:27:06AM +0000, Philip Oakley wrote:\n> \n>> On 06/01/2019 16:45, René Scharfe wrote:\n>>> Add and use a function for loading the entries if a loose object\n>>> subdirectory for a given object ID.\n>>\n>> The second part of the sentence 'a loose object subdirectory for a given\n>> object ID' does not scan for me. Is there a word missing?\n> \n> I think s/if/in/ ?\n\nGood guess and close, but I think I meant s/if/of/.  Anyway, the idea is\nthat a caller provides an object ID and the function then reads the\ncorresponding object subdirectory.\n\nRené\n"},{"id":"366255","messageId":"4b9198d2-4994-6d26-74ee-e737ecc34af3@web.de","threadId":"50123","inReplyTo":"20190107082702.GB21362@sigill.intra.peff.net","subject":"Re: [PATCH 1/3] object-store: factor out odb_loose_cache()","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2019-01-07T13:26:34Z","receivedAt":"2019-01-07T13:26:51Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 07.01.2019 um 09:27 schrieb Jeff King:\n> On Sun, Jan 06, 2019 at 05:45:30PM +0100, René Scharfe wrote:\n>> diff --git a/object-store.h b/object-store.h\n>> index 60758efad8..7236c571c0 100644\n>> --- a/object-store.h\n>> +++ b/object-store.h\n>> @@ -54,6 +54,13 @@ void add_to_alternates_memory(const char *dir);\n>>   */\n>>  void odb_load_loose_cache(struct object_directory *odb, int subdir_nr);\n>>  \n>> +/*\n>> + * Populate and return the loose object cache array corresponding to the\n>> + * given object ID.\n>> + */\n>> +struct oid_array *odb_loose_cache(struct object_directory *odb,\n>> +\t\t\t\t  const struct object_id *oid);\n>> +\n> \n> I think the ugly-interfaced odb_load_loose_cache() can become \"static\"\n> now, as the only outside caller (from sha1-name.c) has gone away.\n> \n>> +struct oid_array *odb_loose_cache(struct object_directory *odb,\n>> +\t\t\t\t  const struct object_id *oid)\n>> +{\n>> +\tint subdir_nr = oid->hash[0];\n>> +\todb_load_loose_cache(odb, subdir_nr);\n>> +\treturn &odb->loose_objects_cache;\n>> +}\n>> +\n>>  void odb_load_loose_cache(struct object_directory *odb, int subdir_nr)\n> \n> You'd need to re-order these definitions, of course (or alternatively,\n> just fold the load function inline into odb_loose_cache()).\n\nYes, the functions are arranged so that odb_load_loose_cache() can be\ninlined easily.  I meant to include a patch for that but then quibbled\nabout keeping the BUG check (which is probably optimized out) or not,\nand dropped it for now to get the performance fix in more quickly..\n\nRené\n"},{"id":"366265","messageId":"CABPp-BFPSMD1CTsw2aT9586jRoZdGKL=hqMoSqAz_A7LPSfP4A@mail.gmail.com","threadId":"50123","inReplyTo":"nycvar.QRO.7.76.6.1901031424340.45@tvgsbejvaqbjf.bet","subject":"Re: What's cooking in git.git (Dec 2018, #02; Fri, 28)","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2019-01-07T17:13:59Z","receivedAt":"2019-01-07T17:14:14Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Hi Dscho,\n\nOn Thu, Jan 3, 2019 at 5:27 AM Johannes Schindelin\n<Johannes.Schindelin@gmx.de> wrote:\n>\n> Hi Elijah,\n>\n...\n> > I was going to re-ping in early January.  Anyway, it may be worth at\n> > least updating your note to \"reroll exists\".\n>\n> It is early January! ;-)\n\nIndeed...ping incoming.  :-)\n\n>\n> Ciao,\n> Dscho\n"},{"id":"366269","messageId":"a836870b-c803-5ff4-0019-58012773efb7@web.de","threadId":"50123","inReplyTo":"3512c798-aa42-6fba-ee82-d33a8985be91@web.de","subject":"[PATCH 4/3] object-store: retire odb_load_loose_cache()","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2019-01-07T17:29:16Z","receivedAt":"2019-01-07T17:29:34Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Inline odb_load_loose_cache() into its only remaining caller,\nodb_loose_cache().  The latter offers a nicer interface for loading the\ncache, as it doesn't require callers to deal with fanout directory\nnumbers directly.\n\nSigned-off-by: Rene Scharfe <l.s.r@web.de>\n---\n object-store.h | 7 -------\n sha1-file.c    | 9 ++-------\n 2 files changed, 2 insertions(+), 14 deletions(-)\n\ndiff --git a/object-store.h b/object-store.h\nindex 2fb6c0e4db..e16aa38cae 100644\n--- a/object-store.h\n+++ b/object-store.h\n@@ -47,13 +47,6 @@ void add_to_alternates_file(const char *dir);\n  */\n void add_to_alternates_memory(const char *dir);\n \n-/*\n- * Populate an odb's loose object cache for one particular subdirectory (i.e.,\n- * the one that corresponds to the first byte of objects you're interested in,\n- * from 0 to 255 inclusive).\n- */\n-void odb_load_loose_cache(struct object_directory *odb, int subdir_nr);\n-\n /*\n  * Populate and return the loose object cache array corresponding to the\n  * given object ID.\ndiff --git a/sha1-file.c b/sha1-file.c\nindex c3c6e50704..efcb2cbe74 100644\n--- a/sha1-file.c\n+++ b/sha1-file.c\n@@ -2154,12 +2154,6 @@ struct oid_array *odb_loose_cache(struct object_directory *odb,\n \t\t\t\t  const struct object_id *oid)\n {\n \tint subdir_nr = oid->hash[0];\n-\todb_load_loose_cache(odb, subdir_nr);\n-\treturn &odb->loose_objects_cache[subdir_nr];\n-}\n-\n-void odb_load_loose_cache(struct object_directory *odb, int subdir_nr)\n-{\n \tstruct strbuf buf = STRBUF_INIT;\n \n \tif (subdir_nr < 0 ||\n@@ -2167,7 +2161,7 @@ void odb_load_loose_cache(struct object_directory *odb, int subdir_nr)\n \t\tBUG(\"subdir_nr out of range\");\n \n \tif (odb->loose_objects_subdir_seen[subdir_nr])\n-\t\treturn;\n+\t\treturn &odb->loose_objects_cache[subdir_nr];\n \n \tstrbuf_addstr(&buf, odb->path);\n \tfor_each_file_in_obj_subdir(subdir_nr, &buf,\n@@ -2176,6 +2170,7 @@ void odb_load_loose_cache(struct object_directory *odb, int subdir_nr)\n \t\t\t\t    &odb->loose_objects_cache[subdir_nr]);\n \todb->loose_objects_subdir_seen[subdir_nr] = 1;\n \tstrbuf_release(&buf);\n+\treturn &odb->loose_objects_cache[subdir_nr];\n }\n \n void odb_clear_loose_cache(struct object_directory *odb)\n-- \n2.20.1\n"},{"id":"366270","messageId":"dd0504df-618a-e27b-ccc4-a6a316cd965e@web.de","threadId":"50123","inReplyTo":"4b9198d2-4994-6d26-74ee-e737ecc34af3@web.de","subject":"Re: [PATCH 1/3] object-store: factor out odb_loose_cache()","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2019-01-07T17:29:25Z","receivedAt":"2019-01-07T17:29:39Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 07.01.2019 um 14:26 schrieb René Scharfe:\n> Yes, the functions are arranged so that odb_load_loose_cache() can be\n> inlined easily.  I meant to include a patch for that but then quibbled\n> about keeping the BUG check (which is probably optimized out) or not,\n> and dropped it for now to get the performance fix in more quickly..\n\n... which is probably just my laziness talking.  Sent a minimal patch\nfor that now.\n\nRené\n"},{"id":"366278","messageId":"xmqqo98s8dwv.fsf@gitster-ct.c.googlers.com","threadId":"50123","inReplyTo":"3512c798-aa42-6fba-ee82-d33a8985be91@web.de","subject":"Re: jk/loose-object-cache","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-01-07T19:29:20Z","receivedAt":"2019-01-07T19:29:26Z","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 28.12.2018 um 19:04 schrieb Junio C Hamano:\n>> * jk/loose-object-cache (2018-11-24) 10 commits\n> ...\n> So this has hit master in the meantime.  We discussed a sort performance\n> fix in [1]; I'll reply with a short series containing a cleaned-up and\n> rebased version as a follow-up.\n\nThanks.\n\n-- >8 --\nSubject: [PATCH 4/3] sha1-file.c: make odb_load_loose_cache() static\n\nNow there is only a single internal caller to this helper function\nthat knows the implementation detail of the cache too much, hide it\nfrom outside world by making it static.\n\nSuggested-by: Jeff King <peff@peff.net>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n object-store.h |  7 -------\n sha1-file.c    | 24 +++++++++++++++---------\n 2 files changed, 15 insertions(+), 16 deletions(-)\n\ndiff --git a/object-store.h b/object-store.h\nindex 2fb6c0e4db..e16aa38cae 100644\n--- a/object-store.h\n+++ b/object-store.h\n@@ -47,13 +47,6 @@ void add_to_alternates_file(const char *dir);\n  */\n void add_to_alternates_memory(const char *dir);\n \n-/*\n- * Populate an odb's loose object cache for one particular subdirectory (i.e.,\n- * the one that corresponds to the first byte of objects you're interested in,\n- * from 0 to 255 inclusive).\n- */\n-void odb_load_loose_cache(struct object_directory *odb, int subdir_nr);\n-\n /*\n  * Populate and return the loose object cache array corresponding to the\n  * given object ID.\ndiff --git a/sha1-file.c b/sha1-file.c\nindex 2adc56cde4..936d216ad4 100644\n--- a/sha1-file.c\n+++ b/sha1-file.c\n@@ -2150,15 +2150,12 @@ static int append_loose_object(const struct object_id *oid, const char *path,\n \treturn 0;\n }\n \n-struct oid_array *odb_loose_cache(struct object_directory *odb,\n-\t\t\t\t  const struct object_id *oid)\n-{\n-\tint subdir_nr = oid->hash[0];\n-\todb_load_loose_cache(odb, subdir_nr);\n-\treturn &odb->loose_objects_cache[subdir_nr];\n-}\n-\n-void odb_load_loose_cache(struct object_directory *odb, int subdir_nr)\n+/*\n+ * Populate an odb's loose object cache for one particular subdirectory (i.e.,\n+ * the one that corresponds to the first byte of objects you're interested in,\n+ * from 0 to 255 inclusive).\n+ */\n+static void odb_load_loose_cache(struct object_directory *odb, int subdir_nr)\n {\n \tstruct strbuf buf = STRBUF_INIT;\n \n@@ -2178,6 +2175,15 @@ void odb_load_loose_cache(struct object_directory *odb, int subdir_nr)\n \tstrbuf_release(&buf);\n }\n \n+struct oid_array *odb_loose_cache(struct object_directory *odb,\n+\t\t\t\t  const struct object_id *oid)\n+{\n+\tint subdir_nr = oid->hash[0];\n+\todb_load_loose_cache(odb, subdir_nr);\n+\treturn &odb->loose_objects_cache[subdir_nr];\n+}\n+\n+\n void odb_clear_loose_cache(struct object_directory *odb)\n {\n \tint i;\n"},{"id":"366280","messageId":"xmqqd0p88drp.fsf@gitster-ct.c.googlers.com","threadId":"50123","inReplyTo":"a836870b-c803-5ff4-0019-58012773efb7@web.de","subject":"Re: [PATCH 4/3] object-store: retire odb_load_loose_cache()","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-01-07T19:32:26Z","receivedAt":"2019-01-07T19:32:33Z","isPatch":true,"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> Inline odb_load_loose_cache() into its only remaining caller,\n> odb_loose_cache().  The latter offers a nicer interface for loading the\n> cache, as it doesn't require callers to deal with fanout directory\n> numbers directly.\n>\n> Signed-off-by: Rene Scharfe <l.s.r@web.de>\n> ---\n\nOK, that's much better ;-)  Thanks.\n\n>  object-store.h | 7 -------\n>  sha1-file.c    | 9 ++-------\n>  2 files changed, 2 insertions(+), 14 deletions(-)\n>\n> diff --git a/object-store.h b/object-store.h\n> index 2fb6c0e4db..e16aa38cae 100644\n> --- a/object-store.h\n> +++ b/object-store.h\n> @@ -47,13 +47,6 @@ void add_to_alternates_file(const char *dir);\n>   */\n>  void add_to_alternates_memory(const char *dir);\n>  \n> -/*\n> - * Populate an odb's loose object cache for one particular subdirectory (i.e.,\n> - * the one that corresponds to the first byte of objects you're interested in,\n> - * from 0 to 255 inclusive).\n> - */\n> -void odb_load_loose_cache(struct object_directory *odb, int subdir_nr);\n> -\n>  /*\n>   * Populate and return the loose object cache array corresponding to the\n>   * given object ID.\n> diff --git a/sha1-file.c b/sha1-file.c\n> index c3c6e50704..efcb2cbe74 100644\n> --- a/sha1-file.c\n> +++ b/sha1-file.c\n> @@ -2154,12 +2154,6 @@ struct oid_array *odb_loose_cache(struct object_directory *odb,\n>  \t\t\t\t  const struct object_id *oid)\n>  {\n>  \tint subdir_nr = oid->hash[0];\n> -\todb_load_loose_cache(odb, subdir_nr);\n> -\treturn &odb->loose_objects_cache[subdir_nr];\n> -}\n> -\n> -void odb_load_loose_cache(struct object_directory *odb, int subdir_nr)\n> -{\n>  \tstruct strbuf buf = STRBUF_INIT;\n>  \n>  \tif (subdir_nr < 0 ||\n> @@ -2167,7 +2161,7 @@ void odb_load_loose_cache(struct object_directory *odb, int subdir_nr)\n>  \t\tBUG(\"subdir_nr out of range\");\n>  \n>  \tif (odb->loose_objects_subdir_seen[subdir_nr])\n> -\t\treturn;\n> +\t\treturn &odb->loose_objects_cache[subdir_nr];\n>  \n>  \tstrbuf_addstr(&buf, odb->path);\n>  \tfor_each_file_in_obj_subdir(subdir_nr, &buf,\n> @@ -2176,6 +2170,7 @@ void odb_load_loose_cache(struct object_directory *odb, int subdir_nr)\n>  \t\t\t\t    &odb->loose_objects_cache[subdir_nr]);\n>  \todb->loose_objects_subdir_seen[subdir_nr] = 1;\n>  \tstrbuf_release(&buf);\n> +\treturn &odb->loose_objects_cache[subdir_nr];\n>  }\n>  \n>  void odb_clear_loose_cache(struct object_directory *odb)\n"},{"id":"366336","messageId":"b0049722-d019-fd5d-d93d-7b7363b4f244@web.de","threadId":"50123","inReplyTo":"20190107083150.GC21362@sigill.intra.peff.net","subject":"Re: [PATCH 0/11] jk/loose-object-cache sha1/object_id fixups","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2019-01-08T16:40:06Z","receivedAt":"2019-01-08T16:40:27Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 07.01.2019 um 09:31 schrieb Jeff King:\n> I also cleaned up my sha1/object_id patch and rebased it on top of what\n> you have here. Though as I worked on it, it expanded in scope a bit.\n> Possibly it should be a separate series entirely, but that would create\n> some annoying textual conflicts on merge.\n> \n>   [01/11]: sha1-file: fix outdated sha1 comment references\n>   [02/11]: update comment references to sha1_object_info()\n>   [03/11]: http: use struct object_id instead of bare sha1\n>   [04/11]: sha1-file: modernize loose object file functions\n>   [05/11]: sha1-file: modernize loose header/stream functions\n>   [06/11]: sha1-file: convert pass-through functions to object_id\n>   [07/11]: convert has_sha1_file() callers to has_object_file()\n>   [08/11]: sha1-file: drop has_sha1_file()\n>   [09/11]: sha1-file: prefer \"loose object file\" to \"sha1 file\" in messages\n>   [10/11]: sha1-file: avoid \"sha1 file\" for generic use in messages\n>   [11/11]: prefer \"hash mismatch\" to \"sha1 mismatch\"\n\nI skimmed them; they look good to me.  6 and 8 are particularly\nsatisfying; getting rid of hash copy operations just feels nice. :)\n\nJunio only took 1 to 5 into pu; 6, 7 and its sidekick 8, 10 and 11\nconflict with sb/more-repo-in-api; 9 could go in unmodified.\n\nRené\n"},{"id":"366344","messageId":"xmqqy37v59qz.fsf@gitster-ct.c.googlers.com","threadId":"50123","inReplyTo":"b0049722-d019-fd5d-d93d-7b7363b4f244@web.de","subject":"Re: [PATCH 0/11] jk/loose-object-cache sha1/object_id fixups","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-01-08T17:39:48Z","receivedAt":"2019-01-08T17:39:54Z","isPatch":true,"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 07.01.2019 um 09:31 schrieb Jeff King:\n>> I also cleaned up my sha1/object_id patch and rebased it on top of what\n>> you have here. Though as I worked on it, it expanded in scope a bit.\n>> Possibly it should be a separate series entirely, but that would create\n>> some annoying textual conflicts on merge.\n>> \n>>   [01/11]: sha1-file: fix outdated sha1 comment references\n>>   [02/11]: update comment references to sha1_object_info()\n>>   [03/11]: http: use struct object_id instead of bare sha1\n>>   [04/11]: sha1-file: modernize loose object file functions\n>>   [05/11]: sha1-file: modernize loose header/stream functions\n>>   [06/11]: sha1-file: convert pass-through functions to object_id\n>>   [07/11]: convert has_sha1_file() callers to has_object_file()\n>>   [08/11]: sha1-file: drop has_sha1_file()\n>>   [09/11]: sha1-file: prefer \"loose object file\" to \"sha1 file\" in messages\n>>   [10/11]: sha1-file: avoid \"sha1 file\" for generic use in messages\n>>   [11/11]: prefer \"hash mismatch\" to \"sha1 mismatch\"\n>\n> I skimmed them; they look good to me.  6 and 8 are particularly\n> satisfying; getting rid of hash copy operations just feels nice. :)\n>\n> Junio only took 1 to 5 into pu; 6, 7 and its sidekick 8, 10 and 11\n> conflict with sb/more-repo-in-api; 9 could go in unmodified.\n\nI think these later steps are based on something a lot newer than\nthe result of applying your updates to the jk/loose-object-cache\nseries they fix.  I think I untangled and backported one of the\nearlier commits but then I stopped after 05/11.\n\nI do not think it is important to keep jk/loose-object-cache and\nthese two follow-up topics mergeable to the maintenance track, so\nI'll see if the patches behave better if queued directly on top of\n3b2f8a02 (\"Merge branch 'jk/loose-object-cache'\", 2019-01-04), or\neven a yet newer random point on 'master'.\n\nThanks.\n\n\n"},{"id":"366349","messageId":"20190108180522.GA4610@sigill.intra.peff.net","threadId":"50123","inReplyTo":"xmqqy37v59qz.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH 0/11] jk/loose-object-cache sha1/object_id fixups","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-01-08T18:05:22Z","receivedAt":"2019-01-08T18:05:25Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Jan 08, 2019 at 09:39:48AM -0800, Junio C Hamano wrote:\n\n> > I skimmed them; they look good to me.  6 and 8 are particularly\n> > satisfying; getting rid of hash copy operations just feels nice. :)\n> >\n> > Junio only took 1 to 5 into pu; 6, 7 and its sidekick 8, 10 and 11\n> > conflict with sb/more-repo-in-api; 9 could go in unmodified.\n> \n> I think these later steps are based on something a lot newer than\n> the result of applying your updates to the jk/loose-object-cache\n> series they fix.  I think I untangled and backported one of the\n> earlier commits but then I stopped after 05/11.\n\nSorry, I applied René's patches on top of master and then built on that,\ntreating it like a new topic. But of course your jk/loose-object-cache\nis older.\n\n> I do not think it is important to keep jk/loose-object-cache and\n> these two follow-up topics mergeable to the maintenance track, so\n> I'll see if the patches behave better if queued directly on top of\n> 3b2f8a02 (\"Merge branch 'jk/loose-object-cache'\", 2019-01-04), or\n> even a yet newer random point on 'master'.\n\nYeah, they should. I think one of them will need René's patch, which\nchanges the body of quick_has_loose(). I can roll it as a separate topic\nif that's easier (or just wait a week or so until René's cleanups\ngraduate).\n\n-Peff\n"},{"id":"366350","messageId":"xmqqmuob58gu.fsf@gitster-ct.c.googlers.com","threadId":"50123","inReplyTo":"20190108180522.GA4610@sigill.intra.peff.net","subject":"Re: [PATCH 0/11] jk/loose-object-cache sha1/object_id fixups","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-01-08T18:07:29Z","receivedAt":"2019-01-08T18:07:33Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> Yeah, they should. I think one of them will need René's patch, which\n> changes the body of quick_has_loose(). I can roll it as a separate topic\n> if that's easier (or just wait a week or so until René's cleanups\n> graduate).\n\nNah, what I got is already good to work with.  Both series are\nstraight-forward and I do not expect them needing long fermentation.\n\n"},{"id":"366353","messageId":"27ac5d02-e2a5-9d1d-9974-8ca740efa978@gmail.com","threadId":"50123","inReplyTo":"xmqqmuob58gu.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH 0/11] jk/loose-object-cache sha1/object_id fixups","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2019-01-08T18:27:55Z","receivedAt":"2019-01-08T18:27:58Z","isPatch":true,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 1/8/2019 1:07 PM, Junio C Hamano wrote:\n> Jeff King <peff@peff.net> writes:\n>\n>> Yeah, they should. I think one of them will need René's patch, which\n>> changes the body of quick_has_loose(). I can roll it as a separate topic\n>> if that's easier (or just wait a week or so until René's cleanups\n>> graduate).\n> Nah, what I got is already good to work with.  Both series are\n> straight-forward and I do not expect them needing long fermentation.\n\nI'm just chiming in to say that this series was a very satisfying read, \nand the changes were clear-cut and mechanical.\n\nThanks!\n-Stolee\n"},{"id":"366356","messageId":"xmqq8szv56e4.fsf@gitster-ct.c.googlers.com","threadId":"50123","inReplyTo":"xmqqmuob58gu.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH 0/11] jk/loose-object-cache sha1/object_id fixups","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-01-08T18:52:19Z","receivedAt":"2019-01-08T18:52:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Jeff King <peff@peff.net> writes:\n>\n>> Yeah, they should. I think one of them will need René's patch, which\n>> changes the body of quick_has_loose(). I can roll it as a separate topic\n>> if that's easier (or just wait a week or so until René's cleanups\n>> graduate).\n>\n> Nah, what I got is already good to work with.  Both series are\n> straight-forward and I do not expect them needing long fermentation.\n\nYikes, the conflicts with sb/more-repo-in-api is quite irritating.\nI think I'll postpone the later parts of this series and ask this to\nbe sent after sb/more-repo-in-api matures a bit mroe.\n\n"},{"id":"366366","messageId":"20190108211632.GB22946@sigill.intra.peff.net","threadId":"50123","inReplyTo":"xmqq8szv56e4.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH 0/11] jk/loose-object-cache sha1/object_id fixups","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-01-08T21:16:32Z","receivedAt":"2019-01-08T21:16:35Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Jan 08, 2019 at 10:52:19AM -0800, Junio C Hamano wrote:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n> \n> > Jeff King <peff@peff.net> writes:\n> >\n> >> Yeah, they should. I think one of them will need René's patch, which\n> >> changes the body of quick_has_loose(). I can roll it as a separate topic\n> >> if that's easier (or just wait a week or so until René's cleanups\n> >> graduate).\n> >\n> > Nah, what I got is already good to work with.  Both series are\n> > straight-forward and I do not expect them needing long fermentation.\n> \n> Yikes, the conflicts with sb/more-repo-in-api is quite irritating.\n> I think I'll postpone the later parts of this series and ask this to\n> be sent after sb/more-repo-in-api matures a bit mroe.\n\nThere were several conflicts, but it was mostly just tedious textual\nfixups. I pushed the result to:\n\n  https://github.com/peff/git.git resolve-oid-more-repo\n\nBut I'm happy to wait and rebase if sb/more-repo-in-api is close to\ngraduating.\n\n-Peff\n"},{"id":"366452","messageId":"CAGZ79kZzg4_=Go+6btvyygzXOdEJ7VHwNmP+BDqedv+8hqdhCw@mail.gmail.com","threadId":"50123","inReplyTo":"20190108211632.GB22946@sigill.intra.peff.net","subject":"Re: [PATCH 0/11] jk/loose-object-cache sha1/object_id fixups","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2019-01-09T21:37:34Z","receivedAt":"2019-01-09T21:37:55Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"> > Yikes, the conflicts with sb/more-repo-in-api is quite irritating.\n> > I think I'll postpone the later parts of this series and ask this to\n> > be sent after sb/more-repo-in-api matures a bit mroe.\n>\n> There were several conflicts, but it was mostly just tedious textual\n> fixups. I pushed the result to:\n>\n>   https://github.com/peff/git.git resolve-oid-more-repo\n>\n> But I'm happy to wait and rebase if sb/more-repo-in-api is close to\n> graduating.\n\nThe merge looks good to me, though I just looked quickly.\nThe series itself is also a pleasant read.\n\nStefan\n"},{"id":"366457","messageId":"CAGZ79kY81WapxeDzytz1vva_j48TDg9vOXrDwkr9uYDx4H-FFA@mail.gmail.com","threadId":"50123","inReplyTo":"CAGZ79kZzg4_=Go+6btvyygzXOdEJ7VHwNmP+BDqedv+8hqdhCw@mail.gmail.com","subject":"Re: [PATCH 0/11] jk/loose-object-cache sha1/object_id fixups","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2019-01-09T22:42:28Z","receivedAt":"2019-01-09T22:42:43Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Wed, Jan 9, 2019 at 1:37 PM Stefan Beller <sbeller@google.com> wrote:\n>\n> > > Yikes, the conflicts with sb/more-repo-in-api is quite irritating.\n> > > I think I'll postpone the later parts of this series and ask this to\n> > > be sent after sb/more-repo-in-api matures a bit mroe.\n> >\n> > There were several conflicts, but it was mostly just tedious textual\n> > fixups. I pushed the result to:\n> >\n> >   https://github.com/peff/git.git resolve-oid-more-repo\n> >\n> > But I'm happy to wait and rebase if sb/more-repo-in-api is close to\n> > graduating.\n>\n> The merge looks good to me, though I just looked quickly.\n> The series itself is also a pleasant read.\n\nCompiling this leads to:\n\nsha1-file.c:1424:33: error: incompatible pointer types passing 'const\nstruct object_id *' to parameter of type 'const unsigned char *'\n[-Werror,-Wincompatible-pointer-types]\n        if ((p = has_packed_and_bad(r, repl)) != NULL)\n                                       ^~~~\n./packfile.h:149:95: note: passing argument to parameter 'sha1' here\nextern const struct packed_git *has_packed_and_bad(struct repository\n*r, const unsigned char *sha1);\n"},{"id":"366480","messageId":"20190110061737.GA28000@sigill.intra.peff.net","threadId":"50123","inReplyTo":"CAGZ79kY81WapxeDzytz1vva_j48TDg9vOXrDwkr9uYDx4H-FFA@mail.gmail.com","subject":"Re: [PATCH 0/11] jk/loose-object-cache sha1/object_id fixups","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-01-10T06:17:37Z","receivedAt":"2019-01-10T06:17:40Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Jan 09, 2019 at 02:42:28PM -0800, Stefan Beller wrote:\n\n> On Wed, Jan 9, 2019 at 1:37 PM Stefan Beller <sbeller@google.com> wrote:\n> >\n> > > > Yikes, the conflicts with sb/more-repo-in-api is quite irritating.\n> > > > I think I'll postpone the later parts of this series and ask this to\n> > > > be sent after sb/more-repo-in-api matures a bit mroe.\n> > >\n> > > There were several conflicts, but it was mostly just tedious textual\n> > > fixups. I pushed the result to:\n> > >\n> > >   https://github.com/peff/git.git resolve-oid-more-repo\n> > >\n> > > But I'm happy to wait and rebase if sb/more-repo-in-api is close to\n> > > graduating.\n> >\n> > The merge looks good to me, though I just looked quickly.\n> > The series itself is also a pleasant read.\n> \n> Compiling this leads to:\n> \n> sha1-file.c:1424:33: error: incompatible pointer types passing 'const\n> struct object_id *' to parameter of type 'const unsigned char *'\n> [-Werror,-Wincompatible-pointer-types]\n>         if ((p = has_packed_and_bad(r, repl)) != NULL)\n>                                        ^~~~\n> ./packfile.h:149:95: note: passing argument to parameter 'sha1' here\n> extern const struct packed_git *has_packed_and_bad(struct repository\n> *r, const unsigned char *sha1);\n\nEek, sorry about that. I did the merge on a detached HEAD, and my\nconfig.mak relaxes compilation warnings in that case (since I am often\nsight-seeing to old versions that have warnings which have since been\nfixed). And the result passes the tests since \"repl\" and \"repl->hash\"\nare effectively the same pointer.\n\nI've pushed up the fix (s/repl/repl->hash/). Thanks for noticing.\n\n-Peff\n"}]}