lib


Log

Author Commit Date CI Message
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.
Stefan Sperling 1af628f4 2021-06-03T12:38:42 switch merge_file_cb() to using merge_file() instead of merge_blob()
Stefan Sperling eec2f5a9 2021-06-03T12:14:35 decouple merge_file() parameters for 2nd derived version and merge target file
Stefan Sperling dc082d4a 2021-06-03T11:57:58 in merge_file(), remove allocation of a base_path which is unused
Stefan Sperling 07bb0f93 2021-06-02T09:26:42 move merge_file()'s f_deriv parameter next to the f_orig parameter
Stefan Sperling db590691 2021-06-02T09:24:51 make merge_file() accept FILEs instead of paths for orig and deriv inputs
Stefan Sperling 67a66647 2021-05-31T09:20:56 refactor merge_file() such that it no longer requires a blob object parameter
Christian Weisgerber f2705486 2021-05-30T15:37:51 dial_git(): fix memory leak and simplify Simplify dial_git() by formatting the initial Git protocol packet with dprintf, suggested by millert, and stop leaking an asprintf buffer. ok stsp
Stefan Sperling 57c18198 2021-05-24T18:25:19 validate reference names in open_ref() This catches invalid reference names passed to 'got ref -l' and will also be needed to validate reference names passed to a future 'gotadmin pack' command. ok naddy@
Stefan Sperling 91b40e30 2021-05-21T20:20:28 add checksum support to got_deflate_to_file() This will eventually be used by 'gotadmin pack'. Checksum init and finalization will need to be done by the caller since many objects will be written out in compressed form while we are computing checksums across the entire pack file. ok millert, naddy
Stefan Sperling af8a5c4a 2021-05-21T20:16:17 plug a memory leak in got_ref_list_free() Code which inserts a reference into a reflist passes ownership of this reference to the list. However, got_ref_list_free() never closed such references, which resulted in a memory leak. ok tracey
Stefan Sperling 9069347b 2021-05-20T09:58:35 improve error reporting when delta application fails
Stefan Sperling dbbf4a5f 2021-05-20T09:51:59 allow got_deltify_free(NULL); will be needed by 'gotadmin pack'
Stefan Sperling 932dbee7 2021-05-19T13:58:22 fix wrong function name in error message; pointed out by Mikolaj Kucharski
Stefan Sperling a486b62b 2021-05-18T13:17:12 ignore SIGWINCH while polling in the main process Avoids an error where tog(1) would exit with "poll: Interrupted system call" while the terminal window was being resized. ok millert
Stefan Sperling a3af57b8 2021-05-10T11:26:06 remove unused worktree-related includes from lib/repository.c
Stefan Sperling 1fee9f40 2021-04-13T08:28:24 fix 3-way merge of files which lack a final \n problem found by jrick ok millert
Stefan Sperling 20662ea0 2021-04-10T13:31:30 introduce 'gotadmin info'
Stefan Sperling 762d73f4 2021-04-10T13:13:56 introduce got_object_open_loose_fd() for library-internal use
Stefan Sperling 509c9973 2021-04-10T13:11:17 add got_packidx_get_packfile_path() for library-internal use
Stefan Sperling c6e8a826 2021-04-05T17:55:12 do not update symlinks which are already up-to-date This fixes spurious 'U' notifications for symlinks during 'got update' that occurred even when the work tree was fully up-to-date. Observed on a work tree of the FreeBSD src repo and reproduced in our test suite by adding a no-op update at the end of a test which deals with updating symlinks.
Stefan Sperling 0f58026f 2021-04-05T17:51:07 add a missing STATUS_EXISTS notification in update_blob()
Stefan Sperling 7495ec13 2021-04-04T14:24:39 fix open file descriptor leak in error path of read_object_header_privsep()
Stefan Sperling ac62b712 2021-03-30T14:50:44 when reading a pack index byte-swap fields at compile-time where possible suggested by mpi@ ages ago
Stefan Sperling 6c414261 2021-03-30T01:26:42 cap pack file cache size at 1/8 of the current open file desciptor limit
Stefan Sperling 61303e6e 2021-03-30T01:22:29 fix off-by-one in got_repo_cache_pack()
Stefan Sperling 159a21e5 2021-03-30T00:48:38 increase pack index cache size from 16 to 64 to improve performance This can make a huge difference on repositories which contain more than 16 pack files, at the expense of additional open file handles. My test case was a ports.git repository with > 60 pack files (these accumulate due to 'got fetch', and 'git repack -a' would condense them). With cache size 16 'got update' in /usr/ports took more than 60 seconds. With cache size 64 the same command took less than 5 seconds. The root cause is probably that mapping and unmapping large files over and over again is expensive on OpenBSD.
Stefan Sperling 4d9042b3 2021-03-24T14:17:56 fix error checking in dial_ssh()
Stefan Sperling 4cc1f028 2021-03-23T15:01:29 fix use of an uninitialized stat buffer during work tree status crawl found by naddy ok naddy jrick
Christian Weisgerber 22403ab7 2021-03-22T16:20:51 deltify.c: explicitly include <endian.h> for be64toh()
Stefan Sperling e600f124 2021-03-21T19:09:35 ensure that old commits remain referenced after rebase and histedit Create automatic "backup" references which ensure that objects from the pre-rebase or pre-histedit state remain in the repository. A new -l option for 'got rebase' and 'got histedit' lists old commits. This makes it easier to recover from botched rebase or histedit operations. Removal of such objects currently requires got ref -d and git-gc. This will be made more convenient in the future. testing and ok jrick
Stefan Sperling 59d1e4a0 2021-03-10T22:49:22 implement raw object data access; this will be required for packing
Stefan Sperling 69aa0e90 2021-03-10T22:49:21 substantial rewrite of deltify.c; operate on plain files only
Stefan Sperling 5788893e 2021-03-10T22:49:21 fix off-by-one error in delta length; from ori git9 commit fbb2fb7c87d8edf58e22c84f575853dc9de79ac4
Stefan Sperling f364801d 2021-03-10T22:49:21 first pass over deltify.c: adapt coding style and data types; make it compile
Stefan Sperling 2a0e67f7 2021-03-10T22:49:21 Ori has authorized a licence change to OpenBSD's license template
Stefan Sperling 56e7a15f 2021-03-10T22:49:21 add deltify.c, unmodified from git9, with license header added
Stefan Sperling bc62ede8 2021-02-26T17:31:35 use Myers diff instead of Patience diff when merging files with diff3 Myers diff tends to divide files into smaller diff chunks, while Patience diff attemps to maximize the size of diff chunks. Smaller diffs chunks generally result in a more managable presentation of merge conflicts.
Stefan Sperling 9dbd8627 2021-02-04T11:11:25 tolerate tag objects which lack tagger timestamp information Fixes interop with repos such as git://github.com/steveicarus/iverilog.git Found by + ok naddy
Stefan Sperling 6e210706 2021-01-22T23:49:46 implicitly mark all files in work tree as up-to-date after 'got integrate' Avoids having to run 'got update' for no good reason after 'got integrate'. The same change was made recently for both rebase and histedit in commit a615e0e7796ea1103a6e0d4b5dbb6134597886660 and we forgot about histedit.
Stefan Sperling 60e40e95 2021-01-22T21:53:05 close file handles before freeing other things in got_worktree_close() The work tree's path needs to be valid while constructing error messages.
Stefan Sperling e7abd6b6 2021-01-22T21:47:37 fix missing close(2) error check in got_worktree_close()
Stefan Sperling 08578a35 2021-01-22T11:05:05 make close(2) failure checks consistent; check 'close() == -1' everywhere ok millert, naddy
Stefan Sperling 56b63ca4 2021-01-22T11:04:47 make fclose(3) failure checks consistent; check 'fclose() == EOF' everywhere ok millert, naddy
Stefan Sperling a6b21eef 2021-01-21T19:10:08 add missing braces around multi-line if-statement in got_worktree_close()
Christian Weisgerber a06ff56f 2021-01-21T18:33:50 fix a use after free() ok jrick stsp
Stefan Sperling 194cb7cb 2021-01-19T07:38:37 fix bug where 'got up -c commit path' deleted unrelated files from work tree Problem reported by Timo Myyrä
Stefan Sperling 99495ddb 2021-01-10T23:48:51 add a 'reference' directive to remote repositories in got.conf(5) Make use of this in 'got clone' to persist -R option arguments given on the command line in the cloned repository's got.conf(5) file.
Stefan Sperling 0c8b29c5 2021-01-05T17:22:14 add a 'fetch-all-branches' configuration setting to got.conf(5) Set fetch-all-branches in the got.conf(5) file created by 'got clone -a' in order to make a future 'got fetch' act like 'got fetch -a' by default.
Stefan Sperling 300ea754 2021-01-05T15:28:52 silence a printf in our gitconfig parser; this code shouldn't print to stdout
Christian Weisgerber 7a90b680 2021-01-02T20:57:19 oops, initialize linesize before calling getline(3); from millert
Christian Weisgerber 9bdd68dd 2021-01-02T20:46:01 replace fparseln(3) with getline(3), for better portability ok stsp
Stefan Sperling f0ff8d4c 2020-12-26T23:14:26 fix tag object leak introduced in previous commit
Stefan Sperling 24202e46 2020-12-26T23:08:51 add tagged object IDs to reference list object ID map Fixes display of "/tags/..." commit ID decorators in tog which was broken in previous commits.
Stefan Sperling a53af95f 2020-12-26T23:04:46 fix error return from got_reflist_object_id_map_create()
Stefan Sperling f193b038 2020-12-26T22:39:55 rename got_reflist_object_map_free to got_reflist_object_id_map_free
Stefan Sperling d9dff0e5 2020-12-26T21:32:01 switch reflist to TAILQ; insert elements more efficiently for sorted input ok naddy
Stefan Sperling 84de9106 2020-12-26T20:48:43 Add a refs argument to got_repo_match_object_id(), replacing 'resolve_tags' Make use of this where possible to avoid re-reading references from disk. ok naddy
Stefan Sperling 7b5b670e 2020-12-25T21:38:17 implement an object ID map for reference lists ok naddy
Stefan Sperling 4c4ce67b 2020-12-25T21:38:17 fix assignment to wrong pointer in got_ref_dup() ok naddy
Stefan Sperling 9a02f8b7 2020-12-21T12:59:27 switch to strerror_r(3) in error.c for thread-safety
Stefan Sperling c884fd0a 2020-12-21T12:59:27 introduce got_custom_error array to support multiple errors in flight This is still not thread-safe but at least avoids errors overwriting each other in single-threaded contexts.
Stefan Sperling ccf6dd5e 2020-12-19T14:09:38 avoid signed vs unsigned comparisons in fetch.c ssizeof() macro idea courtesy of millert@ ok millert@
Stefan Sperling 5a8b373c 2020-12-18T15:55:18 fix parsing of tag objects which lack a tag message This problem could be triggered with the u-boot repository: $ git clone --bare https://gitlab.denx.de/u-boot/u-boot.git $ got log -r u-boot.git got-read-pack: bad object data got: bad object data $
Stefan Sperling e8bfb8f3 2020-12-18T15:52:25 fix path existence check in got_object_tree_path_changed() A symptom of this was a segfault in 'got blame distrib/miniroot/install.sub' with the OpenBSD src.git from github, reported by jrick. The problem was that the commit graph traversed one commit too far. This could be more easily reproduced with 'got log': got log -c 05f568 -P distrib/miniroot/install.sub Which listed two commits instead of just the first one: 05f568ecc6aadefa1aff9064a29e798874a71409 <-- install.sub first created here 7c0d87f00e480cdf004324dad6f3e6f4418f8f42 "distrib/miniroot" exists in 7c0d87f00e480cdf004324... but not in the parent of this commit. Ensure that we traverse the full path in tree1 even if an intermediate tree2 cannot be opened. Instead of reporting success and a file change if we can't traverse further through tree2, we now hit this failing attempt to open the file 'install.sub' in tree object 180aa33df8d1 (tree1): te1 = find_entry_by_name(tree1, seg, seglen); if (te1 == NULL) { err = got_error(GOT_ERR_NO_OBJ); goto done; } fix tested and ok jrick
Yang Zhong 6d5a9006 2020-12-16T11:16:27 add fd field to got_repository, modify got_packidx_open to use fds These changes are intended to make got more compatible with FreeBSD's Capsicum. ok stsp
Stefan Sperling a615e0e7 2020-12-16T00:08:58 implicitly mark all files in work tree as up-to-date after rebase/histedit This should always be correct, since rebase and histedit start out with a clean and single-base-commit worktree, and end up committing all changes across the entire work tree when they are successful. tested by jrick and myself
Stefan Sperling 73e7eb7d 2020-12-15T23:45:34 add got_error_fmt() got_error_fmt() could eventually replace got_error_path() which has already been used to construct errors with strings that are not actually paths... ok millert@
Stefan Sperling 4cc6a5a5 2020-12-15T22:42:20 add got_error_from_errno_fmt() for more flexibility in error messages suggested by and ok millert
Yang Zhong 437adc9d 2020-12-10T08:29:04 add fd field to got_worktree, modify got_fileindex_entry_update to use fds These changes are intended to make got more compatible with FreeBSD's Capsicum. ok stsp
Stefan Sperling f3b2b552 2020-12-10T16:58:11 sync files from diff.git b3fd1fa284e6207b923bd3c887364d9eb93fb340
Stefan Sperling 785d65a4 2020-12-05T22:11:32 make got_repo_object_match_tag() work with absolute reference names Bug triggered by naddy while testing a patch for tog. ok naddy
Stefan Sperling 41ad2652 2020-12-04T20:27:43 remove unused function got_path_get_absolute(); realpath(3) is usually better
Stefan Sperling dbb02f4d 2020-12-04T20:23:06 in got_repo_open(), let realpath(3) take care of relative paths
Christian Weisgerber 5e9266f9 2020-11-28T18:35:49 fix a typo that triggered "munmap: Invalid argument" in got blame on FreeBSD ok stsp
Stefan Sperling 16aeacf7 2020-11-26T12:54:19 use size_t for loop indices to avoid signedness warnings; from emaste@freebsd
Stefan Sperling 9c659ea0 2020-11-22T13:25:32 do not forget to add an offset for line zero in diff_blobs() Fixes a problem in 'tog diff' where the first line of the output was cut off.
Stefan Sperling 763f29f6 2020-11-22T01:51:29 remove redundant lines of code from close_file2_and_reuse_file1()
Stefan Sperling 751e0afb 2020-11-22T01:34:05 sync files from diff.git 86b603da3068dce115470492279dc6f86f17f60b
Stefan Sperling c354056f 2020-11-21T15:34:19 prevent potential fclose(NULL) in error path of diff_blobs()
Stefan Sperling 1cb46f00 2020-11-21T15:34:19 consistently label removed files as "/dev/null" in diff headers
Stefan Sperling c4cd9c5b 2020-11-21T15:34:19 sync files from diff.git e4c510c1d83fe01247b6f59d855dffad81e4f26a
Stefan Sperling b4737997 2020-11-21T14:53:47 handle binary files in blame's custom file diff atomizer
Stefan Sperling 64453f7e 2020-11-21T13:35:00 handle binary files in got/tog diff commands; add -a options to force text
Stefan Sperling b67f3bcb 2020-11-21T10:49:25 sync files from diff.git e51ebd83fa731d197ee4074ee2e94dbc0581078c
Stefan Sperling 8c35ff14 2020-11-19T15:37:46 implement custom atomizer for blame to reuse data and mappings across commits
Stefan Sperling 89dc8b78 2020-11-19T15:37:20 remove stdbool.h where it's not needed
Stefan Sperling be659d10 2020-11-18T17:18:23 fix type of filesize output parameter of got_object_blob_dump_to_file()
Stefan Sperling c33ebc60 2020-11-18T17:05:28 reallocate line_offsets array less often in got_object_blob_dump_to_file()