Commit Briefs

Thomas Adam

refactor got log -d and tog diffstat to compute diff once

This eliminates the previous performance cost by making 'got log -d' and tog diff view compute the diffstat while building the diff in a temp file like we do with 'got diff -d'. Also, keep the current 'got log -d' UI as per stsp's suggestion. ok stsp@


Thomas Adam

don't use plural noun after 1 in diffstat total

Use singular form when appropriate; for example, turn the top into the bottom: 1 file changed, 1 insertions(+), 1 deletions(-) 1 file changed, 1 insertion(+), 1 deletion(-) ok op@


Thomas Adam

got: set error on asprintf() failure

ok op@


Thomas Adam

catch a few missed got_pathlist_append() error checks

ok stsp@


Thomas Adam

got: zap dead variable in add_branch()

ok stsp@ op@


Thomas Adam

got: minor refactor of got_pathlist_free() API

Accept flag parameter to optionally specify which pointers to free. This saves callers looping through the list to free pointers. ok + fix stsp@


Thomas Adam

got: expand diffstat -d option to 'got diff'

Like got log -d, add the switch to 'got diff' to display a diffstat of changes; as per stsp's suggestion, we always include diff output with the diffstat. Disabled in gotwebd (for now :) Includes tweaks from op@ ok stsp@


Thomas Adam

fix 'got rebase' not detecting an out-of-date work tree in some cases

ok jamsek, op



Thomas Adam

add -d switch to log usage and sort lexicographically

patch by Josiah Frentsos


Thomas Adam

got: implement diffstat for got log and tog diff view

Add new got_diff_blob_cb() implementation to compute added/removed line metrics for a given diff. This enables displaying a diffstat with 'got log -d'. As per suggestion from stsp, change tog diff view to display the diffstat by default. ok stsp@


Thomas Adam

show full URL during got clone/fetch/send

discussed with and ok jamsek, stsp


Thomas Adam

got send: show server error

Print the error message reported by the remote server when failing to update a branch (for e.g. because of a server-side check.) Reported by gonzalo@, with help and ok stsp@.



Thomas Adam

use mkstemps(3) instead of mkstemp(3) for opening named temporary files

Allows 'got commit' to use a ".diff" suffix for temporary diff files. ok op@



Thomas Adam

require space between commit author name and email, for Git compatibility

Allowing such author fields breaks 'got send' towards Github for affected commits because git-index-pack --strict will error out on the server: $ git index-pack --strict pack-de791fb6a3a1961e44ac5d98d72fd533bf9277c8.pack error: object 5d6bde9eaaf27f41ae8fa7112bb45e489d3c16b9: missingSpaceBeforeEmail: invalid author/committer line - missing space before email fatal: fsck error in packed object problem encountered by landry@ ok op@



Thomas Adam

simplify the way 'got patch' opens a tempfile when reading from stdin

Also add basic test coverage for reading patches from stdin, while here. ok op@



Thomas Adam

sync usage with reality

The -h and -V/--version flags must be given before the command; with those flags the command is actually optional, but don't over-complicate the usage string with these nitpicks. ok/improvements stsp@


Thomas Adam

disallow integrating into references outside refs/heads/

Spotted by stsp@ while considering a feature request for cmd_integrate. ok stsp@


Thomas Adam

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@


Thomas Adam

add gotadmin init -b <branch> to specify repo head ref

Similar to `git init -b`. Includes a change to `got import` behaviour such that "main" is no longer hardcoded by default; instead, we import to the branch resolved via the repository's HEAD reference unless `got import -b` is used, and only if HEAD cannot be resolved to a branch do we fallback to "main". includes fix plus ok from stsp@


Thomas Adam

make got_commit_graph_iter_next use caller-provided storage for the id

and adjust the callers. discussed with and ok stsp@