Commit Briefs

Thomas Adam

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@



Thomas Adam

fix some non-idiomatic calls of the cancellation callback

This callback could return any error code. Do not mask all such errors as cancellation.



Thomas Adam

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


Thomas Adam

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@


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

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@


Thomas Adam

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@


Thomas Adam

Define apply_umask earlier, without predeclaration

ok op@


Thomas Adam

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


Thomas Adam

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@


Thomas Adam

make 'got merge -c' fail even if new changes only affect unrelated paths

Otherwise, 'got merge -c' can silently revert already committed changes. Also fix GOT_ERR_MERGE_COMMIT_OUT_OF_DATE by giving it a value distinct from GOT_ERR_MERGE_STAGED_PATHS. Patch by James Cook


Thomas Adam

only delete empty directories appearing in arguments to 'got rm'

Make 'got rm' keep empty directories which are not explicitly listed for deletion. Deleting such directories is problematic in several use cases. Avoids deleting the current working directory when the user runs "got rm *" (pointed out by Mikhail), and avoids deletion of an empty directory "foo/" after 'got rm foo/a foo/b' (pointed out by op@). ok jamsek, op


Thomas Adam

allow no-op merge commits to be created

Requested by James Cook


Thomas Adam

fix 'got commit' using a bad parent commit ID when worktree is out-of-date

Problem reported by James Cook with reproduction scripts Regression test case by jamsek, as a simplified version of James' scripts fix tested + ok jamsek


Thomas Adam

when aborting rebase/histedit/merge, unlink files added by merged changes

Otherwise we leave unversioned files behind in the work tree which may interfere with new attempts to rebase or merge the changes again. Problem found by + ok naddy@


Thomas Adam

style nits from op@, thanks!


Thomas Adam

make 'got revert' and 'got rm' work on non-existent directories

problem found by robert@ ok jamsek, op


Thomas Adam

fix rebase/histedit -a leaving some files on the temporary branch

The commands 'got rebase -a' and 'got histedit -a' were checking out files from the wrong commit. Make them check files out from the commit we are switching the work tree to, as intended. Avoids spurious merge conflicts when the work tree is later used for another rebase operation. It also makes 'got update' right after 'rebase -a' a no-op, as it should be. Problem found by naddy@ while rebasing jca's llvm15 branch ok op, jamsek earlier version


Thomas Adam

update the base commit ID of unmodified files if the blob ID matches

This avoids having to run 'got update' after operations which run checkout_files() and where a file happens to have the same blob ID but its base commit differs from the commit we are updating to. Found while investigating a bug report by naddy@ ok op, jamsek (earlier version)


Thomas Adam

handle files changing into directories during 'got update'

problem found by naddy@


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

portable: rework SHA detection

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