Commit Briefs
use a separate .cvg meta data directory for cvg(1) work trees
This prevents mixing the use of got and cvg clients in the same work tree. Avoids confusion going forward while cvg differentiates itself further. tog(1) and gotadmin(1) remain compatible with both work tree formats. These tools only read work trees to locate the corresponding repository.
take reachability in consideration when cleaning redundant packfiles
This wraps the cleaning up of loose objects and redundant pack files under a new functions, making the _prepare() and _complete() functions unnecessary. It walks the reachable commits unconditionally since that information is always needed and adapt how we purge loose objects after this change. The progress function is changed too and we log `ncommits' first, followed by the number of loose objects, followed by the rest. Pack files are now considered redundant when all their objects are provided by a bigger pack or are unreachable. ok stsp
make 'gotadmin load' always read data from standard input
This provides better symmetry with 'gotadmin dump', and allows us to pass the list of references as command line arguments, replacing the -b option. The -l option now takes an argument which specifies the bundle file rather than requiring data to be fed on stdin with -l which feels awkward. ok op@
gotadmin load: don't add a newline when listing refs
the newline is only needed after the progress output, which is not present in the 'listing refs' case.
add an initial implementation of gotadmin load
it is intended to be the counterpart of `gotadmin dump' and, just like it, there's planned support for handling fast-import stream. At the moment it only deals with git bundles. ok stsp
add an initial implementation of gotadmin dump
gotadmin dump is used to export (part of) the history of the repository; at the moment it only generates git bundles (which are pack files with a header) but support to generate a fast-import stream is planned. ok/tweaks stsp and jamsek
add a lock for the cleanup operation
This adds the functions got_repo_cleanup_prepare() and _complete() to lock/unlock the repository to prevent multiple `gotadmin cleanup' or `git gc' operations to run in parallel. improvements and ok stsp@
gotadmin cleanup: remove redundant pack files
improvements and ok stsp@
portable: configure: split out dependencies
Rather than assume all dependencies are required for all programs, split them out. This will make packaging easier, as well as splitting the code to use subprojects. Note that due to the use of config.h semantics, in most cases the got_compat.h header file is now at the top of the .c file it is included in, so that it can handle the system header inclusion properly.
portable: rework SHA detection
Simply the SHA detection by not predicating on libcrypto, but instead checking individual header files.
portable: remove sha1.h; found portably
Remove sha1.h as this is found portably across systems.
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>
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@
got/tog/gotadmin: pledge earlier
In the case of tog move setlocale(3) before pledge(2), as suggested by stsp. ok stsp@
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@
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@
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@
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@
Group options in accordance with style(9)
patch by Josiah Frentsos
portable: add back sys/queue.h
Now that the handling of including sys/queue.h is better, there's no need to remove those lines from the source. Copy the location of those original sys/queue.h lines from upstream at the same line number, so as to avoid any conflicts in the future.
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@
revert "clear the rest of the pack_fds pointers"
There is no need to clear local variables before returning from a function. ok tracey