]>
Savannah Git Hosting - gnulib.git/commit
vc-mtime: Add API for more efficient use of git.
Reported by Serhii Tereshchenko, Arthur, Adam YS, Foucauld Degeorges
at <https://savannah.gnu.org/bugs/?66865>.
* lib/vc-mtime.h (max_vc_mtime): New declaration.
* lib/vc-mtime.c: Include <errno.h>, <stdio.h>, <string.h>, filename.h,
xalloc.h, xgetcwd.h, xvasprintf.h, gl_map.h, gl_xmap.h, gl_hash_map.h,
hashkey-string.h, unlocked-io.h.
(is_git_present): New function, extracted from vc_mtime.
(vc_mtime): Invoke it.
(MAX_COMMAND_LENGTH, MAX_CMD_LEN): New macros.
(abs_git_checkout): New function, based on execute_and_read_line in
lib/javacomp.c.
(ancestor_level, relativize): New functions.
(struct accumulator): New type.
(accumulate): New function.
(max_vc_mtime): New function.
(test_ancestor_level, test_relativize, main) [TEST]: New functions.
* modules/vc-mtime (Depends-on): Add filename, xalloc, xgetcwd,
canonicalize-lgpl, xvasprintf, str_startswith, map, xmap, hash-map,
hashkey-string, getdelim.