lib


Log

Author Commit Date CI Message
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()
Stefan Sperling dd29967c 2021-08-22T12:53:22 make got_deltify() rellocate the deltas array less often
Stefan Sperling 72acb3d8 2021-08-06T12:43:33 remove unused 'repo' argument from got_reflist_insert()
Stefan Sperling b9c41b54 2021-08-03T08:08:03 use less memory allocations when formatting log messages Rewrite got_object_commit_get_logmsg() such that only one memory allocation is made when creating a pretty version of a log message. ok naddy@
Stefan Sperling ef8ec606 2021-07-27T13:08:52 prevent a race where 'gotadmin cleanup' deletes concurrently created objects
Stefan Sperling 3f338f0a 2021-07-27T13:08:51 track the last modification time of references
Stefan Sperling c3564dfa 2021-07-15T07:48:40 don't scan pack index offsets for large values if pack file is < 2GB This saves an iteration over the entire h->offsets array when opening a pack index which should not contain large offsets in the first place. ok millert@
Stefan Sperling d5c81d44 2021-07-08T11:03:29 verify object ID checksums while loose objects are being accessed
Stefan Sperling 4f655d1b 2021-07-08T10:37:01 sync files from diff.git 9879b82a581a245e365fb159488c4294c318d8b3
Stefan Sperling ff56836b 2021-07-08T10:30:10 Make 'got add' always require the -I option in order to add ignored files.
Stefan Sperling 1124fe40 2021-07-07T17:21:52 handle pack index files which lack a corresponding pack file ok millert
Stefan Sperling aea75d87 2021-07-06T07:57:00 make got_packidx_get_packfile_path() usable for callers who only have a path
Stefan Sperling 5345b4c7 2021-07-06T07:39:36 allow lockfiles to be used in cases where we have a dir_fd and a relative path
Stefan Sperling 12f2167a 2021-07-04T16:24:52 add checksum parameters to got_inflate functions which did not provide them yet
Stefan Sperling 9614da0d 2021-07-04T10:27:59 avoid searching the pack index twice in 'gotadmin cleanup'
Stefan Sperling 2252c019 2021-07-03T22:55:27 Update a code comment regarding support of the preciousObjects extension.
Stefan Sperling 9188bd78 2021-07-03T22:51:03 add support for the preciousObjects Git extension to 'gotadmin cleanup'
Stefan Sperling 4b2e47fb 2021-07-03T19:49:37 fix memory leak in error path of load_commit_or_tag()
Stefan Sperling b3d68e7f 2021-07-03T19:49:37 implement 'gotadmin cleanup'
Stefan Sperling 07165b17 2021-07-01T14:57:10 cache object type in memory to speed up packing of objects referenced by tags
Stefan Sperling ae23ce34 2021-07-01T14:57:10 fix inverted check guarding recallocarray() calls in get_reflist_object_ids()
Stefan Sperling 372b6d8e 2021-07-01T14:30:26 remove unused function got_object_idset_lookup_data(); same code as idset_get()
Stefan Sperling f4a2ff2d 2021-07-01T14:10:33 fix out-of-bounds access in 'gotadmin pack'; wrong array pointer in read_meta()
Stefan Sperling 2c41dce7 2021-06-27T15:30:08 allow obstructed files skipped by 'got update' to be updated again
Stefan Sperling a769b60b 2021-06-27T09:22:52 fix a bug where files skipped by 'got update' could not be updated again ok semarie@
Christian Weisgerber dbdddfee 2021-06-23T20:48:35 switch from SIMPLEQ to equivalent STAILQ macros The singly-linked tail queue macros were added to OpenBSD 6.9 and are more widely available on other systems. ok stsp
Christian Weisgerber c8d1f14f 2021-06-23T15:39:58 explicitly include <endian.h> for be32toh()
Stefan Sperling 08736cf9 2021-06-23T10:16:23 fix imsg header includes in pack_create.c
Stefan Sperling f6343036 2021-06-22T20:00:44 new -I option for 'got status' to show files which match an ignore pattern
Stefan Sperling 05118f5a 2021-06-22T19:37:20 implement gotadmin pack, indexpack, and listpack commands
Stefan Sperling e6bcace5 2021-06-22T19:34:53 initial port of git9's pack file creation code to gameoftrees; thank you, Ori!
Stefan Sperling 136ec6c9 2021-06-22T19:18:55 forward-declare struct got_packidx to make got_lib_pack.h self-contained
Stefan Sperling c4330eff 2021-06-22T19:11:54 expose got_pack_parse_ref_delta() for library-internal use This will be needed by a future 'gotadmin listpack' command.
Stefan Sperling 02828bfd 2021-06-22T19:05:05 expose got_packidx_get_object_offset() for library-internal use This will be needed by a future 'gotadmin listpack' command.
Stefan Sperling 1c4cdd89 2021-06-20T21:07:54 fix bogus 'permission denied' error when a file at work tree root is removed ok naddy
Stefan Sperling b4f37570 2021-06-19T16:32:39 mark got_pack_stop_privsep_child() static; it is only used inside pack.c
Tracey Emery cc2a8ef4 2021-06-19T16:12:52 fix a leaky ibuf. ok stsp
Stefan Sperling 779e1159 2021-06-18T14:14:49 expose the reflist_insert() helper function as got_reflist_insert() This will be needed by 'gotadmin pack'.
Stefan Sperling 9a8dc2b3 2021-06-18T14:10:55 fix deltas with trailing data that is smaller than the minimum chunk size
Stefan Sperling 740bba1c 2021-06-18T14:07:35 allow the delta base file to lose its header between deltify_init and deltify This simplifies pack file creation. A delta base could be read from a loose object, a packfile, or it might be available in a temporary file. All these cases can now be handled the same way. We may need to open, close, and re-open a given delta base multiple times while packing.
Stefan Sperling 7550e799 2021-06-18T13:59:46 check for errors from emitdelta() in got_deltify()
Stefan Sperling aa51f4a4 2021-06-18T13:57:59 handle fseek in got_deltify() instead of in stretchblk(); simplifies the code
Stefan Sperling a8591711 2021-06-18T13:52:26 raw object size should not include the length of the object's header This way, the size of a raw object is the same regardless of whether the object was found in a loose object file or in a pack file.
Stefan Sperling 9ca9aafb 2021-06-18T13:36:51 introduce got_object_id_queue_copy() This will be required by a future 'gotadmin pack' command.
Stefan Sperling 74a2356f 2021-06-18T13:34:45 add a user data pointer to struct got_object_qid This will be required by a future 'gotadmin pack' command.
Stefan Sperling f34b169e 2021-06-18T13:28:25 Allow for skipping the base object header in got_deltify().
Stefan Sperling 9ec58fff 2021-06-17T15:41:49 use socketpair(2) instead of pipe(2) for bi-directional communication On Linux, pipes returned from pipe(2) only work in one direction. This broke 'got clone' over ssh in the -portable version because got-fetch-pack assumes it can use its fetchfd for both reading and writing. I wrote a complicated diff to use two pipe(2) calls instead of one, but millert suggested a simpler solution: Use socketpair(2) instead of pipe(2). ok millert jrick tracey
Stefan Sperling fdf3c2d3 2021-06-17T09:01:05 use Patience diff for merging during cherrypick/backout/histedit/rebase This has been shown to prevent mis-merges in some cases. It's probably not a final solution. We should look at what Git's "recursive merge" is doing and implement something similar. Keep using Myers during update/unstage. The advantage of Myers is that it produces smaller conflict chunks, and there are no known cases of mis-merges which affect update/unstage.
Stefan Sperling 1d0f4054 2021-06-17T08:56:43 check for close(2) error in got_repo_close() and propagate errors up ok tracey
Tracey Emery 991ff1aa 2021-06-15T22:16:22 close all opened repo->gitdir_fd's and set open_repo static. ok naddy (with static change)
Stefan Sperling 0d15f6dc 2021-06-13T17:03:59 in addblk(), only read data into buffer1 if we will compare it to buffer2 suggested by and ok naddy@
Stefan Sperling 68bdcdc2 2021-06-11T17:10:50 addblk() may seek in its input file; reposition the file pointer afterwards
Stefan Sperling a893025f 2021-06-11T17:02:57 addblk: iterate over the correct number of entries after growing the array ok naddy
Stefan Sperling e89540a9 2021-06-11T17:02:13 addblk: be more careful about expanding the blocks array when we outgrow it fixes + ok naddy
Stefan Sperling 51a494da 2021-06-11T17:00:02 check a block's hash as well as its length before expensive comparisons suggested by + ok naddy, and Ori agrees
Stefan Sperling 0c9eeee2 2021-06-05T09:32:56 avoid uninitialized error being returned from got_repo_get_packfile_info()
Stefan Sperling 3b9e6fcf 2021-06-05T09:28:54 simplify deflate checksumming code; fixes errors with upcoming 'gotadmin pack' tweak + ok naddy
Stefan Sperling 54d5be07 2021-06-03T13:12:58 fix unrelated changes being merged by got cherrypick/backout/rebase/histedit This was a long-standing and very annoying bug. The two xfail tests in the cherrypick test suite are passing now.