Commit Briefs

c24e2d2e71 Thomas Adam

replace date, strftime %G-%m-%d with %F

Use the more predictable %F, aka %Y-%m-%d, instead of %G-%m-%d. %G follows the definition of ISO-8601 week-based year, which is weird. In particular, 2024 is one of such years with weird behaviour: $ date -jf %Y-%m-%d +"%F %G-%m-%d" 2024-12-30 2024-12-30 2025-12-30 Diff from Lucas Gabriel Vuotto (thanks!); stsp agrees


cf85a643cb Thomas Adam

regress: use seq instead of jot

This is just for -portable since jot is not always available. ok stsp@


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


8642913bb1 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@


3795e2b655 Thomas Adam

got: enable more commands to accept commit keywords

More work adding commit keyword support to the blame, cat, ref, tag, and tree commands. With this, all Got commands that take a <commit> option argument or operand now support keywords. Regress flub saved by op! fixes + ok op@


075759e6d5 Thomas Adam

fix wrong assumption about author timestamp in test_blame_lines_shifted_skip

Not all commits will share the same author timestamp. This test would fail when run at the wrong time of day as found out by op@'s regress runner. ok op@


ac3cdf31e0 Thomas Adam

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


1c72bab5d1 Thomas Adam

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.


bf3ab20628 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@


b6b86fd1b9 Thomas Adam

remove trailing whitespace; patch by Josiah Frentsos


4e2bdb0dad 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@


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


180f111d56 Thomas Adam

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


dc8256b60d Christian Weisgerber

"got blame" now shows UTC dates, adapt regression test; ok stsp




f6cae3ed1e Christian Weisgerber

switch function declarations from Korn shell to Bourne/POSIX shell syntax

ok stsp


7fb414ae4d Stefan Sperling

add a -q option to tests for quiet output and use it for 'make regress'

Previous default output remains when test cases are run individually. ok tracey



0587e10c4c Stefan Sperling

add symlink support to 'got blame' and 'tog blame'


e730362696 Stefan Sperling

add submodule tests

ok semarie


db32465dae Stefan Sperling

add a test for bug fixed in a0975128


6db9f7f6b1 Stefan Sperling

always show numeric dates in ISO-8601/xkcd-1179 format

ok millert tracey sthen


11db6024f7 Stefan Sperling

show commit date's century in 'got blame' output (patch by Tracey Emery)

tests adjusted by me


4c9641fdb6 Stefan Sperling

fix and simplify blame algorithm

Always diff against latest version of file. This is much easier since there is no need to keep track of lines shifting around.