Commit Briefs

Thomas Adam

support histedit fold operations which delete a file and then add it again

problem found by naddy@ ok op@


Thomas Adam

add xfail test for histedit folding of delete followed by add

If a file is deleted, then in modified form added again, folding should restore the file with its new contents. ok stsp


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


Thomas Adam

portable: regress: drop setting LC_TIME

common.sh sets LC_ALL=C which makes this change unnecessary now. Patch from Christian "naddy" Weisgerber.


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.


Thomas Adam

got: add 'got histedit -d' flag to drop all commits

Like -f, except drop all commits. Discussed with op and stsp on irc. ok stsp@


Thomas Adam

use VISUAL instead of EDITOR in histedit_mesg_filemode_change

VISUAL is preferred and relying on EDITOR may cause test failures in some environments. pointed out by op and jamsek



Thomas Adam

fix histedit -m on a commit which only changes filemode bits

The commit was being miscategorized as a no-op change and dropped. Now the commit is retained and its log message is updated as expected. ok op, jamsek


Thomas Adam

regress: consistently use ed -s

didn't know about -s when writing those tests; saves some output redirection. ok jamsek


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

reset committer during rebase and histedit

ok op@



Thomas Adam

histedit: make sure mesg is only used after pick or edit

It doesn't really make sense to use mesg after a fold or drop, or after another mesg. it currently "works" as intended, but the behaviour is confusing and not useful, better abort the operation as it's probably not what the user intended. Suggested by and ok stsp@


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: provide a sed wrapper

In order to portably handle the difference in how 'sed -i' works between *BSD and Linux, provide a wrapper to invoke the underying system sed(1) based on which OSTYPE is in use.


Thomas Adam

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.


Thomas Adam

add test for merge result when lines are inserted at the top of a file

Based on a patch by Omar Polo




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


Stefan Sperling

fix histedit_no_op test which was failing randomly

A no-op replayed history ends up having exactly the same commit IDs if all commits are created at roughly the same moment in time. There are no content changes involved so if commit timestamps do not differ then commit hashes will be the same. In which case there is no fork in history for 'got histedit -l' to display, yet the test was always expecting a fork in history to be displayed. Update the test to take this issue into account. The test will now pass no matter which result is produced by the histedit operation. Problem found by Lucas who observed that this test was randomly failing. Patch also provided by Lucas.