The story
Unknown. First recorded in 1780 in the sea journal of an Englishman. There are two mainstream theories as to its origin, although there is no evidence for either: * French cap-à-pied (“head to foot”) * French nappe pliée (“folded linen”) The proposed nappe pliée fits more closely with the date of first attestation.
Etymology from Wiktionary, CC BY-SA 4.0.