Commit Briefs
regress: replace "sed -i" with ed(1) for portable in-place editing
"sed -i" is fundamentally unportable. GNU and OpenBSD sed(1) treat the extension for the backup file as an optional argument and use "sed -i" for no backup file. FreeBSD sed(1) treats the extension as an obligatory argument and uses "sed -i ''" for no backup file. There is no single syntax that works for both. ok stsp op
portable: regress: drop setting LC_TIME
common.sh sets LC_ALL=C which makes this change unnecessary now. Patch from Christian "naddy" Weisgerber.
portable: regress: drop GNU date on *BSDs
Check if date(1) supports -r and fallback to gdate if that fails, via a shell-wrapper. From Christian "naddy" Weisgerber.
make 'got rebase' work when the to-be-rebased branch has no parent commit
found by and ok op@, who also provided the test case
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@
don't undef GOT_AUTHOR in regress
unset only in the subshell so further cose is unaffected. ok stsp@
do not require local author info during 'got rebase'
My commit to reset committer info during rebase was too strict in some use cases. Even when simply forwarding a branch the rebase operation could now fail if GOT_AUTHOR is not set. To fix this, fall back on existing commiter information if no author is configured. And try to obtain author info from Git config in case GOT_AUTHOR is not set. Problems reported by Mikhail.
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.
switch branches during noop rebases
Always update to the specified branch even if the branch is already rebased (no commits needed to be rebased, and the branch does not need a fast forward). With the old behavior of erroring and staying on the current branch, I sometimes found myself ignoring the error message, treating it as information and assuming the branch update, and later on committing on top of origin/main instead of the main branch. feedback and ok stsp
regress: use gdate/gln if on *BSD
To minimise the amount of churn between the difference in date(1) and ln(n) semantics, use gdate and gln from coreutils.
regress: fix test failures using date(1)
This patch fixes test failures related the date(1) utility. In the long term we could add a wrapper function to detect valid options for date(1) and use the variant which works on the current OS. For now, this makes some tests pass and shows us where the problems are. OK thomas.adam