Commits


regress: fix test for 'got diff' against CRLF files ok stsp


make diffing files which changed into dirs and vice-versa possible Problem marked with a TODO comment by me ages ago and rediscovered by naddy@ ok op@


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


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


add xfail test for "got diff" when a commit changed a file to a directory git diff: diff --git a/alpha b/alpha deleted file mode 100644 index 4a58007..0000000 --- a/alpha +++ /dev/null @@ -1 +0,0 @@ -alpha diff --git a/alpha/beta b/alpha/beta new file mode 100644 index 0000000..65b2df8 --- /dev/null +++ b/alpha/beta @@ -0,0 +1 @@ +beta got diff: diff d973bf45ce9b2b437b5d6352368e8406f9e256e2 34413d01304800f99058a1a42769e92afc534199 commit - d973bf45ce9b2b437b5d6352368e8406f9e256e2 commit + 34413d01304800f99058a1a42769e92afc534199


regress: replace typeset with printf for shell portability The typeset shell builtin is a ksh(1) feature. It is not available in a pure POSIX sh(1). Use printf(1) to portably perform the same string truncation. tweak and ok op jamsek


fix diff and log diffstat tests broken in 65dedee0a2cd I failed to update regress when changing the diffstat summary line in the previous commit to use a singular noun after 1. ok op@ and stsp@


regress: use `local' for some variables


add regress for 'got diff -d' and minor output fix Ensure an actual file path is displayed in the 'got diff -d -c commit path ...' case when one of the specified paths is a deleted file. Prior to this, the unhelpful "/dev/null" label was shown instead. Includes some copypasta fixes noted by op. ok stsp@ op@


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@


show file mode for new added files in work tree diffs Make work tree diffs of local changes on disk display the file mode of new added files like other versions of `got diff` currently do. ok stsp@


wrap overlong line in diff.sh


got: fix typo in argc check when diffing two blobs We already have two arguments when diffing two blobs, so check for more than two like we do when diffing two objects to check for invalid path args. Includes new regress test by op for diffing two blobs. ok stsp@ and ok plus regress test from op@


add a simple test for 'got diff' against CRLF files


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@