Lock, stock and barrel
The whole thing.
I've seen it suggested that this phrase refers to all of a shopkeeper's possessions - the stock in trade, the items stored in barrels and the lock to the door. This explanation is entirely fanciful though - the 'whole thing' in question when this phrase originated was a musket. Muskets were composed of three parts:
- The lock, or flintlock, which is the firing mechanism. Various forms of 'lock' muskets were used from the 1400s onwards, e.g. firelocks, flintlocks, matchlocks etc. The term 'lock' was probably adopted because the mechanism resembles a door lock.
- The stock, which is the wooden butt-end of the gun. 'Stock' is the old term for wooden butt or stump and is a generic term for a solid base. It was used as early as 1495 in association with Tudor guns, in a bill for 'gonne stokkes'. See also laughing stock.
- The barrel, that is, a cylindrical object, is an even older word and was well-established by the 15th century. This is the least obvious of these three terms to have been chosen to name a musket part. After all, in the 15th century people would have been very familiar with barrels as the squat coopered tubs used for storage - hardly similar to the parallel-sided cylindrical tubes that were used in muskets. It may have been that the term migrated from cannons or other sorts of gun which were more barrel-shaped.
Note: that 'lock, stock and barrel' refers to muskets, not rifles. What makes rifles different from earlier guns are the spiral grooves inside the barrel, which cause the bullet to rotate and fly more truly. 'Rifle' derives from the French verb 'rifler' - to scratch or scrape.
Note again: that some make a distinction between spirals (that is, coiling around a fixed point - like a watch-spring) and helixes (that is, advancing around an axis - like a corkscrew). If you prefer such nicety then your rifle's grooves are helicoid not spiral.
Given the antiquity of the three words that make up the phrase and the fact that guns have been in use since at least the Hundred Years' War in 1450, and even earlier in other countries e.g. China, we might expect it to be very old. In fact it isn't particularly; the earliest use of it appears to come from around the beginning of the 19th century. The reason for the weasly 'around' is the difficulty of separating the literal uses of 'lock, stock and barrel' from the figurative uses that don't refer directly to guns; for example, the earliest use of the phrase that I have found is from James Ray's A Compleat History of the [Jacobite] Rebellion, 1752:
...she found my Highland Pistols, which were a Piece of curious Workmanship, the Stock, Lock and Barrel being of polish'd Steel.
Calling that usage a phrase is stretching reality thin; it is more a form of words and certainly not a metaphorical reference to 'the whole thing'. Such grouping together of 'stock' and 'lock' and 'barrel' does lay the groundwork for their adoption as a single unit, that is, a phrase; an example of that is found in the USA in July 1803 in The Connecticut Sentinel. The newspaper included a letter that reported on a celebration of the 4th of July, in the town of Stratford. The 30 men present carried a 'huge keg of rum' around the town and then drank toasts with 'full bumpers' [glasses filled to the brim] to:
1st: The 4th of July, 1776, the birthday of our ninepence...
2nd: Jefferson, Paine, Gallatin and all the rest...
6th: Patriotism - Self interest, the cock, lock, stock and barrel.
[and so on...]
After the 13th toast the records peter out, remarking that the company was 'over zealous' and 'celebrated all night'. The participants might have been 'feeling no pain' and possibly recalled little detail the next morning, but the writer seems to have noted the events precisely. His usage is clearly figurative rather than literal and as such is the earliest use of the phrase that I am aware of. The inclusion of 'cock' [the firing hammer] lends additional weight to the argument that the allusion is to firearms. The colloquial use and lack of any explanation suggests that the phrase was in circulation in the USA in 1803 and earlier citations may well be found.
Rudyard Kipling came close to giving us a definition of the term in 1891, in Light That Failed:
"The whole thing, lock, stock, and barrel, isn't worth one big yellow sea-poppy."