Commit Briefs

Omar Polo

include sha2.h too where sha1.h is included

In preparation for wide sha256 support; stsp@ agrees. Change done mechanically with find . -iname \*.[cy] -exec sam {} + X ,x/<sha1\.h>/i/\n#include <sha2.h>


Omar Polo

gotadmin pack: add a -D flag to force using ref-delta

Intended mostly for the regress suite, so we'll be able to test also the ref-delta code paths. ok stsp@


Omar Polo

got/tog/gotadmin: pledge earlier

In the case of tog move setlocale(3) before pledge(2), as suggested by stsp. ok stsp@


Omar Polo

replace got_repo_get_gitconfig_extensions with got_repo_has_extension

got_repo_get_gitconfig_extensions is only used in gotadmin to check if the preciousObjects extension is active; let's replace it with a function that just checks whether a certain extension is active. It simplifies future changes to the extensions handling. ok stsp@


Mark Jamsek

got: minor refactor of got_pathlist_free() API

Accept flag parameter to optionally specify which pointers to free. This saves callers looping through the list to free pointers. ok + fix stsp@



Omar Polo

sync usage with reality

The -h and -V/--version flags must be given before the command; with those flags the command is actually optional, but don't over-complicate the usage string with these nitpicks. ok/improvements stsp@


Mark Jamsek

add gotadmin init -b <branch> to specify repo head ref

Similar to `git init -b`. Includes a change to `got import` behaviour such that "main" is no longer hardcoded by default; instead, we import to the branch resolved via the repository's HEAD reference unless `got import -b` is used, and only if HEAD cannot be resolved to a branch do we fallback to "main". includes fix plus ok from stsp@



Stefan Sperling

Group options in accordance with style(9)

patch by Josiah Frentsos


Stefan Sperling

move 'got init' command to 'gotadmin init'

This functionality is better suited for gotadmin because it is technically a server-side repository operation when we consider the 'got' tool as the client-side tool. I have plans to move 'got import' into gotadmin as well. ok op@


Stefan Sperling

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

clear the rest of the pack_fds pointers


Tracey Emery

move got_opentempfd out of got_repo_open. ok stsp@

thanks for all the help massaging this diff


Stefan Sperling

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