Commits


prevent log message loss of folded commits during histedit If the histedit log message editor exits without saving its buffer, Got threw away log messages of all commits which were folded. Only the last commit message is preserved, which could be something meaningless like "fixup". Instead, preserve the initial editor buffer content as-is. That is not going to be an ideal log message, but doesn't throw away information and stands out visually because the newly created log message will start with a comment like '# log message of folded commit a0ff...' Problem reported by jrick


histedit -f conflicts with -F option Also fixed as part of a different patch from jrick ok jrick


use a helper function to generate error messages for mutually exclusive options Inspired by a different patch from jrick ok jrick


add histedit -f flag for folding shortcut "please push it" stsp


handle binary files in got/tog diff commands; add -a options to force text


fix type of filesize output parameter of got_object_blob_dump_to_file()


remove now pointless 'check_disk' parameter of got_repo_map_path() suggested by naddy


merge new diff implementation from the git.gameoftrees.org diff.git repository This new diff implementation was started by Neels Hofmeyr during the u2k20 hackathon and now replaces diffreg.c code lifted from the OpenBSD base system. The integration of this code into Got was done by me. Got now uses the patience diff algorithm by default. The diff.git repository will remain the primary repository for the diff code, which already compiles and runs on other operating systems such as Linux. Any fixes and improvements for files inherited from the diff.git repository should be written against that repository and synced to got.git afterwards.


avoid got_repo_map_path() in 'got tree' if a work tree is available Note that got_worktree_resolve_path() will return a path based on the current working directory if the argument is the empty string. This quirk keeps the behaviour of 'got tree' intact which depends on the current working directory if run in a work tree. ok naddy@


avoid got_repo_map_path() in 'got blame' 'got blame' does not need access to the work tree. So far the work tree was completely hidden with unveil(). We must now expose the work tree while resolving the path, so unveil() calls are shuffled around slightly. Failing realpath() calls would mess with path resolution otherwise. There's a bug in got_worktree_resolve_path() where it failed to canonicalize a path constructed from a user-specified path that does not exist on disk. Note that this path falls into strncmp() a few lines down. I am fixing this by adding canonicalization. Generally, joining paths with asprintf() and comparing paths with strncmp() is fragile. A more general solution might be needed but I am leaving that for another day. ok naddy


replace resolve_commit_arg() helper in got.c with got_repo_match_object_id()


prevent a NULL dereference if 'got log -p' runs against a root commit


make 'got log' avoid got_repo_map_path() if run in a work tree ok naddy


indentation fixes


properly handle nonexistent remote repository names given to 'got fetch' found by jrick ok naddy