got/got.c

Branch


Log

Author Commit Date CI Message
Stefan Sperling ef98a369 2022-07-04T11:05:06 got tag -V is like tag -l with verification, fix option-conflicts accordingly
Stefan Sperling 78817826 2022-07-04T09:57:16 add -v option to 'got tag' usage string
Stefan Sperling 153d5e58 2022-07-04T09:55:03 add option-conflict handling for 'got tag' -s and -V options
Stefan Sperling ca61ceca 2022-07-04T09:54:09 add -V option to 'got tag' usage string, and replace underscore with a hyphen
Josh Rickmar 91d845ad 2022-07-03T21:44:01 fix tag signing when the key file does not exist This should fail without creating any tag. Before, ssh-keygen(1) would print an error to stderr, but got would create an unsigned tag. ok op@
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 501834af 2022-07-02T21:18:05 fix leftovers from long -> int change when changing the line addresses to be int from long the report callaback was forgotten.
Omar Polo a92a2042 2022-07-02T21:16:13 got patch: handle mangled whitespaces This makes 'got patch' try to ignore whitespaces when trying to match a hunk. Discused with and ok stsp@
Stefan Sperling 4b752015 2022-06-30T21:35:28 switch 'tog diff' and 'tog blame' to Myers diff for speed Make the choice of diff algorithm configurable by diff API users. The got and gotweb programs keep using Patience diffs which are prettier than Myers. But tog should be as fast as possible since it is being used interactively. If performance of Patience diff gets improved later we can consider switching tog back over to it. ok tracey jamsek
Stefan Sperling 49d4a017 2022-06-30T10:43:37 move more opentemp out of diffreg.c ok tracey
Tracey Emery e6e73e55 2022-06-30T08:41:14 move remaining got_opentemp's out of blame. ok op@
Stefan Sperling 8c4a6db8 2022-06-29T14:58:58 make it possible to show just one tag with 'got tag -l' suggested by jrick ok jrick jamsek
Stefan Sperling f9d37699 2022-06-28T20:33:41 move got_opentempfd() out of lib/diff.c again ok tracey
Tracey Emery 1b484788 2022-06-28T18:34:57 move got_opentempfd out of blame_open ok stsp@ jrick@
Tracey Emery eb81bc23 2022-06-28T13:27:12 move got_opentempfd out of open_blob. 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@
Stefan Sperling 61bce19e 2022-06-15T19:19:28 revert "clear the rest of the pack_fds pointers" There is no need to clear local variables before returning from a function. ok tracey
Tracey Emery bb1c2cf3 2022-06-15T15:37:20 clear the rest of the pack_fds pointers
Tracey Emery 0ae84acc 2022-06-15T13:52:20 move got_opentempfd out of got_repo_open. ok stsp@ thanks for all the help massaging this diff
Stefan Sperling 85c34e74 2022-06-13T09:37:38 fix error case handling in print_commit_oneline(); pointed out by 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@
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 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 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 b72706c3 2022-06-01T05:08:20 move creation of tempfiles outside of lib/diff.c ok 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
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 86187278 2022-04-23T08:09:03 mention -p in usage_patch
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 728ed142 2022-04-19T15:09:57 simplify apply_unveil in cmd_patch: the worktree is not optional
Stefan Sperling 3d1a1e4c 2022-04-13T19:35:01 fix a double-free in an error case of cmd_checkout()
Stefan Sperling ffd9dda7 2022-04-10T11:34:02 make 'got tag' unlock the work tree earlier when creating tags The work tree was only held open in order to find its got.conf file since this file could contain a tagger name to use. Read the tagger name earlier. Once the tagger name is known we can close the work tree already.
Stefan Sperling 2a261ce7 2022-04-09T17:40:16 make 'got tag -l' unlock the work tree earlier to allow other parallel commands
Stefan Sperling a091f71a 2022-04-09T17:37:21 make 'got cat' not search for a work tree if the -r option is used Fixes failures in our test suite if 'got tag -l | less' is used in the work tree while cmdline tests are running.
Stefan Sperling 67ba6161 2022-04-08T09:14:02 leave work tree in a usable state after 'got rebase' fails path-prefix checks reported by naddy
Stefan Sperling 392891ce 2022-04-07T13:20:47 pass an already open commit object to the blame callback ok op@
Stefan Sperling a44927cc 2022-04-07T12:57:31 stop relying on commit cache for good performance of got_object_id_by_path() Instead of internally opening and closing the same commit object over and over again, require callers to pass an open commit object in. Avoids an inherent dependency on the commit object cache for reasonable performance. 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@
Omar Polo 3e99fbc5 2022-03-23T20:59:29 plug a memory leak in list_refs(), ok stsp@
Omar Polo 60aa1fa0 2022-03-17T16:38:43 augment patch progress callback with hunks info; recover from errors Augment got_patch_progress_cb by providing the hunks that were applied with offset (or that failed) and the recoverable error encountered during the operation (bad status, missing file, ...) got_patch now proceeds when a file fails to be patched and exits with GOT_ERR_PATCH_FAILED if no other errors are encountered. While here, also add a test for the 'hunk applied with offset' case and shrink test_patch_dont_apply and illegal_status by taking advantage that 'got patch' doesn't stop at the first error. (And add some other cases to illegal_status too.) discussed with and ok stsp@
Omar Polo 2be5e1a2 2022-03-16T18:23:03 got patch: keep permissions after patching a file ok stsp@
Omar Polo b22138f5 2022-03-16T15:41:10 introduce got_patch_progress_cb This introduce a proper got_patch specific progress callback that is invoked after processing a patch. It also drops the hackish printf in the modified case and takes `nop' out of the struct got_patch. ok stsp
Stefan Sperling b8af7c06 2022-03-15T10:45:02 print additional progress information while packing ok op@
Omar Polo 899fcfdf 2022-03-13T20:31:44 add a dry-run/nop mode for got patch with lots of help from stsp for the manpage bits!
Omar Polo dbda770b 2022-03-13T15:36:56 check file status before applying the patch Don't allow `got patch' to delete files that are not known, or add files that are already known and to edit files that are known, not obstructed and without conflicts.
Stefan Sperling f7fce2e2 2022-03-12T19:29:39 make got log, diff, blame, tree, and cat unlock the work tree earlier These commands perform potentially long-running operations on the repository after reading information from the work tree. There is no need for them to keep the work tree locked until the end. Doing so blocks other commands the user may want to run concurrently. For example, the user may want to be able to run 'got diff' in the work tree while browsing 'got log' output in less(1). Pointed out by Misha on gameoftrees IRC.
Omar Polo ca6444c5 2022-03-11T17:25:33 got patch: re-add forgotten lseek otherwise got-read-patch can't parse any patch because the position indicator is at the end of file. While here fix the return too and set patchfd to -1 on error (stsp suggestion.) ok thomas, stsp
Christian Weisgerber 39479dae 2022-03-10T22:29:28 make "got cherrypick/backout" match argument against refs before object IDs Use got_repo_match_object_id() instead of hand-rolled code and pick up the updated handling of reference arguments. ok stsp
Christian Weisgerber d8247bfd 2022-03-10T21:23:31 make "got ref" match argument against references before object IDs Use got_repo_match_object_id() instead of hand-rolled code and pick up the updated handling of reference arguments. ok stsp
Omar Polo d955343d 2022-03-08T16:01:03 pass the callback data instead of hardcoding NULL, ok stsp
Omar Polo e9ce266e 2022-03-07T22:26:08 add `got patch' command for applying unified diffs
Christian Weisgerber 3e166534 2022-02-16T18:32:17 const-ify command and option tables ok stsp
Josh Rickmar e546352c 2022-02-16T17:03:02 remove stray tab that snuck in
Josh Rickmar bdc78ba6 2022-02-16T16:32:54 display GMT offset in cat command ok stsp
Christian Weisgerber b5934965 2022-02-12T21:48:46 shrink the width of formatted output fields to their expected size Replace FMT_SCALED_STRSIZE with (FMT_SCALED_STRSIZE - 2) as field width when formatting output for printing. FMT_SCALED_STRSIZE includes space for a nul byte and a minus sign. Output values are expected to be always positive here. ok stsp
Omar Polo 5a20d08d 2022-02-09T14:59:46 tweak error reporting due to invalid numbers Use the same idiom as in the strtonum(3) manpage which produces a more readable error message. OK kn, stsp
Omar Polo 1d918cf9 2022-02-06T14:56:36 improve error message due to malformed `author' in got.conf tweak and ok stsp@
Stefan Sperling 4e12cd97 2022-01-25T22:48:26 make 'got rm' behave like rm(1) for paths found missing on disk ok millert@
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 8a4f8535 2021-12-27T05:19:52 fix NULL dereference in 'got clone' if server sends an empty pack file
Stefan Sperling f76670f0 2021-11-20T11:33:31 add got branch -t option to sort listed branches by modification time
Stefan Sperling 0f104432 2021-11-20T11:05:27 add got ref -t option to sort listed references by modification time
Josh Rickmar 3d42b266 2021-11-03T21:42:33 switch branches during noop rebases Always update to the specified branch even if the branch is already rebased (no commits needed to be rebased, and the branch does not need a fast forward). With the old behavior of erroring and staying on the current branch, I sometimes found myself ignoring the error message, treating it as information and assuming the branch update, and later on committing on top of origin/main instead of the main branch. feedback and ok stsp
Stefan Sperling 10a623df 2021-10-11T18:38:33 sort and de-duplicate work tree path command line arguments This is important in cases like 'got diff file.txt file.txt' which should only show the diff for file.txt once. suggested by kn@
Stefan Sperling 51ed7429 2021-10-10T15:24:21 align 'diff -c' usage help with synopsis given in man page; suggested by naddy
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 8f83a264 2021-10-09T10:09:50 remove code which was setting up repo_path redundantly from cmd_diff()
Stefan Sperling e7ffb0b0 2021-10-07T21:13:05 add support for multiple path arguments to 'got diff' positive feedback from Omar and kn ok kn
Stefan Sperling 41f061b2 2021-10-05T14:06:02 ignore unversioned files while aborting rebase, histedit, merge or operations ok jrick
Stefan Sperling b93c7142 2021-10-01T06:22:27 add histedit -e option which runs the 'edit' script command for every commit ok jrick
Stefan Sperling cd33da48 2021-09-28T21:39:34 interrupt 'got histedit' upon missing/unversioned/not-deleted files
Stefan Sperling 1fa49072 2021-09-28T21:30:53 interrupt 'got rebase' upon missing/unversioned/not-deleted files
Stefan Sperling c1b05723 2021-09-28T20:56:05 make 'got merge' interrupt the merge upon undeleted and unversioned files
Stefan Sperling 35ca1db7 2021-09-28T20:56:04 print additional stats about things that went wrong during a merge
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 088449d3 2021-09-26T17:51:38 implement 'got merge -n' which interrupts before creating a merge commit
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 1acd48bc 2021-09-24T20:47:39 stop caring about obstructed versioned files in 'got merge' Tyring to write a test to cover this case I found that obstructed files are (correctly) detected as local modifications in the work tree. Thus they trigger the pre-condition check for local modications and 'got merge' will not even start to do any work in the presence of obstructed files.
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 4f3c844b 2021-09-14T16:12:52 make 'got update' display the worktree's branch name upon success ok tracey
Stefan Sperling 788d4a19 2021-09-14T14:18:59 validate status codes given to 'got status -S'
Stefan Sperling b043307b 2021-09-14T14:15:49 make got status -s and -S options conflict
Stefan Sperling 08e5873e 2021-09-14T14:05:27 make 'got checkout' display the checked out reference and commit ID ok tracey
Tracey Emery 00357e4d 2021-09-14T13:49:46 add suppress status-code selection to got status. this allows for a quick way to clean output without the use of ignore files. ok stsp
Tracey Emery 4ad4a1ec 2021-09-13T16:23:12 add -q quiet mode to checkout and update. supressing output keeps the terminal responsive on large repos. ok jrick stsp
Stefan Sperling 1b796c3f 2021-09-11T08:06:47 fix a null-pointer deref in 'got fetch -d'; reported by Omar Polo
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 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
Christian Weisgerber 978a28a1 2021-09-04T16:22:38 make "got branch -d" print reference name and value Also silence output of "got branch -d" in a regression test, from stsp. ok stsp