Commit Briefs
pass repository hash algorithm to libexec helpers on the command line
For now, this is a purely mechanical non-functional change which ensures that the main process's idea of the hash algorithm is known to all helpers. This will allow us to reduce overhead by not having to send the hash algorithm along via a struct got_object_id in imsg buffers. Instead we could now send raw SHA1 or SHA256 hashes in messages since the hash algorithm is now known by all processes before messages are exchanged.
do not ask got-read-pack to paint commits which are known keeps or drops
Avoids a long loop observed in gotadmin cleanup with enumeration offloaded to got-read-pack.
remove loaded commits counter from gotadmin cleanup progress
This counter was now always zero since the looping code which was raising this counter has been removed.
speed up gotadmin cleanup object enumeration
The gotadmin cleanup main process was enumerating objects one-by-one, before creating a pack file, by opening every object in the repository with a round-trip to libexec helpers like got-read-pack, got-read-blob, etc. This enumeration loop was a remnant of an early version of gotadmin cleanup which only supported cleaning up loose objects. We can remove this loop, and rely on the pack file creation code instead where we benefit from offloading of object enumeration to got-read-pack with much improved speed. As a side-effect, fix some issues where some objects where not added to generated pack files: directly referenced trees and blobs, and tags which are only referenced via other tags. These issues were uncovered by the regression test suite of gotadmin cleanup.
speed up object enumeration when offloaded to got-read-pack
Previously, got-read-pack was using standard tree object imsg data structures when reporting enumrated tree objects which include information that is not needed when enumerating objects. For example, tree paths passed back from got-read-pack were run through a hash function by the main process and never used for anything else. It is faster to pass the required 4 byte hash directly instead of passing the full path. Reduce such overhead as much as possible with a dedicated message structure. My test case was running just the enumeration phase on a git.git repo which contains commit history up to Git's 1c00d2d8392f603a6263f11f1a50fde96ae5475e In this debug build, 'gotadmin pack' exits with "feature not implemented" as soon as object enumeration is done (a change not part of this commit). Before: $ time gotadmin pack -a master 80846 commits colored; 399225 objects found; 160376 trees scanned gotadmin: feature not implemented 1m59.86s real 2m11.57s user 0m09.13s system After: $ time gotadmin pack -a master 80846 commits colored; 399225 objects found; 160376 trees scanned gotadmin: feature not implemented 1m29.78s real 1m39.55s user 0m06.81s system
CHANGES for 0.131 (tags/0.131)
prevent branches in protected branch namespaces from being rewound
Found by Cas Hariri
sync files from diff.git 5d8f044ef31781fd2b1488a2394b9be344c53f7a398d6025cd7fad7b1f42549e
always print a tab after the file name the way patch extracts the filename from the '---' and '+++' lines (and also Index: etc, ...) is by breaking at the first white space. If there is a tab though, patch will extract everything up to that tab, including whitespaces. This is how it's possible to patch file with whitespaces in them. It's not possible to patch file with tabs or newlines in their name though, unfortunately. ok stsp on the code; regress fixed afterwards.
regress/cmdline: add a patch test for a file name with whitespaces in it
it's already passing, but make sure we won't add regressions.
