Go off at half-cock
Speak or act prematurely.
Flintlock firearms have a 'cock' or striker mechanism, which is held in a raised, sprung position ready to discharge and make a spark to 'fire' the gun. These can be set at half-cock, when the gun is in a safe state, or at full-cock, when it is ready to be fired. A gun would only 'go off at half-cock' by mistake.
The term half-cock is as old as flintlock guns and appears in print from the mid 18th century; for example, in John Desaguliers' A course of experimental philosophy 1734–44:
"The gun being at Half-Cock, the Spring acts upon the Tumbler with more Advantage."
The earliest known citation of the phrase 'going off at half-cock' comes from London and Its Environs Described, 1761:
"Some arms taken at Bath in the year 1715, distinguished from all others in the Tower, by having what is called dog locks; that is, a kind of lock with a catch to prevent their going off at half-cock."
We now commonly use 'go off at half-cock' or, in America, 'go off half-cocked', to mean 'speak or act impulsively and without proper preparation'. This clearly alludes to the sudden discharge of a firearm. Despite that, the first figurative use of the phrase had a completely different meaning. When the 'half-cocked' imagery was first appropriated it was to mean tipsy, or half-drunk. This was the meaning intended in John Shebbeare's novel Lydia, 1786:
"Who should enter unto the company, but young Captain Firebrace, half-cocked... come hither to finish his evening's potation."
There doesn't appear to be any particular link between the mechanics of firearms and drunkenness. Several other 'half' phrases were also used in the 18th century to mean 'half-drunk'. 'Half-seas-over' was a nautical term that is listed in the first slang dictionary BE's Dictionary of the Canting Crew, circa 1700, with the meaning 'almost drunk'. Another example is 'half-and-half', which, in addition to being the name of a mixture of equal parts ale and porter, was also listed as a term meaning 'tipsy'.
This meaning of 'half-cocked' was taken up with particular enthusiasm in Australia. Clearly, they felt they hadn't enough terms for drunkenness and wanted to expand their repertoire. Fergus Hume's Madame Midas: a story of Australian mining life, 1888, explained the term:
"This last drink reduced Mr. Villiers to that mixed state which is known in colonial phrase as half-cocked."
By 1888, the rest of the English-speaking world had opted for the current meaning of 'half-cock' and 'half-cocked'; for example, in To-day in Ireland, 1825:
"Master Dillon - never let an insult go off half-cock."
Across the Atlantic, The Register of Debates in Congress, 1833, recorded the opinions of Dutee Pearce of Rhode Island:
"I regret that the gentleman from Maryland has gone off half cocked."
See also - lock, stock and barrel.