libexec

Branch


Log

Author Commit Date CI Message
Stefan Sperling 26e6f38e 2022-07-03T11:32:59 rename got.conf(5) mirror-references to mirror_references for consistency Existing configuration files will keep working for now since the old name with dashes is still recognized by the config parser.
Stefan Sperling f1bf60d1 2022-07-03T11:27:02 rename got.conf(5) fetch-all-branches to fetch_all_branches for consistency Existing configuration files will keep working for now since the old name with dashes is still recognized by the config parser.
Josh Rickmar 4d5ee956 2022-07-02T21:27:21 create and verify tags signed by SSH keys This adds a new -s flag to 'got tag' that specifies the signer identity (for example, a key file) of the tagger. The tag object will include a signature that validates each of the tag object headers and the tag message. Verifying these signed tags requires maintaining an allowed signers file which maps signer identities (i.e. the email address of the tagger) to SSH public keys. See ssh-keygen(1) for more details of the allowed signers file. After creating this file and providing the path to it in got.conf(5) using the allowed_signers option, tags may be verified using with 'got tag -V tag_name'. The return code will be non-zero if a signature fails to verify. ok stsp@
Omar Polo acf749fc 2022-07-02T13:56:21 refactor the patch parser Introduce a patch_start routine that finds the next "diff" header (if there is one); the idea is to persist some state (commit id and wether it's a "git diff") while processing the content of the diff. It's needed because in the case of 'got diff' some information like the commit id are only present once at the beginning. As a consequence, the patch parser becomes slightly more robust (concatenating diffs produced by different means shouldn't confuse it anymore) and drops the support for "old" got diffs, the ones previous the introduction of the "commit -/+" header. ok tracey@
Stefan Sperling 61af9b21 2022-06-28T11:31:11 implement support for commit coloring in got-read-pack for speed ok op, tracey
Omar Polo db0dfdd7 2022-06-27T18:47:02 got patch: handle git-style diffs for the 3-way merge too tweak and ok stsp@
Omar Polo 497a5915 2022-06-27T18:47:02 handle blob ids without corresponding blob ids ok stsp@
Stefan Sperling 8469d821 2022-06-25T09:25:07 always show commit or tree IDs in diff header, in order to help 'got patch' The idea is that got patch can simply look for a line such as: commit - abcde1234567... to find the merge base commit ID to show in diff3 conflict markers. got log -p now displays commit IDs in its diff header, instead ofl tree or blob IDs. ok op@
Omar Polo 336075a4 2022-06-25T09:22:02 build with -Wmissing-prototypes ok stsp@
Omar Polo d8b5af43 2022-06-19T11:51:33 use the commitid in the patch diff3 conflict header suggested by and ok stsp@
Omar Polo 55e9459f 2022-06-19T11:51:32 got patch: use diff3 to merge the changes Parse the "blob -" metadata in diffs produced by 'got diff' and use the original file for patching. Then, use the diff3 with the current version of the file to merge the differences. This solves many failures automagically or at least turns them into a conflict. ok/improvements stsp@
Stefan Sperling 89a34d6e 2022-06-18T16:32:12 wrap an overlong line in enumeration_request()
Stefan Sperling a5e587e0 2022-06-14T22:32:11 fix a bug in got_privsep_send_object_idlist() exposed by recent changes The old code did not work correctly if only a single object Id was to be sent to got-read-pack. Make got-read-pack error out if the list of commits for object enumeration is empty to catch this problem if it occurs again. Found by the send_basic test, which was failing with GOT_TEST_PACK=1 ok tracey
Stefan Sperling db9b9b1c 2022-06-14T20:26:15 let got-read-pack be explicit about whether it could enumerate all objects This allows the main process to avoid looping over all object IDs again in case the pack file used for enumeration is complete. ok op@
Stefan Sperling ffe3518f 2022-06-14T18:50:43 fix wrong arguments to calloc(3) in enumeration_request()
Omar Polo 35095610 2022-06-14T10:35:07 got patch: use ints for line offsets instead of longs ints have the advantage that their size is more likely to be the same across the various architecture supported by OpenBSD, thus introducing less possible differences. INT_MAX is still (at least) a few order of magnitudes higher than the patches we dealt with (even abnormal ones.) suggested by stsp@
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 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 cee6a7ea 2022-06-07T15:56:46 implement object enumeration support in got-read-pack ok op@
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@
Stefan Sperling 1453347d 2022-05-19T07:14:21 imsg_add() frees its msg argument on error; avoid double-free in error paths
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@
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 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 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@
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@
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@
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@
Stefan Sperling c0591751 2022-03-24T12:17:45 link libexec helpers against _p libraries when building with 'make PROFILE=1'
Stefan Sperling e260f8ae 2022-03-22T11:55:38 fgetc() returns int, not char; fixes -Werror build on armv7
Omar Polo b3c57ab2 2022-03-22T11:20:46 got patch: handle "\ No newline at end of file"
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 d58ddaf3 2022-03-17T20:02:40 const-ify tables ok thomas_adam millert
Omar Polo 46ebad13 2022-03-17T16:38:43 style
Omar Polo 423faaa6 2022-03-12T16:01:09 got-read-patch: plug memory leak
Omar Polo e9ce266e 2022-03-07T22:26:08 add `got patch' command for applying unified diffs
Stefan Sperling bed00385 2022-02-23T12:29:32 apply time-based rate-limiting to got-send-pack upload progress output
Stefan Sperling dcb64fea 2022-02-23T12:24:25 apply time-based rate-limiting to got-fetch-pack download progress output
Stefan Sperling d0f1e2f1 2022-02-23T12:13:03 apply time-based rate-limiting to got-index-pack progress output
Stefan Sperling 67fd6849 2022-02-13T00:10:25 reuse existing deltas when creating pack files tested by thomas, naddy, and myself
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 c0df5966 2021-12-31T09:33:01 wrap overlong lines
Stefan Sperling 8347f8e7 2021-10-15T17:17:52 plug memory leak in an error path of read_packed_object()
Stefan Sperling 07965a0d 2021-10-15T17:08:54 fix wrong function names in error messages from got-index-pack.c
Christian Weisgerber 0c82d267 2021-10-15T15:18:30 sync with OpenBSD parse.y Explicitly cast "char" to "unsigned char" when assigned to "int" to prevent sign extension from breaking comparions against EOF or passing invalid arguments to ctype functions.
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
Christian Weisgerber 5d8cbca3 2021-09-29T19:53:08 pull in a type fix from the OpenBSD parse.y template Original commit message by deraadt: (unsigned) means (unsigned int) which on ptrdiff_t or size_t or other larger types really is a range reduction... Almost any cast to (unsigned) is a bug.
Christian Weisgerber 14af9299 2021-09-28T19:21:34 fix unsigned/signed char mismatch in parse.y ok stsp
Stefan Sperling 474b4982 2021-09-25T10:26:25 whitespace fix from Omar Polo
Stefan Sperling 030daac8 2021-09-25T10:26:13 fix some integers that had a slightly wrong type; patch by Omar Polo
Stefan Sperling 50127d69 2021-09-25T10:24:15 add 'static' qualifier to local functions in got-read-pack; patch by Omar Polo
Stefan Sperling fda3525e 2021-09-25T10:23:12 mark some function parameters as 'const', as they should be; patch by Omar Polo
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.
Christian Weisgerber abc59930 2021-09-05T19:41:03 indentation fixes
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 c2d7bc3f 2021-08-31T19:11:16 remove superfluous strdup(3) from parse.y files; Patch by Martin Vahlensieck
Christian Weisgerber 93f8a337 2021-08-30T16:34:04 tweak implementation of separate send {} and fetch {} conf blocks Tweak man page. Factor out repeated code in if/else branches in send_gotconfig_remotes(). ok stsp@
Tracey Emery f08eaca0 2021-08-30T15:59:11 reintroduce allowing empty fetch and send blocks with correct grammar. ok stsp@
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 92952c0e 2021-08-30T12:33:22 stop allowing empty send {} or fetch {} blocks; yacc complained about grammar yacc has been complaining about "shift/reduce conflicts" since commit 16c4be8c1cab9456f9dd0468c27f8ab73235737e Revert that change for now. Not sure how it can be done properly. In any case, allowing empty config blocks is not very important.
Stefan Sperling 7c84ef07 2021-08-29T19:50:57 reject port number zero
Stefan Sperling f1cacac7 2021-08-29T17:07:49 validate non-optional settings in send {} and fetch {} config blocks.
Stefan Sperling aaf30ee7 2021-08-29T17:07:24 rename variables to avoid too much repetition of the term 'repo'
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 2ae2891d 2021-08-28T10:23:24 remove github capabilities workaround from got-send-pack, it is not needed This workaround was inherited from git9, which claims that Github did not send capabilities. Protocol traces show that Github's server does in fact advertise its capabilities. Git protocol capabilities are hidden behind a NUL byte in the middle of the first refline sent by the server. This makes them easy to miss when treating a refline as a C string. I guess this is why Ori concluded that Github didn't send any capabilities. Or perhaps Github has been fixed since.
Tracey Emery 26ac815f 2021-08-27T19:48:23 remove unused name variables, noticed by naddy@
Tracey Emery 0ff2bf46 2021-08-27T19:37:15 clean up weird grammar. not sure what i was thinking.
Tracey Emery 16c4be8c 2021-08-27T19:32:56 fix to allow empty send and fetch blocks, ok stsp@
Tracey Emery cfd92333 2021-08-27T16:58:26 add send and fetch plumbing to parser for got.conf This is the beginning of support for naddy's suggestion to break this out similar to git. More code to come from stsp. ok stsp@
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 8991a328 2021-08-26T07:08:48 add a missing bounds-check in got-fetch-pack when parsing server response The tokenize_refline() function could end up reading past the end of the buffer if the refline is not terminated with whitespace or \0.
Stefan Sperling a90356f7 2021-08-26T07:01:34 prevent NULL deref in got-fetch-pack if server does not announce capabilities The my_capabilities pointer may remain NULL. Check for NULL before use.
Stefan Sperling 14d2b281 2021-08-25T21:40:38 fix the error message shown when the server sends a bad ref line Exposed by trying to run got clone -l against shithub.us over git:// found by abieber@
Stefan Sperling 9ca26ac3 2021-08-06T13:31:40 style fix: avoid comparison of pointer variable against 0 in got-fetch-pack
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 12f2167a 2021-07-04T16:24:52 add checksum parameters to got_inflate functions which did not provide them yet
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
Stefan Sperling 40e3cb72 2021-06-22T19:01:44 fix raw object size sent by got-read-pack
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 282f42e5 2021-06-05T09:51:24 remove stray debug print which was accidentally committed
Stefan Sperling e5ad7365 2021-05-20T09:51:59 fix file descriptor leak when got-read-object returns a raw object
Stefan Sperling 59d1e4a0 2021-03-10T22:49:22 implement raw object data access; this will be required for packing
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 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 98f64f14 2021-01-05T17:17:58 work around spurious ACK responses from git servers in got-fetch-pack The Git server can apparently send duplicate ACK responses even though we do not enable the multi_ack capability. According to the Git protocol docs the server should only send ACKs after receiving 'done' from the client if multi_ack has been enabled. However, a duplicate ACK response can be triggered by running 'got fetch -a' in our fetch_update_tag test. This resulted in the following error: got-fetch-pack: unknown side-band received from server got: bad packet received
Stefan Sperling 85f4e1e7 2020-12-17T16:17:51 fix the type of variable 'idx' in update_packidx()
Stefan Sperling 6059809a 2020-12-17T15:54:47 use size_t for loop indices to avoid signedness warnings; by emaste@freebsd Same change as 16aeacf7088d, for subdirectories other than lib/
Stefan Sperling 20b7abb3 2020-10-22T20:36:23 detect unknown repository format extensions (such as sha256 format) ok millert
Christian Weisgerber 62d463ca 2020-10-20T22:43:59 indentation fixes