Commits


replace "(cd path && git cmd)" with "git -C path cmd" This matches the existing use of "got -r path cmd" and "git_commit path args".


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@


prevent overlapping repo and work tree in 'got checkout' Some people are eager to try to make Got work just like Git by overlaying the repository and work tree. This causes problems with unveil conflicts at run-time. Fail as early as possible during 'got checkout' when users attempt this. cosmetic tweaks + ok op@


regress: nix 'set -A' kshism from tests As reported by naddy, this is a non-portable Korn shell construct. Instead, use the one argument array then make faux space-delimited string "arrays" for the other ids; they can still be indexed with pop_idx. improved by + ok naddy@


expand support for commit keywords to more got commands Add the ability to use keywords in the backout, branch, checkout, cherrypick, and patch commands. Includes some basic regress tests for the new commands, and also some more contrived test cases for 'got log -c[:]keyword[:(+|-)[N]]'. ok stsp


got-read-gitconfig: send key-value pairs for extensions Most extension allow only for a boolean value so the current behaviour of just sending the extension with a trueish value is fine. However, some extensions that we could eventually support (like "objectformat") have a string value. This is a preparatory step towards that. ok stsp@


up the checkout regress ulimit to 33, to accomodate for sparc64 failing at 32. ok stsp


bump checkout_ulimit_n test file descriptor limit a bit; failure seen on arm64


use a subshell to avoid changing the global ulimit; suggested by op@


respect resource limit for number of open files when sizing the pack file cache ok op@


respect umask when creating or changing files and directories This behaviour is already documented in got-worktree(5) but wasn't actually implemented. ok stsp@


fix regression test failures with Git 3.30.5 / 2.38.1 or later installed The fix for CVE-2022-39253 in Git made our regression tests fail since creating submodules from local clones is no longer allowed by default. Add an override to our invocations of "git submodule add", the same which was added to Git's regression test suite as part of their fix. This CVE doesn't otherwise affect us. We do not implement submodules. Our use of them in regression tests exists only to ensure that Got does not freak out when it sees one. Precisely because automated support for nested repositories and/or working copies (as in Git Submodules, or Subversion Externals, etc.) have been an endless source of security problems in other systems. sudden test failures pointed out by naddy@


use test(1) -eq and -ne to compare integers, and reduce quoting This brings the rest of the regression test scripts in line with patch.sh.


shell code fixes Escape sequences are not handled by every echo(1), e.g. not on FreeBSD. '?' is a glob character and must be quoted. '!' is not a shell meta character. ok tracey stsp


add tests for checkout -q, update -q, and status -S. ok stsp