Repository navigation
v0.7.1 - Review Closure: Two CLI Crashes and SHA-256 Compaction Fixed
What's Changed in v0.7.1
Fixed
git-remote-seafile testandunlockcrashed instead of reporting the failure. Both named their exception in anexceptclause whosefrom … importran inside thetrybut after the first statement that can raise, so any earlier failure — a bad URL, missing credentials, the network — died withUnboundLocalError. These are exactly the two commands a user runs when the remote is already misbehaving. The names are now imported at module scope.- Remote
gcwas completely broken on SHA-256 repositories. The scratch repository was initialised SHA-1, soindex-packrejected the 64-hex packs andrepackexited 128; withseafile.autogcon, it retried forever while the pack directory grew without bound. The fix needs both halves — initialise the scratch repo with the remote's object format, and runverify-pack/index-packwith-C <bare-repo>(they run withGIT_DIRscrubbed). Either alone still fails. - Re-installing a pack died on Windows. git writes pack and index files read-only (
0444), andos.replaceonto a read-only destination fails withWinError 5(POSIX only needs directory write permission). Both targets are made writable before publishing. seafile://host:80/…lost its port and flipped to HTTPS.seafile://host:80/lib/repobecamehttps://host, redirecting to:443and disagreeing with the explicitseafile://http://host:80/…form. A port now decides the scheme::80ishttp,:443ishttps, and any other port keeps its number overhttps. A non-numeric port is refused with a clearInvalid Seafile URL formatmessage instead of a rawValueError.unlock --force <url>read the flag as the URL, producing a confusing "library not found: '--force'". Flags are now skipped before the URL is read.- Library-typo suggestions could never fire. The fuzzy match sat behind a call that had already raised, so the documented feature was unreachable and its unit test passed vacuously. It is now built where the miss is detected, from the listing already fetched.
- A malformed
~/.git-seafile.jsonand an unreadableseafile-ignore.txtnow warn instead of failing silently, and three unguardedlist_diriterations now raise a describable error instead ofAttributeError/KeyError. - "Lost lock ownership" no longer means two different things — a transient renewal failure no longer aborts a push with the takeover message.
Changed
acquire()settles the ticket queue before claiming the lock. A partial directory view could let two clients both read themselves as the winner; a short settlement window (newseafile.locksettle, default1) re-scans before committing. It costs roughly 0.85 s per push per unit, so the "<1 s push" claims in README and USER_GUIDE were corrected rather than left to mislead.- Unreachable branches removed (
get_repo_id's cache re-validation and_detect_remote_object_format's pack-inspection fallback).refs.__all__now exportsis_valid_ref_name,install_packfilepasses--git-dir, andtools/seafile_doctor.pyuses the publicopen_live_sqlite_roinstead of a private helper.
Documentation
USER_GUIDE§7 documents the URL scheme/port rule, and the no-path form (seafile://code→ the library root'sgit-reposubfolder) is documented for the first time. §12 and §14 are corrected against the strings the code actually emits.DESIGN§7.1 now matches the implementation on ticket ordering;PROPOSALS.mdno longer describes the lock removed in v0.7.0.CONTRIBUTING.mdgains a "Releasing" section describing the tag-push process.
Tests & Tooling
gc.pyis fully covered (76% → 100%) by 21 in-process tests for the recovery and fail-closed paths. The e2e harness had been hiding them: it runs the helper throughsubprocess.run, which the parent coverage run never records.- The missing
v0.6.2release notes are restored, and a new guard fails the suite when a merged tag has no notes file, so the gap cannot reopen silently. - Suite: 383 → 454 tests, all green; docs guards 7 → 9.
Full Changelog: v0.7.0...v0.7.1