Commit Briefs

c6e8a8268e Stefan Sperling

do not update symlinks which are already up-to-date

This fixes spurious 'U' notifications for symlinks during 'got update' that occurred even when the work tree was fully up-to-date. Observed on a work tree of the FreeBSD src repo and reproduced in our test suite by adding a no-op update at the end of a test which deals with updating symlinks.


0f58026f98 Stefan Sperling

add a missing STATUS_EXISTS notification in update_blob()


4cc1f028ad Stefan Sperling

fix use of an uninitialized stat buffer during work tree status crawl

found by naddy ok naddy jrick


e600f1246e Stefan Sperling

ensure that old commits remain referenced after rebase and histedit

Create automatic "backup" references which ensure that objects from the pre-rebase or pre-histedit state remain in the repository. A new -l option for 'got rebase' and 'got histedit' lists old commits. This makes it easier to recover from botched rebase or histedit operations. Removal of such objects currently requires got ref -d and git-gc. This will be made more convenient in the future. testing and ok jrick


6e210706a4 Stefan Sperling

implicitly mark all files in work tree as up-to-date after 'got integrate'

Avoids having to run 'got update' for no good reason after 'got integrate'. The same change was made recently for both rebase and histedit in commit a615e0e7796ea1103a6e0d4b5dbb6134597886660 and we forgot about histedit.


60e40e9508 Stefan Sperling

close file handles before freeing other things in got_worktree_close()

The work tree's path needs to be valid while constructing error messages.


e7abd6b665 Stefan Sperling

fix missing close(2) error check in got_worktree_close()


08578a35f6 Stefan Sperling

make close(2) failure checks consistent; check 'close() == -1' everywhere

ok millert, naddy


56b63ca4ab Stefan Sperling

make fclose(3) failure checks consistent; check 'fclose() == EOF' everywhere

ok millert, naddy



a06ff56fe6 Christian Weisgerber

fix a use after free()

ok jrick stsp


9bdd68dd5c Christian Weisgerber

replace fparseln(3) with getline(3), for better portability

ok stsp


a615e0e779 Stefan Sperling

implicitly mark all files in work tree as up-to-date after rebase/histedit

This should always be correct, since rebase and histedit start out with a clean and single-base-commit worktree, and end up committing all changes across the entire work tree when they are successful. tested by jrick and myself


437adc9d5b Yang Zhong

add fd field to got_worktree, modify got_fileindex_entry_update to use fds

These changes are intended to make got more compatible with FreeBSD's Capsicum. ok stsp



fe621944e8 Stefan Sperling

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.


f6d8c0acba Stefan Sperling

fix replacing symlinks with files

And add a test case which verifies that the inverse also works, i.e. a symlink being replaced with a regular file. problem reported and fix tested by jrick





017406073f Stefan Sperling

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


3818e3c42c Christian Weisgerber

convert all remaining instances of chmod(2) to fchmod(2)

ok stsp


62d463cac1 Christian Weisgerber

indentation fixes


2513f20abd Stefan Sperling

plug memory leaks in error paths; found by naddy


20a2ad1cd2 Stefan Sperling

use got_path_dirname() in schedule_for_deletion(); avoids const dirname(3)

ok naddy