Log

Author Commit Date CI Message
Omar Polo 2399b53d 2022-06-14T08:26:27 style; set datalen only once
Omar Polo 71393b5c 2022-06-14T08:10:55 got patch: guard against invalid (negative) line offsets under normal circumstances got-read-patch can't send negative line offsets; that's not an excuse not to guard the main process from those as well. This makes sure we bail out early instead of trying to apply the diff.
Omar Polo 0e07a2a1 2022-06-13T20:57:43 free patch on error
Omar Polo 99b94ad7 2022-06-13T20:30:09 got patch: ensure new and old paths are NUL-terminated
Stefan Sperling eb7b30a1 2022-06-13T17:13:59 fix error handling in find_pack_for_enumeration(); pointed out by op@
Stefan Sperling 0ab4c957 2022-06-13T17:13:59 Bring back object enumeration inside got-read-pack as a fast path. The problem that was found in the earlier version has been fixed. ok op@
Stefan Sperling 61dd0f65 2022-06-13T09:37:38 remove outdated and overly-specific documentation of got log -s output ok op@
Stefan Sperling 783ffc01 2022-06-13T09:37:38 adjust expected test output after got log -s changes ok op@
Stefan Sperling d91e0535 2022-06-13T09:37:38 make got log -s show committer date ok op@
Stefan Sperling 4cac2b4e 2022-06-13T09:37:38 make got log -s display local reference names ok op@
Stefan Sperling 85c34e74 2022-06-13T09:37:38 fix error case handling in print_commit_oneline(); pointed out by op@
Stefan Sperling 83cc4199 2022-06-13T07:59:28 in tog, rework Ctrl+u/d to scroll by half a page, and drop d/u again This matches actual behaviour of less(1) for Ctrl+u/d, and leaves d/u free for potential future use. Suggested by naddy. Patch by Mark Jamsek
Omar Polo 793b9394 2022-06-12T15:45:11 got log: sync match_commit from tog So that 'got log -S' can match also the author and committer name, and the commit ID too. ok stsp@
Stefan Sperling 80b7e8da 2022-06-11T19:24:51 add less(1)-style key bindings for up/down to tog; patch by Mikhail
Stefan Sperling 3ef807ee 2022-06-08T11:01:11 reword description of how got log -p and -P interact with got log -S
Stefan Sperling a558dd1b 2022-06-08T10:56:53 reuse a temporary file across commits during got log -p -S suggested by + ok op@
Stefan Sperling ee0fb1ff 2022-06-08T10:33:53 make it possible to match committed patches with got log -p -S pattern ok op@
Stefan Sperling caea18c1 2022-06-08T09:51:05 add a missing .Pp to got.1
Stefan Sperling 90e25b1f 2022-06-08T09:43:35 plug a memory leak in show_change(), line was leaked
Stefan Sperling c1c775eb 2022-06-08T09:16:08 add one-line output mode to got log with -s flag -s for short. Moves log search to -S. Patch by Evan Silberman
Stefan Sperling e44d9391 2022-06-07T19:20:01 revert object enumeration in got-read-pack for now; needs more work This implementation marked commits and trees as enumerated before all trees which they depend on were enumerated. This behaviour leads to incomplete pack files when a tree is only partially packed and got-read-pack hits a missing tree entry as a result. The algorithm must be reworked such that packed leave nodes are marked enumerated first, then bubble-up. Found by op@
Stefan Sperling 0e90588f 2022-06-07T17:50:48 in enumeration_request(), use the correct index for tagged commit objects Fixes an error where got-read-pack errors out with "bad object data" during 'got send' because we ended up handing a tag object to the commit object parser.
Stefan Sperling 9f4f302a 2022-06-07T16:04:15 free id and path in load_packed_tree_ids() on error, else they would leak pointed out by op@
Stefan Sperling f0972833 2022-06-07T16:00:56 fix wrong line wrap; pointed out by op@
Stefan Sperling 876f8c1a 2022-06-07T15:59:48 imsg_add() already frees wbuf on error; pointed out by op@
Stefan Sperling cee6a7ea 2022-06-07T15:56:46 implement object enumeration support in got-read-pack ok op@
Omar Polo 9fdde394 2022-06-04T14:13:46 got stage: implicitly unstage when staging the reverse of the staged diff otherwise we end up with a staged empty edit for that file. ok stsp@
Stefan Sperling 4264b841 2022-06-04T14:02:21 check the maximum cached delta size against the correct constant
Stefan Sperling dac5c75e 2022-06-04T13:58:48 convert delta cache to a hash table This approach uses more memory but is much faster. To offset the additional memory usage somewhat the cache now stores very small deltas only. However, overall memory usage goes up. Hopefully we will find a way to reduce this later. ok op@
Omar Polo 84246752 2022-06-03T20:26:49 set `ret' in a few places where it was forgotten; ok tracey@
Omar Polo a19f439c 2022-06-03T20:26:48 don't pass $ret to test_done on failure when it's known to be zero Otherwise the test directory it's not left in place; ok tracey@
Stefan Sperling 6a881297 2022-06-02T12:32:00 properly swap cached struct pack array elements in got_repo_cache_pack() Avoids clobbering open files for delta base/accumulation, leaking file descriptors, and triggering errors from close(2) during got_repo_close() as we try to close the same file descriptor more than once.
Stefan Sperling b72706c3 2022-06-01T05:08:20 move creation of tempfiles outside of lib/diff.c ok tracey
Stefan Sperling 2497f032 2022-05-31T19:25:28 tog: override SIGTERM and SIGINT handlers to avoid ncurses cleanup() handler ok thomas
Stefan Sperling cfcf1cbc 2022-05-31T18:49:16 reduce GOT_PACK_CACHE_SIZE to 32, otherwise it uses too many open files found by tracey
Stefan Sperling 13242195 2022-05-31T18:34:45 ensure that all open basefd/accumfd get closed in got_repo_close() found by tracey
Stefan Sperling 57160834 2022-05-31T11:00:09 open temporary files needed for delta application in got_repo_open() This prepares for callers of got_repo_open() that cannot afford to open files in /tmp, such as gotwebd. In a follow-up change, we could ask such callers to pass in the required amount of open temporary files. One consequence is that got_repo_open() now requires the "cpath" pledge promise. Add the "cpath" promise to affected callers and remove it once the repository has been opened. ok tracey
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 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 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 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 2f8438b0 2022-05-04T15:39:15 avoid 'remove unused' loop by storing excluded objects in a separate set 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 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()