Commits


actually detect modified files when checking out with -E When checking out over a pre-existing directory tree with -E, got would store the checkout timestamp in the fileindex and so not detect local edits until those files are touch(1)ed again. Instead, detect that a file already exists during checkout and don't update its {c,m}time, leaving them to zero (the epoch), so a subsequent `got status' will look at its contents. While here, change the status char for such file from ? to E, which is what the manpage actually documents. Issue reported by naddy@ ok stsp@


fix deletion of missing locally-added files If a locally added file in A status gets deleted from disk it will move into missing ! status. If the user then decides to delete the file we must remove the file index entry immediately rather than flagging the file for removal during the next commit operation. The file was never committed and lacks a base-blob and base-commit, so it cannot be removed during the next commit. As a result the commit operation was reporting a bogus "out of date" error. Found while diagnosing a related bug reported by gonzalo@ ok op@


prevent a double-free in got_worktree_commit If creating the /tmp display diff for a commitable item failed we would free the commitable item while it was already on the path list. Later on when the path list was freed in got_worktree_commit() a double-free would be detected and the program would be aborted. Found by gonzalo@ ok op@


allow modified files to be deleted during merges if content exists in the repo This makes histedit folding work when a file is modified by commit A and then deleted in commit B, with A being folded into B. Problem reported by naddy@


pass the right callback argument for check_mixed_commits


fix some non-idiomatic calls of the cancellation callback This callback could return any error code. Do not mask all such errors as cancellation.


add cancellation support to the mixed-commits checker in worktree.c


load tog's worktree base commit marker in the log thread for startup speed Walking the whole file index can take some time. Avoid delaying the perceived start-up time of tog by reading the file index in the background log thread. Problem pointed out by op@ with fixes from + ok jamsek


tog: show work tree base commit marker in log view If tog is invoked in a work tree, prefix the base commit log message summary line with a '*' if the work tree is up-to-date, and with a '~' if the base commit is not up-to-date with respect to the branch tip or it contains mixed commits. While here, plug a couple worktree leaks in cmd_ref() and cmd_tree(). ok stsp@


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.


prevent useless EEXIST errors filling up the global custom error array While checking out files, do not attempt to create every directory that exists in the repository tree without paying consideration to their existence on disk. Instead, let functions which add files worry about creating any missing parent directories. This shakes out two other bugs in broken symlink installation code which ended up passing an absolute path to add_dir_on_disk() and forgot to report progress in an unreachable code path that is now getting used. Problem reported by + ok naddy@


Make got_worktree_get_base_ref_name static Nothing appears to benefit from this being non-static, and it was missing from the public API headers as well. ok stsp@


Define apply_umask earlier, without predeclaration ok op@


make 'got add' more forgiving about unversioned paths on the command line When users run 'got add *' the shell may pick up already versioned files and trigger errors about paths being in an unexpected status. Expand the check which previously only allowed files in added status to be double-added to cover the following status codes which are all safe to ignore: A M C m This should make bulk additions of files a bit easier in most cases. Problem reported by robert@ ok jamsek


Implement fast-forward merges. Split part of got_worktree_merge_prepare into a new function, got_worktree_merge_write_refs, since that part doesn't make sense in the fast-forward case. ok stsp@