Commit Briefs

Thomas Adam

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".


Thomas Adam

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@


Thomas Adam

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


Thomas Adam

regress: make cmdline tests sh compatible

Ensure shell scripts can run under more POSIX-restricted shells. OK op@


Thomas Adam

regress: replace unportable ln -h option with rm && ln

ok stsp


Thomas Adam

update backout/cherrypick regress for worktree UUID output

ok stsp@


Thomas Adam

show worktree UUID in backout/cherrypick -l output

When run from the repository, display the UUID to help the user know which logmsg refs belong to which work tree. Also, use "backout" or "cherrypick" in the log message header to distinguish output from 'got log'. Suggested by stsp on irc. ok stsp@


Thomas Adam

uppercase cherrypick/backout -X progress output

ok jamsek


Thomas Adam

regress for new backout/cherrypick logmsg references

Tests only cover the -lX interface to list and delete logmsg refs created by previous backout and cherrypick operations. Further tests are needed for revert and commit coverage to ensure that the correct log messages of bo/cy commits are loaded into the editor when 'got commit' is run, and that only the refs used to populate the editor for the new commit are deleted. Potential printf issues observed by op remain in the diff; noted here as a reminder to do a sweep at some point in the future as there are other such instances in cherrypick.sh and possibly elsewhere in regress. Reviewed as part of previous commit introducing logmsg ref support for backed-out/cherrypicked commits. ok stsp@


Thomas Adam

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@


Thomas Adam

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@



Thomas Adam

always show commit or tree IDs in diff header, in order to help 'got patch'

The idea is that got patch can simply look for a line such as: commit - abcde1234567... to find the merge base commit ID to show in diff3 conflict markers. got log -p now displays commit IDs in its diff header, instead ofl tree or blob IDs. ok op@



Thomas Adam

don't pass $ret to test_done on failure when it's known to be zero

Otherwise the test directory it's not left in place; ok tracey@


Thomas Adam

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.




Thomas Adam

regress: make test operands POSIX compliant

Since the interpreter for the regress shell scripts are using /bin/sh this will usually imply some level of POSIX compliance (that isn't bash-specific, for instance). Some systems use dash as their sh shell and as such is stricter POSIX compliance. To help -portable, make the shell test checks use a single '=' for equality, rather than '=='.



Thomas Adam

fix merging of files which contain a dot on a line by itself

Annoying bug which we inherited from OpenRCS which inherited it from OpenBSD's diff3 program. ok tracey millert




Thomas Adam

allow bad symlinks to survive a merge

Commands which perform merges will now install bad symlinks as symlinks in the work tree, instead of creating them as regular files. This means bad symlinks committed with 'got commit -S' (or Git) will be preserved. The decision to introduce a bad symlink is done at commit-time and merges should not forcefully reverse this decision. The cherrypick and backout commands require a manual commit step, and a merge result with bad symlinks will require use of 'got commit -S'. Additional testing by thomas adam


Thomas Adam

regress: fix test failures using ln(1)

GNU ln uses -T instead of -h for no-target-directory. OK thomas.adam