Page MenuHomeFreeBSD

git-arc: Globally save and restore the git checkout head
ClosedPublic

Authored by markj on Feb 12 2021, 9:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Sep 3, 6:54 AM
Unknown Object (File)
Wed, Sep 2, 8:32 AM
Unknown Object (File)
Mon, Aug 31, 9:35 AM
Unknown Object (File)
Mon, Aug 31, 9:15 AM
Unknown Object (File)
Mon, Aug 31, 8:44 AM
Unknown Object (File)
Mon, Aug 31, 8:19 AM
Unknown Object (File)
Sat, Aug 15, 10:15 PM
Unknown Object (File)
Sat, Aug 15, 4:45 PM
Subscribers

Details

Summary

This script uses -e, so it's prone to exiting in awkward places. In
particular, if arc diff fails, the script just exits without restoring
the checkout.

Mitigate this for now by using a global variable to record the previous
checkout and use a trap handler to restore it in the face of errors. A
better solution might be to use arc diff's --head parameter but that
will require more testing.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable