{"push_id":2886635466,"size":200,"distinct_size":8,"ref":"refs/heads/remerge-diff","head":"749a3ad3d0e31709987a8d788e81c5b12e591e20","before":"6490d1d665dbd3b2388b5522a56a608c288d5a64","commits":[{"sha":"f447a499dbb8be3a9f76f8099938129c74fcbd32","author":{"name":"Matthew DeVore","email":"383067055a30849a4b860c77c3257d09c1beb6e6@google.com"},"message":"list-objects: store common func args in struct\n\nThis will make utility functions easier to create, as done by the next\npatch.\n\nSigned-off-by: Matthew DeVore <matvore@google.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/mjg/git/commits/f447a499dbb8be3a9f76f8099938129c74fcbd32"},{"sha":"9202489174a110f82867edbac601f12480a4e284","author":{"name":"Matthew DeVore","email":"383067055a30849a4b860c77c3257d09c1beb6e6@google.com"},"message":"list-objects: refactor to process_tree_contents\n\nThis will be used in a follow-up patch to reduce indentation needed when\ninvoking the logic conditionally. i.e. rather than:\n\nif (foo) {\n\twhile (...) {\n\t\t/* this is very indented */\n\t}\n}\n\nwe will have:\n\nif (foo)\n\tprocess_tree_contents(...);\n\nSigned-off-by: Matthew DeVore <matvore@google.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/mjg/git/commits/9202489174a110f82867edbac601f12480a4e284"},{"sha":"f1d02daacfe657fd175634174b4928a645d537f4","author":{"name":"Matthew DeVore","email":"383067055a30849a4b860c77c3257d09c1beb6e6@google.com"},"message":"list-objects: always parse trees gently\n\nIf parsing fails when revs->ignore_missing_links and\nrevs->exclude_promisor_objects are both false, we print the OID anyway\nin the die(\"bad tree object...\") call, so any message printed by\nparse_tree_gently() is superfluous.\n\nSigned-off-by: Matthew DeVore <matvore@google.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/mjg/git/commits/f1d02daacfe657fd175634174b4928a645d537f4"},{"sha":"859fdc0c3cf9ad8cdd5eacaa24aee481bc1e7bc1","author":{"name":"Derrick Stolee","email":"ee0b68d4428a726bf8f65d5915bcba7139f7e5c7@microsoft.com"},"message":"commit-graph: define GIT_TEST_COMMIT_GRAPH\n\nThe commit-graph feature is tested in isolation by\nt5318-commit-graph.sh and t6600-test-reach.sh, but there are many\nmore interesting scenarios involving commit walks. Many of these\nscenarios are covered by the existing test suite, but we need to\nmaintain coverage when the optional commit-graph structure is not\npresent.\n\nTo allow running the full test suite with the commit-graph present,\nadd a new test environment variable, GIT_TEST_COMMIT_GRAPH. Similar\nto GIT_TEST_SPLIT_INDEX, this variable makes every Git command try\nto load the commit-graph when parsing commits, and writes the\ncommit-graph file after every 'git commit' command.\n\nThere are a few tests that rely on commits not existing in\npack-files to trigger important events, so manually set\nGIT_TEST_COMMIT_GRAPH to false for the necessary commands.\n\nThere is one test in t6024-recursive-merge.sh that relies on the\nmerge-base algorithm picking one of two ambiguous merge-bases, and\nthe commit-graph feature changes which merge-base is picked.\n\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Derrick Stolee <dstolee@microsoft.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/mjg/git/commits/859fdc0c3cf9ad8cdd5eacaa24aee481bc1e7bc1"},{"sha":"4c5fa9e6c4091eea9d8df3466b18ddb2812cd934","author":{"name":"Eric Sunshine","email":"8d6e34f987851aa599257d3831a1af040886842f@sunshineco.com"},"message":"worktree: don't die() in library function find_worktree()\n\nCallers don't expect library function find_worktree() to die(); they\nexpect it to return the named worktree if found, or NULL if not.\nAlthough find_worktree() itself never invokes die(), it calls\nreal_pathdup() with 'die_on_error' incorrectly set to 'true', thus will\ndie() indirectly if the user-provided path is not to real_pathdup()'s\nliking. This can be observed, for instance, with any git-worktree\ncommand which searches for an existing worktree:\n\n    $ git worktree unlock foo\n    fatal: 'foo' is not a working tree\n    $ git worktree unlock foo/bar\n    fatal: Invalid path '.../foo': No such file or directory\n\nThe first error message is the expected one from \"git worktree unlock\"\nnot finding the specified worktree; the second is from find_worktree()\ninvoking real_pathdup() incorrectly and die()ing prematurely.\n\nAside from the inconsistent error message between the two cases, this\nbug hasn't otherwise been a serious problem since existing callers all\ndie() anyhow when the worktree can't be found. However, that may not be\ntrue of callers added in the future, so fix find_worktree() to avoid\ndie()ing.\n\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/mjg/git/commits/4c5fa9e6c4091eea9d8df3466b18ddb2812cd934"},{"sha":"e5353bef550d91655b3f8fb443a26c0ba209153f","author":{"name":"Eric Sunshine","email":"8d6e34f987851aa599257d3831a1af040886842f@sunshineco.com"},"message":"worktree: move delete_git_dir() earlier in file for upcoming new callers\n\nThis is a pure code movement to avoid having to forward-declare the\nfunction when new callers are subsequently added.\n\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/mjg/git/commits/e5353bef550d91655b3f8fb443a26c0ba209153f"},{"sha":"602aaed03f7f82323d88703d6fa2263a13c37907","author":{"name":"Eric Sunshine","email":"8d6e34f987851aa599257d3831a1af040886842f@sunshineco.com"},"message":"worktree: generalize delete_git_dir() to reduce code duplication\n\nprune_worktrees() and delete_git_dir() both remove worktree\nadministrative entries from .git/worktrees, and their implementations\nare nearly identical. The only difference is that prune_worktrees() is\nalso capable of removing a bogus non-worktree-related file from\n.git/worktrees.\n\nSimplify by extending delete_git_dir() to handle the little bit of\nextra functionality needed by prune_worktrees(), and drop the\neffectively duplicate code from the latter.\n\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/mjg/git/commits/602aaed03f7f82323d88703d6fa2263a13c37907"},{"sha":"45059e6468ab5710748c8827d5bf1f4c7c69d6d1","author":{"name":"Eric Sunshine","email":"8d6e34f987851aa599257d3831a1af040886842f@sunshineco.com"},"message":"worktree: prepare for more checks of whether path can become worktree\n\nCertain conditions must be met for a path to be a valid candidate as the\nlocation of a new worktree; for instance, the path must not exist or\nmust be an empty directory. Although the number of conditions is small,\nnew conditions will soon be added so factor out the existing checks into\na separate function to avoid further bloating add_worktree().\n\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/mjg/git/commits/45059e6468ab5710748c8827d5bf1f4c7c69d6d1"},{"sha":"cb56f55c16c128e18449c9417dc045f787c1b663","author":{"name":"Eric Sunshine","email":"8d6e34f987851aa599257d3831a1af040886842f@sunshineco.com"},"message":"worktree: disallow adding same path multiple times\n\nA given path should only ever be associated with a single registered\nworktree. This invariant is enforced by refusing to create a new\nworktree at a given path if that path already exists. For example:\n\n    $ git worktree add -q --detach foo\n    $ git worktree add -q --detach foo\n    fatal: 'foo' already exists\n\nHowever, the check can be fooled, and the invariant broken, if the\npath is missing. Continuing the example:\n\n    $ rm -fr foo\n    $ git worktree add -q --detach foo\n    $ git worktree list\n    ...      eadebfe [master]\n    .../foo  eadebfe (detached HEAD)\n    .../foo  eadebfe (detached HEAD)\n\nThis \"corruption\" leads to the unfortunate situation in which the\nworktree can not be removed:\n\n    $ git worktree remove foo\n    fatal: validation failed, cannot remove working tree: '.../foo'\n    does not point back to '.git/worktrees/foo'\n\nNor can the bogus entry be pruned:\n\n    $ git worktree prune -v\n    $ git worktree list\n    ...      eadebfe [master]\n    .../foo  eadebfe (detached HEAD)\n    .../foo  eadebfe (detached HEAD)\n\nwithout first deleting the worktree directory manually:\n\n    $ rm -fr foo\n    $ git worktree prune -v\n    Removing .../foo: gitdir file points to non-existent location\n    Removing .../foo1: gitdir file points to non-existent location\n    $ git worktree list\n    ...  eadebfe [master]\n\nor by manually deleting the worktree entry in .git/worktrees.\n\nTo address this problem, upgrade \"git worktree add\" validation to\nallow worktree creation only if the given path is not already\nassociated with an existing worktree (even if the path itself is\nnon-existent), thus preventing such bogus worktree entries from being\ncreated in the first place.\n\nReported-by: Jeff King <peff@peff.net>\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/mjg/git/commits/cb56f55c16c128e18449c9417dc045f787c1b663"},{"sha":"e19831c94f91fd410fe001c0372b9c88b40d335b","author":{"name":"Eric Sunshine","email":"8d6e34f987851aa599257d3831a1af040886842f@sunshineco.com"},"message":"worktree: teach 'add' to respect --force for registered but missing path\n\nFor safety, \"git worktree add <path>\" will refuse to add a new\nworktree at <path> if <path> is already associated with a worktree\nentry, even if <path> is missing (for instance, has been deleted or\nresides on non-mounted removable media or network share). The typical\nway to re-create a worktree at <path> in such a situation is either to\nprune all \"broken\" entries (\"git worktree prune\") or to selectively\nremove the worktree entry manually (\"git worktree remove <path>\").\n\nHowever, neither of these approaches (\"prune\" nor \"remove\") is\nespecially convenient, and they may be unsuitable for scripting when a\ntool merely wants to re-use a worktree if it exists or create it from\nscratch if it doesn't (much as a tool might use \"mkdir -p\" to re-use\nor create a directory).\n\nTherefore, teach 'add' to respect --force as a convenient way to\nre-use a path already associated with a worktree entry if the path is\nnon-existent. For a locked worktree, require --force to be specified\ntwice.\n\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/mjg/git/commits/e19831c94f91fd410fe001c0372b9c88b40d335b"},{"sha":"68a6b3a1bd45eb1814a0c1cedfe347692c3f2ff7","author":{"name":"Eric Sunshine","email":"8d6e34f987851aa599257d3831a1af040886842f@sunshineco.com"},"message":"worktree: teach 'move' to override lock when --force given twice\n\nFor consistency with \"add -f -f\", which allows a missing but locked\nworktree path to be re-used, allow \"move -f -f\" to override a lock,\nas well, as a convenience.\n\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/mjg/git/commits/68a6b3a1bd45eb1814a0c1cedfe347692c3f2ff7"},{"sha":"f4143101cbb26d189f63f2d29875f4acc07b2730","author":{"name":"Eric Sunshine","email":"8d6e34f987851aa599257d3831a1af040886842f@sunshineco.com"},"message":"worktree: teach 'remove' to override lock when --force given twice\n\nFor consistency with \"add -f -f\" and \"move -f -f\" which override\nthe lock on a worktree, allow \"remove -f -f\" to do so, as well, as a\nconvenience.\n\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/mjg/git/commits/f4143101cbb26d189f63f2d29875f4acc07b2730"},{"sha":"3a5404333c6c8b5897e78c9dcb711d623035791b","author":{"name":"Eric Sunshine","email":"8d6e34f987851aa599257d3831a1af040886842f@sunshineco.com"},"message":"worktree: delete .git/worktrees if empty after 'remove'\n\nFor cleanliness, \"git worktree prune\" deletes the .git/worktrees\ndirectory if it is empty after pruning is complete.\n\nFor consistency, make \"git worktree remove <path>\" likewise delete\n.git/worktrees if it is empty after the removal.\n\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/mjg/git/commits/3a5404333c6c8b5897e78c9dcb711d623035791b"},{"sha":"27064fb7fb82d607f3e2ccc5e9c93e0161bae134","author":{"name":"Jeff King","email":"696e3fbcf235d40b6ea1ebd61c87cbea79d444e7@peff.net"},"message":"doc-diff: always use oids inside worktree\n\nThe doc-diff script immediately resolves its two endpoints\nto actual object ids, so that we can reuse cached results\neven if they appear under a different name. But we still use\nthe original name the user fed us when running \"git\ncheckout\" in our temporary worktree. This can lead to\nconfusing results:\n\n  - the namespace inside the worktree is different than the\n    one outside. In particular, \"./doc-diff origin HEAD\"\n    will resolve HEAD inside the worktree, whose detached\n    HEAD will be pointing at origin! As a result, such a\n    diff would always be empty.\n\n  - worse, we will store this result under the oid we got by\n    resolving HEAD in the main worktree, thus polluting our\n    cache\n\n  - we didn't pass --detach, which meant that using a branch\n    name would cause us to actually check out that branch,\n    making it unavailable to other worktrees.\n\nWe can solve this by feeding the already-resolved object id\nto git-checkout. That naturally forces a detached HEAD, but\njust to make clear our expectation, let's explicitly pass\n--detach.\n\nSigned-off-by: Jeff King <peff@peff.net>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/mjg/git/commits/27064fb7fb82d607f3e2ccc5e9c93e0161bae134"},{"sha":"d65930c5a9fe73ebc4d157ebe1fb9fd9907f2f70","author":{"name":"Jeff King","email":"696e3fbcf235d40b6ea1ebd61c87cbea79d444e7@peff.net"},"message":"test-delta: read input into a heap buffer\n\nWe currently read the input to test-delta by mmap()-ing it.\nHowever, memory-checking tools like valgrind and ASan are\nless able to detect reads/writes past the end of an mmap'd\nbuffer, because the OS is likely to give us extra bytes to\npad out the final page size. So instead, let's read into a\nheap buffer.\n\nAs a bonus, this also makes it possible to write tests with\nempty bases, as mmap() will complain about a zero-length\nmap.\n\nThis is based on a patch by Jann Horn <jannh@google.com>\nwhich actually aligned the data at the end of a page, and\nfollowed it with another page marked with mprotect(). That\nwould detect problems even without a tool like ASan, but it\nwas significantly more complex and may have introduced\nportability problems. By comparison, this approach pushes\nthe complexity onto existing memory-checking tools.\n\nNote that this could be done even more simply by using\nstrbuf_read_file(), but that would defeat the purpose:\nstrbufs generally overallocate (and at the very least\ninclude a trailing NUL which we do not care about), which\nwould defeat most memory checkers.\n\nSigned-off-by: Jeff King <peff@peff.net>\nReviewed-by: Nicolas Pitre <nico@fluxnic.net>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/mjg/git/commits/d65930c5a9fe73ebc4d157ebe1fb9fd9907f2f70"},{"sha":"9caf0107a86d11f059554e55c461f8e7657d89bf","author":{"name":"Jeff King","email":"696e3fbcf235d40b6ea1ebd61c87cbea79d444e7@peff.net"},"message":"t5303: test some corrupt deltas\n\nWe don't have any tests that specifically check boundary\ncases in patch_delta(). It obviously gets exercised by tests\nwhich read from packfiles, but it's hard to create packfiles\nwith bogus deltas.\n\nSo let's cover some obvious boundary cases:\n\n  1. commands that overflow the result buffer\n\n     a. literal content from the delta\n\n     b. copies from a base\n\n  2. commands where the source isn't large enough\n\n     a. literal content from a truncated delta\n\n     b. copies that need more bytes than the base has\n\n  3. copy commands who parameters are truncated\n\nAnd indeed, we have problems with both 2a and 3. I've marked\nthese both as expect_failure, though note that because they\ninvolve reading past the end of a buffer, they will\ntypically only be caught when run under valgrind or ASan.\n\nThere's one more test here, too, which just applies a basic\ndelta. Since all of the other tests expect failure and we\ndon't otherwise use \"test-tool delta\" in the test suite,\nthis gives a sanity check that the tool works at all.\n\nThese are based on an earlier patch by Jann Horn\n<jannh@google.com>.\n\nSigned-off-by: Jeff King <peff@peff.net>\nReviewed-by: Nicolas Pitre <nico@fluxnic.net>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/mjg/git/commits/9caf0107a86d11f059554e55c461f8e7657d89bf"},{"sha":"21870efc4aab4732ba2c422ef116597c54e4a8ec","author":{"name":"Jann Horn","email":"0fcb39c6619aeb747ed6898bfde644ba26b24452@google.com"},"message":"patch-delta: fix oob read\n\nIf `cmd` is in the range [0x01,0x7f] and `cmd > top-data`, the\n`memcpy(out, data, cmd)` can copy out-of-bounds data from after `delta_buf`\ninto `dst_buf`.\n\nThis is not an exploitable bug because triggering the bug increments the\n`data` pointer beyond `top`, causing the `data != top` sanity check after\nthe loop to trigger and discard the destination buffer - which means that\nthe result of the out-of-bounds read is never used for anything.\n\nSigned-off-by: Jann Horn <jannh@google.com>\nSigned-off-by: Jeff King <peff@peff.net>\nReviewed-by: Nicolas Pitre <nico@fluxnic.net>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/mjg/git/commits/21870efc4aab4732ba2c422ef116597c54e4a8ec"},{"sha":"fa72f90e7a5cfbbc32860c6336628c96791b5af3","author":{"name":"Jann Horn","email":"0fcb39c6619aeb747ed6898bfde644ba26b24452@google.com"},"message":"patch-delta: consistently report corruption\n\nWhen applying a delta, if we see an opcode that cannot be\nfulfilled (e.g., asking to write more bytes than the\ndestination has left), we break out of our parsing loop but\ndon't signal an explicit error. We rely on the sanity check\nafter the loop to see if we have leftover delta bytes or\ndidn't fill our result buffer.\n\nThis can silently ignore corruption when the delta buffer\nends with a bogus command and the destination buffer is\nalready full. Instead, let's jump into the error handler\ndirectly when we see this case.\n\nNote that the tests also cover the \"bad opcode\" case, which\nalready handles this correctly.\n\nSigned-off-by: Jann Horn <jannh@google.com>\nSigned-off-by: Jeff King <peff@peff.net>\nReviewed-by: Nicolas Pitre <nico@fluxnic.net>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/mjg/git/commits/fa72f90e7a5cfbbc32860c6336628c96791b5af3"},{"sha":"9514b0b22624b9a6de80a480ab480d61ce29833b","author":{"name":"Jeff King","email":"696e3fbcf235d40b6ea1ebd61c87cbea79d444e7@peff.net"},"message":"patch-delta: handle truncated copy parameters\n\nWhen we see a delta command instructing us to copy bytes\nfrom the base, we have to read the offset and size from the\ndelta stream. We do this without checking whether we're at\nthe end of the stream, meaning we may read past the end of\nthe buffer.\n\nIn practice this isn't exploitable in any interesting way\nbecause:\n\n  1. Deltas are always in packfiles, so we have at least a\n     20-byte trailer that we'll end up reading.\n\n  2. The worst case is that we try to perform a nonsense\n     copy from the base object into the result, based on\n     whatever was in the pack stream next. In most cases\n     this will simply fail due to our bounds-checks against\n     the base or the result.\n\n     But even if you carefully constructed a pack stream for\n     which it succeeds, it wouldn't perform any delta\n     operation that you couldn't have simply included in a\n     non-broken form.\n\nBut obviously it's poor form to read past the end of the\nbuffer we've been given. Unfortunately there's no easy way\nto do a single length check, since the number of bytes we\nneed depends on the number of bits set in the initial\ncommand byte. So we'll just check each byte as we parse. We\ncan hide the complexity in a macro; it's ugly, but not as\nugly as writing out each individual conditional.\n\nSigned-off-by: Jeff King <peff@peff.net>\nReviewed-by: Nicolas Pitre <nico@fluxnic.net>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/mjg/git/commits/9514b0b22624b9a6de80a480ab480d61ce29833b"},{"sha":"18f60f2d3dba291e1ea8e2751c1fce70580de8a9","author":{"name":"Jeff King","email":"696e3fbcf235d40b6ea1ebd61c87cbea79d444e7@peff.net"},"message":"t5303: use printf to generate delta bases\n\nThe exact byte count of the delta base file is important.\nThe test-delta helper will feed it to patch_delta(), which\nwill barf if it doesn't match the size byte given in the\ndelta. Using \"echo\" may end up with unexpected line endings\non some platforms (e.g,. \"\\r\\n\" instead of just \"\\n\").\n\nThis actually wouldn't cause the test to fail (since we\nalready expect test-delta to complain about these bogus\ndeltas), but would mean that we're not exercising the code\nwe think we are.\n\nLet's use printf instead (which we already trust to give us\nbyte-perfect output when we generate the deltas).\n\nWhile we're here, let's tighten the 5-byte result size used\nin the \"truncated copy parameters\" test. This just needs to\nhave enough room to attempt to parse the bogus copy command,\nmeaning 2 is sufficient. Using 5 was arbitrary and just\ncopied from the base size; since those no longer match, it's\nsimply confusing. Let's use a more meaningful number.\n\nSigned-off-by: Jeff King <peff@peff.net>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>","distinct":false,"url":"https://api.github.com/repos/mjg/git/commits/18f60f2d3dba291e1ea8e2751c1fce70580de8a9"}]}
{"actor":{"display_login":"mjg"}}