Commit Briefs

Thomas Adam

plug some fd leaks in the fdopen{,dir} error paths

There's also a memory leak fixed. ok stsp@


Thomas Adam

use INT32_MAX rather than INT_MAX for GOT_FILEIDX_MAX_ENTRIES

it's a different way to spell the same number, but it's more evocative since the on-disk format is 32 bits wide. ok stsp


Thomas Adam

speed up read_fileindex_path()

Use a local buffer instead of calling reallocarray() every 8 bytes; the speed up is measurable. The downside is that we're now limited to paths long at most PATH_MAX bytes, but since this is the fileindex it's not an issue in practice. ok jamsek stsp


Thomas Adam

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.


Thomas Adam

free fileindex entry upon add_entry() failure

Very unlikely (an occurrence of it would mean that got produced an invalid fileindex) and harmless anyway since we would just terminate, but a leak is still a leak. ok stsp@


Thomas Adam

support histedit fold operations which delete a file and then add it again

problem found by naddy@ ok op@


Thomas Adam

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.


Thomas Adam

add some helper functions to compute hashes

This adds a set of functions to abstract over SHA1Init, SHA1Update, SHA1Final, their respective SHA256 variants and how to compare digests. Replace all the SHA1*() usage with the new APIs. It's a preparatory step for sha256 handling. ok stsp@


Thomas Adam

portable: remove endian.h

This is included portably.


Thomas Adam

portable: rework SHA detection

Simply the SHA detection by not predicating on libcrypto, but instead checking individual header files.


Thomas Adam

portable: remove sha1.h; found portably

Remove sha1.h as this is found portably across systems.


Thomas Adam

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>


Thomas Adam

add functions to extract object ids from fileindex entries

ok stsp


Thomas Adam

zap double empty line


Thomas Adam

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@



Thomas Adam

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.


Thomas Adam

build with -Wmissing-prototypes

ok stsp@



Thomas Adam

portable: make UUID includes generic

Move the detection of UUID header files to be included portably. This will have no functional effect until MacOS detection is put in place.


Thomas Adam

fix 'got status' reporting all directories on NFS mounts as unversioned

Problem found and fix tested by Ted Bullock. ok millert, naddy


Thomas Adam

wrap overlong lines


Thomas Adam

add O_CLOEXEC (close-on-exec) to openat(2) calls

suggested by millert ok thomas_adam


Thomas Adam

do not skip ignored directories in 'got status' if they contain tracked files

Fixes regression introduced by commit 41f061b2f459318f3738f59d7676efccc4beb344 where tracked files inside an ignored directory were reported as missing.