Log

Author Commit Date CI Message
Stefan Sperling f18c433a 2022-05-31T08:44:55 avoid get_delta_chain_max_size() in dump_delta_chain_to_mem()
Stefan Sperling 6395114c 2022-05-31T08:44:55 avoid get_delta_chain_max_size() in dump_delta_chain_to_file()
Stefan Sperling ce2bf7b7 2022-05-29T17:51:33 fix a bug in findwixt() which caused pack files with missing parent commits The 'nskip' variable is supposed to reflect commits which are waiting on the queue and have the 'skip' color. Only increment 'nskip' when adding such commits to the queue. Problem observed with got send -T and a tag pointing to a deleted branch. Test to reproduce the bug written by op@.
Omar Polo d6a28ffe 2022-05-20T21:21:42 use random seeds for murmurhash2 change the three hardcoded seeds to fresh ones generated on demand via arc4random. Suggested/fixed by and ok stsp@
Omar Polo 17cfdba6 2022-05-20T21:19:30 include header
Stefan Sperling 411cbec1 2022-05-20T09:31:25 shrink struct got_pack_meta a bit by removing the have_reused_delta flag This flag can be expressed as m->reused_delta_offset != 0 because all deltas in valid pack files will be written at a non-zero offset. We allocate a huge number of these structs during packing, so every little bit helps.
Stefan Sperling f8174ca5 2022-05-20T08:40:46 store a path hash instead of a verbatim path in pack meta data This reduces memory use by gotadmin pack. The goal is to sort files which share a path next to each other for deltification. A hash of the path is good enough for this purpose and consumes less memory than a verbatim copy of the path. Git does something similar. ok op@
Stefan Sperling 3e6ceea0 2022-05-20T08:40:46 fix paths stored in pack meta data, improving file deltification The old code was broken and stored an empty path or filenames, instead of a repository-relative path. Which means we didn't sort files for deltification as was intended. Fixing this provides much better deltas in large pack files written by gotadmin pack -a. In my test case, pack size changed from 2GB to 1.5GB. ok op@
Stefan Sperling adb4bbb2 2022-05-20T08:40:46 reduce the amount of memory used for caching deltas during deltification With files sorted properly for deltification we produce better deltas but end up consuming more memory and risk running into OpenBSD ulimits during packing. To compensate, reduce the threshold for the amount of delta data we store in memory, spooling more deltas into the cache file. ok op@
Stefan Sperling 17259bfa 2022-05-19T09:26:13 plug a small memleak on error in got_pack_create()
Stefan Sperling e1f5d7cf 2022-05-19T07:36:33 avoid malloc/free for duplicate check in got_pathlists_insert() ok op@
Stefan Sperling c9b75c7b 2022-05-19T07:31:57 revert "Skip poll(2) if an imsgbuf has a non-empty read buffer" imsg_read() will call recvmsg() on the file descriptor regardless of the read buffer's state, so we should ensure that data is ready. The read buffer is used by imsg_get(), not imsg_read(). We already call imsg_get() before imsg_read(), and call the latter only if imsg_get() returns zero.
Stefan Sperling 2ab71455 2022-05-19T07:18:46 Skip poll(2) if an imsgbuf has a non-empty read buffer.
Stefan Sperling 1453347d 2022-05-19T07:14:21 imsg_add() frees its msg argument on error; avoid double-free in error paths
Stefan Sperling 33fd69c2 2022-05-19T06:50:59 batch up tree entries in imsg instead of sending one imsg per tree entry This speeds up loading of trees significantly. ok op@
Stefan Sperling 9985f404 2022-05-19T06:40:09 parse tree entries into an array instead of a pathlist Avoids some extra malloc/free in a performance-critical path. ok op@
Stefan Sperling 3483a4da 2022-05-18T07:45:08 prevent an out-of-bounds access in got_privsep_recv_tree()
Stefan Sperling baef4d75 2022-05-18T07:44:49 plug memory leak in an error path of got_privsep_recv_tree()
Stefan Sperling 13fcf1bf 2022-05-18T07:44:30 make got_privsep_recv_tree() reject trees with less than zero entries
Stefan Sperling 7429ae85 2022-05-18T07:43:45 rework logic in got_privsep_recv_tree() to avoid an ugly 'goto' no functional change
Omar Polo 4bcdc895 2022-05-17T17:35:17 refactor got_patch / got_worktree_patch_complete let got_patch own fileindex_path and call got_worktree_patch_complete only if got_wokrtree_patch_prepare hasn't failed. suggested by stsp@
Omar Polo f2dd7807 2022-05-17T13:28:02 got patch: avoid open/sync/close the fileindex over and over again Instead of flushing the fileindex after every patch in the patchfile just reuse the same fileindex and sync it only at the end of the patch operation. This speeds up 'got patch' on large repositories by quite a lot.
Christian Weisgerber e45f7eba 2022-05-14T18:55:37 got patch: switch from fseek() to fseeko(), use unary minus while here ok op
Omar Polo be33dff7 2022-05-13T15:28:04 got patch: fail when reading empty hunks
Stefan Sperling 6d9c73d7 2022-05-10T11:46:02 bump version number
Stefan Sperling 1dc7dca2 2022-05-10T11:40:59 CHANGES for 0.70
Stefan Sperling e93fb944 2022-05-10T11:34:16 map delta cache file into memory if possible while writing a pack file with a fix from + ok op@
Stefan Sperling dc3fe1bf 2022-05-10T11:24:12 fix load_object_ids() such that packing tags works if zero commits are packed reported by jrick and op
Stefan Sperling cab5dc8b 2022-05-10T11:22:34 hook cmdline send tests up for 'make regress', this was forgotten
Stefan Sperling fae7e038 2022-05-07T11:50:56 run the search for deltas to reuse in got-read-pack This significantly speeds up the deltification step of packing by avoiding imsg traffic. gotadmin no longer requests individual raw deltas from got-read-pack to check whether it can reuse them. Instead, got-read-pack obtains a list of objects we want to pack, and hands back the list of all deltas in its pack file which can be reused. Messages are now batched such that imsg buffers are filled as much as possible. Another advantage is that deltas we are not going to reuse will no longer be written to the delta cache file, saving disk space. Before this patch, any raw delta candidate was written to the delta cache file by got-read-pack, and the decision whether to reuse the delta happened afterwards in the gotadmin process. Code for reading individual raw deltas is now unused and could be removed at some point. ok op@
Stefan Sperling f5e78e05 2022-05-04T15:39:15 avoid loop over the ID set which removes objects IDs with reused deltas ok op@
Stefan Sperling 2f8438b0 2022-05-04T15:39:15 avoid 'remove unused' loop by storing excluded objects in a separate set ok op@
Stefan Sperling 2d9e6abf 2022-05-04T13:43:24 store deltas in compressed form while packing, both in memory and cache file This reduces memory and disk space consumption during packing. with tweaks + memleak on error fix from op@ ok op@
Omar Polo 6b7665ac 2022-05-02T09:31:24 s/empty/done forgot in previous commit
Omar Polo d75b9573 2022-05-02T08:48:10 got-read-patch: rename `ok' variable and simplify the parsing a bit
Omar Polo f90b7a8c 2022-05-02T08:39:41 trailing whitespaces
Omar Polo 4379a9aa 2022-05-02T08:38:43 got patch: handle git-style rename diffs extend the support for git-style diffs to include the "pure rename" case, i.e. when a file is renamed without any edits. ok stsp@
Stefan Sperling 611e8e31 2022-05-01T11:47:21 avoid subtraction of values larger than int in qsort(3) comparison callbacks tweak + ok tb@
Stefan Sperling a8acad7d 2022-04-24T13:26:30 bump version number
Stefan Sperling 45b17929 2022-04-24T13:22:15 CHANGES for 0.69
Christian Weisgerber 45ca4633 2022-04-23T11:02:06 add -q to "gotadmin pack" usage
Omar Polo bad961bf 2022-04-23T10:39:47 got patch: allow to reverse a patch add a flag to got_patch to reverse a patch before applying and the -R flag for `got patch'. ok stsp@
Omar Polo b2832778 2022-04-23T10:39:47 got-read-patch: preserve all \ lines as a cheap optimization got-read-patch was sending only the "\ No newline at end of file" lines that follows an addition (a "+" line). To be able to reverse patches in the future got_patch needs to know about all of these lines instead. No functional changes intended. ok stsp@
Omar Polo 15e1bda6 2022-04-23T10:26:47 test `got patch' vs path-prefixes, relative paths and strip reminded by and 'looks fine' to stsp@
Omar Polo f1d6cebb 2022-04-23T09:33:14 typos
Omar Polo 86187278 2022-04-23T08:09:03 mention -p in usage_patch
Omar Polo ed3bff83 2022-04-23T07:56:18 got patch: resolve paths from the current working directory this allow to apply patches from subdirectories of the work tree root. Prodded by naddy@, ok stsp@.
Omar Polo a05fb460 2022-04-23T07:54:56 don't pass relative paths to get_file_status
Omar Polo 41a37a44 2022-04-23T07:49:42 fix wrong path in error message
Stefan Sperling d7b5a0e8 2022-04-20T14:00:12 inline struct got_object_id in struct got_object_qid Saves us from doing a malloc/free call for every item on the list. ok op@
Stefan Sperling cbc287dc 2022-04-19T20:08:41 reimplement object-ID set data structure on top of a hash table Siphash suggested by jrick as a better alternative to murmurhash for this use case. with small fixes from and ok op@
Omar Polo 3313bcd8 2022-04-19T16:57:25 delete trailing whitespaces
Omar Polo 728ed142 2022-04-19T15:09:57 simplify apply_unveil in cmd_patch: the worktree is not optional
Omar Polo c036d108 2022-04-15T18:14:01 redirect jot(1) output instead of looping over it; ok tb@
Stefan Sperling 70f8f24d 2022-04-14T15:05:19 speed up initial stage of packing by adding a "skip" commit color The skip color marks boundary commits and their ancestors. Boundary commits are reachable both via references which we want to exclude from the pack, and via references which we want to include in the pack. We continue processing commit history up to the point we are left with only skip commits on the queue. This can speed up findtwixt() significantly and avoids wrong results produced by the old algorithm which made no distinction between "drop" and "skip". This idea was first implemented by Michael Forney for git9: https://git.9front.org/plan9front/plan9front/2e47badb88312c5c045a8042dc2ef80148e5ab47/commit.html Michael's log message for git9 is reproduced below: git/query: refactor graph painting algorithm (findtwixt, lca) We now keep track of 3 sets during traversal: - keep: commits we've reached from head commits - drop: commits we've reached from tail commits - skip: ancestors of commits in both 'keep' and 'drop' Commits in 'keep' and/or 'drop' may be added later to the 'skip' set if we discover later that they are part of a common subgraph of the head and tail commits. From these sets we can calculate the commits we are interested in: lca commits are those in 'keep' and 'drop', but not in 'skip'. findtwixt commits are those in 'keep', but not in 'drop' or 'skip'. The "LCA" commit returned is a common ancestor such that there are no other common ancestors that can reach that commit. Although there can be multiple commits that meet this criteria, where one is technically lower on the commit-graph than the other, these cases only happen in complex merge arrangements and any choice is likely a decent merge base. Repainting is now done in paint() directly. When we find a boundary commit, we switch our paint color to 'skip'. 'skip' painting does not stop when it hits another color; we continue until we are left with only 'skip' commits on the queue. This fixes several mishandled cases in the current algorithm: 1. If we hit the common subgraph from tail commits first (if the tail commit was newer than the head commit), we ended up traversing the entire commit graph. This is because we couldn't distinguish between 'drop' commits that were part of the common subgraph, and those that were still looking for it. 2. If we traversed through an initial part of the common subgraph from head commits before reaching it from tail commits, these commits were returned from findtwixt even though they were also reachable from tail commits. 3. In the same case as 2, we might end up choosing an incorrect commit as the LCA, which is an ancestor of the real LCA.
Stefan Sperling a7472cb3 2022-04-14T15:00:59 check return value of RB_INSERT; ok + memleak fix by op@
Theo Buehler bb6672b6 2022-04-14T11:51:32 make sure callers of got_object_idset_add() free data.
Stefan Sperling 3d1a1e4c 2022-04-13T19:35:01 fix a double-free in an error case of cmd_checkout()
Stefan Sperling 7e4f461f 2022-04-13T14:01:18 sort references by date for packing; newer commits should be processed first
Stefan Sperling 20e420c8 2022-04-11T13:33:54 add a -q (quiet) option to 'gotadmin pack'
Stefan Sperling fbafdecf 2022-04-10T13:03:29 revert 03c03172 "drop a commit right away if it matches an excluded commit" This change resulted in a full history walk even when no objects will be added to the pack file. Fix this regression by reverting the change.
Stefan Sperling 14dbbf48 2022-04-10T12:15:46 for clarity, move the coloring loop from findtwixt() into a separate function
Stefan Sperling 1d765da3 2022-04-10T12:13:02 remove a pointless object-id dup/free dance in findtwixt()
Stefan Sperling 57bc7b6d 2022-04-10T12:10:52 don't forget to call the cancel callback while coloring commits in findtwixt()
Stefan Sperling 03c03172 2022-04-10T12:08:45 in findtwixt(), drop a commit right away if it matches an excluded commit
Stefan Sperling 912a163e 2022-04-10T11:35:53 the obj_types array in pack_create.c is no longer useful, remove it
Stefan Sperling ffd9dda7 2022-04-10T11:34:02 make 'got tag' unlock the work tree earlier when creating tags The work tree was only held open in order to find its got.conf file since this file could contain a tagger name to use. Read the tagger name earlier. Once the tagger name is known we can close the work tree already.
Stefan Sperling 2a261ce7 2022-04-09T17:40:16 make 'got tag -l' unlock the work tree earlier to allow other parallel commands
Stefan Sperling a091f71a 2022-04-09T17:37:21 make 'got cat' not search for a work tree if the -r option is used Fixes failures in our test suite if 'got tag -l | less' is used in the work tree while cmdline tests are running.
Stefan Sperling 29e0594f 2022-04-09T17:34:51 make gotadmin pack -x option work with tag arguments
Stefan Sperling 67ba6161 2022-04-08T09:14:02 leave work tree in a usable state after 'got rebase' fails path-prefix checks reported by naddy
Stefan Sperling 9d34261e 2022-04-07T20:55:39 in load_object_ids(), process "their" commits and tags in the same loop No functional change, the end result is the same.
Stefan Sperling 820e4466 2022-04-07T17:56:18 fix typo in comment: navicate -> navigate
Stefan Sperling 392891ce 2022-04-07T13:20:47 pass an already open commit object to the blame callback ok op@
Stefan Sperling a44927cc 2022-04-07T12:57:31 stop relying on commit cache for good performance of got_object_id_by_path() Instead of internally opening and closing the same commit object over and over again, require callers to pass an open commit object in. Avoids an inherent dependency on the commit object cache for reasonable performance. ok op@
Stefan Sperling c655fd93 2022-04-07T12:04:42 rename variables in got_path_strip() for clarity; ok op@
Omar Polo 9d6cabd5 2022-04-07T09:28:59 got patch: allow to strip path components Move some bits from the libexec helper to the main process so we know if the patch was generated by git or not and finally document the automatic stripping of a/ and b/ prefixes added by git-diff(1). ok stsp@
Christian Weisgerber 49c543a6 2022-03-31T20:41:38 use test(1) -eq and -ne to compare integers, and reduce quoting This brings the rest of the regression test scripts in line with patch.sh.
Omar Polo fbbb53b9 2022-03-25T23:08:27 remove trailing whitespaces
Stefan Sperling c0591751 2022-03-24T12:17:45 link libexec helpers against _p libraries when building with 'make PROFILE=1'
Omar Polo 3e99fbc5 2022-03-23T20:59:29 plug a memory leak in list_refs(), ok stsp@
Stefan Sperling bc5e881a 2022-03-23T20:55:26 plug a memory leak in got_fetch_pack(); patch by Mikhail
Stefan Sperling 08d50867 2022-03-22T13:51:13 bump version number
Stefan Sperling ce15c8e2 2022-03-22T13:43:21 CHANGES for 0.68
Stefan Sperling e260f8ae 2022-03-22T11:55:38 fgetc() returns int, not char; fixes -Werror build on armv7
Stefan Sperling f2e1007b 2022-03-22T11:32:07 sync dist file list
Stefan Sperling 1a4ff8fa 2022-03-22T11:28:47 fix free() on uninitialized variable upon error in gw_output_file_blame() ok op@
Stefan Sperling 1a7a534e 2022-03-22T11:22:12 tweak wording to make it clearer where the mentioned -u option applies
Omar Polo b3c57ab2 2022-03-22T11:20:46 got patch: handle "\ No newline at end of file"
Omar Polo 4027dbc2 2022-03-22T11:20:46 reuse apply_hunk in patch_file when creating a file
Stefan Sperling 3b01d641 2022-03-22T11:19:46 mention that 'got patch' is compatible with 'cvs diff -u' output
Stefan Sperling 3f3a6472 2022-03-22T11:17:41 mention that 'got patch' can read diffs produced by Git, to avoid any doubt
Stefan Sperling 6863cbf9 2022-03-21T19:59:03 fix pack progress object counter for loose objects Move pack progres object accounting to a single place. This makes it easier to account for the case were only loose objects are packed. A wrong amount of objects was reported before when packing loose ones.
Stefan Sperling c4e796b2 2022-03-21T16:08:41 in pack progress output, remove excluded objects from 'found' objects counter
Stefan Sperling cdeb891a 2022-03-21T15:52:15 fix a bug where 'gotadmin pack' packed too many objects unless -a was used
Christian Weisgerber e38d4cde 2022-03-21T13:14:13 subordinate clauses preceding the main clause are offset by a comma
Stefan Sperling 0ae61b79 2022-03-21T10:17:40 fix potential NULL deref in error path of got_object_idset_remove()
Omar Polo 7a30b5cb 2022-03-20T08:54:45 got patch: prefer new name if not /dev/null and not a git-style diff This fixes a common issue when for e.g. generating patches with $ diff -u foo.orig foo where 'got patch' failed because 'foo.orig' has an 'unexpected status'. prodded by naddy, ok stsp
Christian Weisgerber f134ecfd 2022-03-19T21:25:59 const-ify string table
Omar Polo 78f5ac24 2022-03-19T15:06:37 move got_patch file status checking in worktree.c check_file_status used got_worktree_status to check if the file was in an allowed state, but it's wrong since the callback is not invoked on unchanged files. While here also fix a relate bug: unlink(newpath) is in the wrong spot and ends up removing files even when it shouldn't, so move it early in the got_worktree_schedule_* error handling. Finally, update the appropriate test case. It was passing before because got_worktree_schedule_add returned GOT_ERR_FILE_STATUS, not because check_file_status failed. ok stsp@