Commits


reintroduce the 'got init' command as an alternative to 'gotadmin init' New users trying out Got for the first time have reported trouble with finding a way to create a new repository, based on their assumption that Got works like Git which provides a 'git init' command. It doesn't cost us much effort to keep this command available in both programs to make discovery a bit easier for new users coming from Git.


plug a leak in a few cmds: forgot to free(cwd) at the end spotted while investigating for another leak spotted by Kyle Ackerman. ok stsp@ and jamsek


show hint about update -b if the user attempts to rebase a branch onto itself Specifically, when 'gut send' suggests 'fetch and rebase required', new users might try to use 'got fetch' directly followed by 'got rebase' without first updating the work tree to newly fetched commits. Got would then say "main is already based on main" without any hint for a way out. Hopefully, pointing users at the update -b command will make them search the manual for details.


add default case to the switch statement in choose_patch() Just in case the code futher up gets tweaked again such that the validity check using strchr() will be skipped in some edge case. Lucas agrees


make got stage -p behave the same way in interactive and -F modes for 'q' Lucas agrees


got: refactor choose_patch Unify the handling of a response file and interactive use, handle EOF, fix a memleak and make it easier to extend in the future. In particular, interactive mode now doesn't loop forever on EOF. Patch by Lucas Gabriel Vuotto. Joint work with op.


backout got stage -R option addition The stage command is usually used in a recursive manner, like 'got commit'. Forcing users to specify -R all the time is deemed too inconvenient in practice. discussed on IRC with Lorenz (xha), Omar, and Lucas


replace date, strftime %G-%m-%d with %F Use the more predictable %F, aka %Y-%m-%d, instead of %G-%m-%d. %G follows the definition of ISO-8601 week-based year, which is weird. In particular, 2024 is one of such years with weird behaviour: $ date -jf %Y-%m-%d +"%F %G-%m-%d" 2024-12-30 2024-12-30 2025-12-30 Diff from Lucas Gabriel Vuotto (thanks!); stsp agrees


rename a function to avoid gramatical ambiguity


require -R option for staging or unstaging directory contents -R is needed on almost all other commands so this makes things consistent. Patch by Lorenz (xha)


Add initial read-only http fetch support using a got-http helper. Currently we only support the smart protocol with a limited feature set. ok stsp@ tobhe@


get rid of unnecessary "dns inet" pledge promises while fetching via git://


make 'got status' display interrupted rebase, histedit, and merge operations When an operation is interrupted add a trailing message to status output which displays the operation and branches involved. This information will be useful when diagnosing problem reports and it helps new users with contextualizing multi-operation work tree state. ok op@


forgot to unveil the log message file passed to got commit -F found by op's regress builder


fold some long lines


call unveil earlier in 'got tag' We now know that unveil(2) will never traverse exec. No need to wait with unveil until the editor has been run. ok op@


call unveil earlier in 'got histedit' We now know that unveil(2) will never traverse exec. No need to wait with unveil until the editor has been run. ok op@


call unveil earlier in 'got commit' We now know that unveil(2) will never traverse exec. No need to wait with unveil until the editor has been run. ok op@


call unveil earlier in 'got import' We now know that unveil(2) will never traverse exec. No need to wait with unveil until the editor has been run. ok op@


rename got_commit_graph_iter_start() to got_commit_graph_bfsort() This function begins a breadth-first traversal. The new name makes it easier to distinguish from got_commit_graph_toposort().


make 'got rebase' find a merge base with topological sorting if needed Fixes a problematic case of spurious conflicts encountered by naddy@ on landry's firefox package git repository. The current implementation of toposort is expensive, so this might make rebase appear to run slowly on large repositories. However, this is better than letting users deal with spurious conflicts. ok op@


add log -t option which enables topological sorting of commits Because the current implementation of toposort is expensive, add a flag which enables it. I would rather not have this option and just use toposort by default, however more work is required to achieve acceptable performance. ok op@


use a define for vi(1) path This is intended to aid -portable, since other systems may have vi installed in a different place, or maybe prefer to ship with a different default editor. ok stsp@


plug got checkout and update worktree leaks spotted by op@


plug got status worktree leak found by Kyle Ackerman; ok op@