Commit Briefs
do not treat the -h and -V flags as errors
When run with the -h or -V option, output the help or version text to stdout and exit with success (0). Only write usage and help information to stderr and exit with error (1) if there is a mistake in the command syntax. tweak and ok stsp
fix 'bad path' error from 'got clone' by unveiling the repository path again
Problem found by jrick
prefer the BSD extension to reset getopt over the GNU one
Sadly there is no portable way to reset getopt(3). BSD: optind = 1; optreset = 1; GNU: optind = 0; ok stsp
fix potential type mismatches between format specifiers and arguments
Cast printf arguments of type time_t and off_t to long long to match the %lld format specifier on platforms where this might not be the case. In parse.y, switch the number variable to long long because all its interactions are with that type anyway. ok millert stsp
rework got's commit-time log message modification check
Use a new approach for detecting unchanged log messages: Strip comments and leading/trailing empty lines from both the initial content and the modified log message, then compare the result. Do not assume a fixed upper limit for the length of a line. Change suggested and patch tested by jrick typo fix + ok naddy
do not pledge 'got integrate' in a PROFILE=1 build
found by jrick on freenode
allow an interrupted 'got clone' to be resumed by 'got fetch'
Set up config files as soon as possible such that 'got fetch' has enough information in order to resume an interrupted clone operation. We need to receive at least a default HEAD branch name from the server before we can set up our configuration files. The previous code also verified whether the default branch name supplied by the server resolved to a commit received in the pack file. This check cannot be done early but a wrong branch name in a config file can be fixed easily.
fix default branch name written to Git config file by 'got clone'
The generated Git config file instructed Git to fetch all branches rather than the default branch as was intended. Check generated configuration files in all clone tests in order to catch such problems in the future.
make dangling symbolic references show up in 'got ref -l'
Storing a resolved ID for each reference list item was a bad idea. This ID cannot be resolved if a symbolic references points to a reference which does not exist. Such symrefs were skipped by got ref -l as a result. Just let users of reference lists resolve the IDs as needed.
use plain write() in place of dprintf() with a pre-formatted string
step-by-step guidance from millert; ok millert stsp
add got.conf(5) configuration file
ok tracey
actually make use of an intermediate variable in cmd_clone()
found by tracey's scan-build
add -s option to 'got remove' which deletes files in a particular status
This makes it easy to deal with files that were deleted from disk by external tooling which modified the work tree. Such files are left in missing (!) status and can now be marked for deletion in bulk via 'got rm -s\! -R .' For consistency, modified (M) files can now be removed with 'got rm -s M' which implies 'got rm -f'. Prompted by feedback from krw@
add -s option to 'got status' which acts as a status code filter
Advantages over using grep are that the list of codes is validated against a list of known status codes, and that it is easier to match staged files which can display status codes in one or both of two columns. Prompted by feedback from krw@