lib


Log

Author Commit Date CI Message
Stefan Sperling 2471f5c4 2022-01-06T19:20:52 sync files from diff.git b72f51ffc39028023059fc994542565691b669fa This fixes a scrolling problem in tog's diff view for diffs which contain lines of the form "Binary files %s and %s differ".
Stefan Sperling dbe266a4 2022-01-05T20:24:13 print status output even if 'gotadmin cleanup' finds no objects to remove
Stefan Sperling 9cd5f067 2022-01-05T20:14:59 fix amount of purged objects shown in gotadmin cleanup's final progress report
Stefan Sperling 211cfef0 2022-01-05T19:57:10 use time-based rate-limiting for gotadmin progress output Suggested by naddy some time ago. ok tracey
Stefan Sperling db696021 2022-01-04T16:11:52 avoid the creation of new temporary files whenever a packed object is read This speeds up the creation of pack files by about 30%.
Stefan Sperling 404bde06 2022-01-03T21:51:02 fix bogus "object not found" errors when object ID begins with 00 ok thomas_adam
Stefan Sperling c0df5966 2021-12-31T09:33:01 wrap overlong lines
Stefan Sperling e7ae0baf 2021-12-31T09:11:22 add O_CLOEXEC (close-on-exec) to openat(2) calls suggested by millert ok thomas_adam
Stefan Sperling 8bd0cdad 2021-12-31T09:11:21 add O_CLOEXEC (close-on-exec) flag to open(2) calls suggested by millert ok thomas_adam
Stefan Sperling 00fe21f2 2021-12-31T09:11:21 add "e" (close-on-exec) flag to fopen(3) calls suggested by millert ok thomas_adam
Stefan Sperling ed7cc4a8 2021-12-29T12:03:33 remove outdated comment
Stefan Sperling 197088a4 2021-12-27T05:20:04 whitespace
Stefan Sperling 46ea77db 2021-12-20T16:18:41 sort paths in got log -Pp and tog's diff view the same way as in the diff reported by and fix confirmed by naddy
Stefan Sperling 4a55b231 2021-12-09T16:10:25 ignore the return value of closefrom(2); patch by Anna a.k.a. CyberTailor millert@ suggests that this check is not needed, and that ideally we should be using close-on-exec instead. I will look into this, but in the meantime this change will help -portable: https://bugs.gentoo.org/828003
Stefan Sperling f6f4c787 2021-11-23T19:12:49 sync files from diff.git f1dbec24f9a9553e22659f6c592c91e96221f6b9
Stefan Sperling 42864987 2021-11-20T11:14:44 fall back to comparison by name when refs have the same timestamp This fixes an issue where some references were missing from lists of references sorted by timestamp.
Stefan Sperling 2d497592 2021-11-20T10:40:33 implement got_reflist_sort() which sorts a ref list in-place
Stefan Sperling 0309152a 2021-11-20T10:39:04 fix uninitialized error from got_ref_cmp_by_commit_timestamp_descending()
Stefan Sperling 7f66531d 2021-11-16T14:33:26 allow sorting references by timestamp in tog
Stefan Sperling 0e039681 2021-11-15T17:00:36 preverse binary files during updates and merges
Stefan Sperling 7d69d862 2021-11-15T15:18:40 let gotadmin find the repository automatically if invoked in a work tree Move a small amount of code from worktree.c to a new file worktree_open.c, which contains everything required to open and close a work tree and inspect some of its basic parameters. This can be used by gotadmin. ok tracey
Christian Weisgerber 47a90748 2021-10-27T15:23:59 remove unused variables to fix LLVM 13 warnings; ok stsp
Stefan Sperling 22edbce7 2021-10-24T09:41:04 use up to 128 delta chain elements again; creates smaller packs at same speed
Stefan Sperling 4f4d853e 2021-10-24T09:41:04 try only 3 delta base candidates instead of 10 to speed up packing Tests by kn, thomas_adam and myself made on various repositories indicate that 3 is a good choice. Tyring 10 deltas is much slower and does not result in significantly smaller pack files.
Stefan Sperling 15a5c949 2021-10-17T14:12:46 set oldo.to in diff3.c's duplicate() even if the file contains no newlines
Stefan Sperling 8383a50b 2021-10-17T14:11:32 always initialize output parameter "n" of get_line() in diff3.c
Christian Weisgerber 4f18c400 2021-10-16T15:01:42 fix another segfault in edscript() Same problem as fixed in 90de04bc7f1b85b9c491bcd124f6178fad005de1. ok stsp
Stefan Sperling 92410079 2021-10-16T14:50:03 fix regression where 'got send -T' failed if same tag already exists on server Problem reported and fix tested by Omar Polo.
Stefan Sperling a319ca8c 2021-10-15T10:36:12 move encode_delta() in pack_create.c to eliminate a forward declaration
Stefan Sperling 74881701 2021-10-15T10:34:44 while packing, store encoded deltas in a temporary file instead of in memory
Stefan Sperling dc20764a 2021-10-15T09:30:29 limit delta chain length in newly created pack files to 32 deltas Our former limit was 128 which is fairly high. Git uses 50 by default. A smaller limit results in slightly larger pack files but makes both packing and unpacking faster.
Stefan Sperling 94dac27c 2021-10-15T09:24:56 raw object blocksize and read buffer were unused; remove them
Stefan Sperling 284e7663 2021-10-15T09:21:46 remove unused internal raw object API functions
Stefan Sperling d3c116bf 2021-10-15T09:10:14 cache raw objects in order to speed up gotadmin pack
Stefan Sperling cc7a354a 2021-10-15T07:15:00 reuse temporary files which were not used by got_object_raw_open()
Stefan Sperling e65c7410 2021-10-14T20:50:01 add missing error checks in got_object_raw_open()
Stefan Sperling 600b755e 2021-10-14T20:30:26 avoid opening delta base objects in genpack() just to find their size
Stefan Sperling 08347b73 2021-10-14T17:27:26 encode deltas in temporary files to avoid high memory usage
Stefan Sperling 5df018ff 2021-10-14T16:03:22 rework murmurhash2() to avoid potential unaligned memory access pointed out by naddy@ ok millert@
Stefan Sperling 1d19226a 2021-10-13T18:48:15 fix two more error strings in pack_create.c using the wrong function name
Stefan Sperling 2d467c6d 2021-10-13T18:07:29 fix wrong function in error string of emitdelta()
Stefan Sperling f8b19efd 2021-10-13T11:09:15 use RB_TREE instead of STAILQ to manage packindex bloom filters; much faster
Stefan Sperling 8f2ca62d 2021-10-13T10:34:06 do not skip ignored directories in 'got status' if they contain tracked files Fixes regression introduced by commit 41f061b2f459318f3738f59d7676efccc4beb344 where tracked files inside an ignored directory were reported as missing.
Stefan Sperling b343c297 2021-10-11T18:54:11 use a bloom filter to avoid pointless pack index searches
Stefan Sperling 7a0b1068 2021-10-11T18:54:08 fix pack index cache element rotation; keep often used entries near the front
Stefan Sperling 90de04bc 2021-10-11T18:32:16 fix a segfault in edscript() introduced by my previous commit Found by our cherrypick regression tests.
Stefan Sperling f10244c0 2021-10-11T18:25:11 fix merging of files which contain a dot on a line by itself Annoying bug which we inherited from OpenRCS which inherited it from OpenBSD's diff3 program. ok tracey millert
Stefan Sperling 2c9e323b 2021-10-10T19:26:26 speed up 'got histedit -l' and 'got rebase -l' Cache commit timestamps in struct got_reference in case we are sorting references by commit timestamp. This avoids opening and closing commits every time we compare two references with each other. ok thomas.adam
Stefan Sperling 67b631c9 2021-10-10T15:22:14 implement 'got diff -c' for diffing commits with optional filtering by path Need for filtering by path sugggested by kn@ ok naddy@
Stefan Sperling 138e4f47 2021-10-09T19:47:15 display the requested object type when an object could not be found ok millert@
Stefan Sperling 237cfda1 2021-10-08T22:34:25 make got_repo_match_object_id() filter tags by the requested object type Potentially this function could return objects of a type that was not requested. Problem found by code inspection. This change does not affect any of our existing tests.
Stefan Sperling aaef19b4 2021-10-08T08:33:30 sync files from diff.git 346d4986568ffbcfdc53cce45dd8a468535a68f2
Stefan Sperling f736d93a 2021-10-07T19:12:36 link to the FastCDC paper from deltify.c; suggested by Ori some time ago
Stefan Sperling 6eab69f7 2021-10-07T19:08:52 make the number of elements in deltify's geartab explicit
Klemens Nanni fbceed27 2021-10-07T15:38:38 Provide lib/Makefile to enable tags file generation The root Makefile does not hook into lib/ via <bsd.subdir.mk> since it is not a program itself and thus gets included by all others. This means `make tags` skips lib/ and `make -C lib/ tags` does not know what to do; provide a minimal <bsd.lib.mk> stub and hook it up just for the "tags" such that *all* source is browsable via tags. See /usr/share/mk/bsd.README for details. Feedback stsp tb OK tb
Stefan Sperling e99d9267 2021-10-07T15:29:27 plug memory leaks in got-fetch-pack and got-send-pack ok naddy
Stefan Sperling dd088d95 2021-10-06T19:49:06 let 'got fetch' send all references to the server to avoid redundant downloads Problem reported by naddy. ok naddy
Stefan Sperling 62da3196 2021-10-01T13:58:31 skip ignored directories during 'got status' disk crawl
Stefan Sperling 965803d3 2021-09-28T20:55:16 fix 'got fetch' downloading too many objects in some cases Always announce all local references to the server when fetching changes. We used to do this only in mirror mode. In regular mode only refs/tags and refs/remotes/origin were announced, which could result in unnecessary downloads if relevant objects exist in refs/heads or elsewhere.
Christian Weisgerber 9dd14b99 2021-09-28T19:21:34 got_sha1_digest_to_str() writes to char * ok stsp
Christian Weisgerber 31e61ec1 2021-09-28T19:21:33 match the unsigned char type used by the zlib interface ok stsp
Stefan Sperling 0ff8d236 2021-09-28T06:59:08 show commit progress output when 'got merge -c' is used Otherwise no progress output is shown at all with this command. Commit progress output will also display any additional changes which resulted from conflict resolution. ok millert@
Stefan Sperling 4e91ef15 2021-09-26T17:51:35 make it possible to merge vendor branches with 'got merge'
Stefan Sperling 5c02d2a5 2021-09-26T17:40:10 for portability, handle errno variations upon open(2) failure with O_NOFOLLOW Problem pointed out by naddy for FreeBSD -portable. Discussed with millert, thomas adam, and naddy.
Stefan Sperling 5267b9e4 2021-09-26T11:41:40 allow bad symlinks to survive a merge Commands which perform merges will now install bad symlinks as symlinks in the work tree, instead of creating them as regular files. This means bad symlinks committed with 'got commit -S' (or Git) will be preserved. The decision to introduce a bad symlink is done at commit-time and merges should not forcefully reverse this decision. The cherrypick and backout commands require a manual commit step, and a merge result with bad symlinks will require use of 'got commit -S'. Additional testing by thomas adam
Stefan Sperling fda3525e 2021-09-25T10:23:12 mark some function parameters as 'const', as they should be; patch by Omar Polo
Stefan Sperling f6764181 2021-09-24T21:52:59 fix 'got update' of an added + obstructed file When 'got update' tried to add a new file to the work tree and this file was obstructed by, say, a directory on disk, the update failed: $ got update ? new got: new: Is a directory $ And the work tree was not updated. With this commit this situation is properly detected as an obstruction and the update succeeds: $ got update ~ new Updated to refs/heads/master: c1f85b4938dc4c668a88f13df2b98a520fc077cc File paths obstructed by a non-regular file: 1 $ Extend a corresponding test case to cover this issue. ok tracey
Stefan Sperling 793fcac3 2021-09-24T20:14:09 plug memory leak in got_worktree_merge_in_progress(); spotted by tracey
Stefan Sperling f259c4c1 2021-09-24T19:55:02 add a 'got merge' command for creating merge commits Additional testing by Thomas Adam. ok tracey
Stefan Sperling 3af9de88 2021-09-22T13:32:37 fix 'got send' with tree objects which contain symlinks; reported by Omar
Stefan Sperling c2105d00 2021-09-14T19:02:10 fix another instance of 'got send' sending branches the server already has
Stefan Sperling 26960ff7 2021-09-14T09:52:49 make 'got send' properly send commits which are referenced only by tags Problem reported by Omar Polo.
Christian Weisgerber 8a8621c2 2021-09-06T12:53:51 add missing <sys/types.h> include
Christian Weisgerber c10270f6 2021-09-06T08:45:22 assert against accidentally overflowing argv[] in got_dial_ssh() ok stsp
Stefan Sperling 5e5da8c4 2021-09-05T20:51:29 rename got_fetch_parse_uri() to got_dial_parse_uri() This function is now being used by both 'got fetch' and 'got send' so its former name was misleading.
Stefan Sperling 77d7d3bb 2021-09-05T20:39:50 de-duplicate a constant used by both 'got fetch' and 'got send' Both GOT_FETCH_PKTMAX and GOT_SEND_PKTMAX had the same value. Declare this value as GOT_PKT_MAX in got_lib_pkt.h instead.
Stefan Sperling d65a88a2 2021-09-05T20:19:14 move duplicated dial_ssh() and dial_git() functions into a common file These functions are used by 'got send' and 'got fetch' in order to open network connections to a server. Move them into new file lib/dial.c and declare relevant functions in got_dial.h and lib/got_lib_dial.h. No functional change.
Christian Weisgerber abc59930 2021-09-05T19:41:03 indentation fixes
Stefan Sperling e33e440b 2021-09-05T14:34:59 whitespace fix
Stefan Sperling bd3d9e54 2021-09-05T14:21:02 move more code used by got-send-pack and got-fetch-pack to a common file Move functions and data structures which implement Git protocol features required for fetching and sending pack files to new files lib/gitproto.c and lib/got_lib_gitproto.h. This code was duplicated in got-fetch-pack and got-send-pack. No functional change.
Stefan Sperling f024663d 2021-09-05T13:50:39 move pkt code used by got-fetch-pack and got-send-pack to a common file The Git protocol uses a simple packet framing format. The got-fetch-pack and got-send-pack programs contained identical copies of functions to support this format. Move related functions to new file lib/pkt.c and link both programs against this common implementation. No functional change.
Stefan Sperling eca70f98 2021-09-03T09:51:31 fix 'got send' adding too many objects to the pack file in some cases Load server-side tags before loading local commits. Otherwise objects which are reachable via server-side tags will not be filtered out.
Stefan Sperling 69de9dd4 2021-09-03T09:02:06 limit checks for merge conflicts to files affected by the merge Performance problems reported by naddy
Stefan Sperling 5546d466 2021-09-02T19:39:14 plug a memory leak in check_merge_ok()
Stefan Sperling 243a13f5 2021-09-02T19:13:50 fix bogus error when 'got cherrypick' merges changes into a locally added file reported by + ok naddy
Stefan Sperling 6c13b005 2021-09-02T13:57:34 Update comment regarding the merged_paths list used by rebase and histedit with insight I obtained while trying to make this idea work, and failing...
Stefan Sperling dae2a678 2021-09-01T20:31:46 backout 7280143edc2d689b1f57d5a46d376e48cdae64a2; not needed after all
Stefan Sperling 0e33f8e0 2021-09-01T14:34:33 disable ignore lists during status walks used by rebase and histedit Fixes rebase of gotwebd branch which added a new directory which is also matched by .gitignore rules on the branch.
Stefan Sperling 7280143e 2021-09-01T11:56:31 refactor collect_commitables() to make it easier to call from elsewhere later
Stefan Sperling 6480c871 2021-08-30T15:51:23 provide separate send {} and fetch {} configuration blocks in got.conf Feature requested by naddy. ok naddy, who also suggested some tweaks that will arrive shortly
Stefan Sperling 5de743f8 2021-08-29T13:15:27 fix seek to incorrect offset in the delta base when creating deltas The stretchblk() function needs to compare data located after the block which has just been matched. However, upon entry it was resetting the file pointer of the delta base to the beginning(!) of the block. The other file is correctly positioned after the block. In many cases the data won't match and stretchblk() will not stretch the matched block. But when the data did happen to match this resulted in a bogus delta, and wrong file contents when the delta was applied. Fix this by setting the delta base file pointer to end of the block. Problem reported by naddy after our server refused a pack file which was sent by 'got send'. I could reproduce the issue by running the 'gotadmin pack' command on a copy of naddy's repository. ok naddy
Christian Weisgerber 535e07c7 2021-08-29T13:09:21 make realloc_ids() malloc-like and do not overallocate Let realloc_ids() take as argument the number of entries to allocate. Do not allocate an extra chunk. ok stsp
Christian Weisgerber 8f2a2f4f 2021-08-29T11:51:43 drop realloc_ids() initialization calls, one of which had a typo realloc_ids() is called again in the loops that assign to the ID arrays, before the first assignment. ok stsp
Stefan Sperling 27b75514 2021-08-28T10:46:51 do not send a pack file when 'got send' is only deleting branches The git protocol spec says the client MUST NOT send a pack file if the only command used is 'delete'. Fixes 'got send -d' against Github's server which closed the session upon receiving the empty pack file we sent. This problem wasn't caught by regression tests since git-daemon does accept an empty pack file. Problem reported by jrick.
Stefan Sperling 1bd76734 2021-08-26T13:41:59 fix the output of 'got send -d' upon success Previous output was: Already up-to-date New output is: Server has deleted refs/heads/branch Check this behavour in the related regression test.
Stefan Sperling f8a36e22 2021-08-26T12:30:42 add 'got send' command for sending changes to remote repositories Known to work against git-daemon and github Git server implementations. Tests by abieber, naddy, jrick, and myself. Man page additions reviewed by Lucas.
Stefan Sperling 63e5aa5c 2021-08-23T10:51:48 Expose got_ref_name_is_valid() for general purpose use. This will be needed for a future 'got send' command.
Stefan Sperling dc7edd42 2021-08-22T12:58:34 fix miscalculation of the final pack file size reported by got_pack_create()
Stefan Sperling cce2f485 2021-08-22T12:56:14 expose got_ref_resolve_symbolic() at the public library API This will be needed by a future 'got send' command.
Stefan Sperling 0af64e86 2021-08-22T12:54:21 plug a memory leak in an error path of got_deltify()