Much is being made of President-Elect Trump's decision to nominate (so far) three recently retired Generals to head cabinet departments. The American media has frequently pointed out limited restrictions on former Generals serving as Defense Secretary, and the "waiver" granted to George Marshall to do so. But how rare, otherwise, have Generals-as-cabinet-secretaries actually been in history? Is three unprecedented? And how good an analog are historical examples of Generals in the cabinet, giving that the career of a General today may not closely resemble that of his/her counterpart in other periods of US history.
It isn't exactly common, but is certainly not unheard of. Especially when you go beyond just the time that DoD has been one organization and look at men whos served as Secretary of War(in charge of the Army with the Navy Dept being a co-equal independent dept.). And as you rightly understand men could achieve flag rank much faster, especially when you count state militias.
In fact the very first Secretary of War was Henry Knox, who had served as the chief artillery officer of the Continental Army as one of Washington's chief subordinates. While one of his peers, General Dearborn would serve for 8 years under Jefferson and also help establish West Point. You also had Timothy Pickering who had commanded militia but then served as Washington's Adjutant General and then Quartermaster General for the whole army though while senior I am not quite sure what actual rank he held, could have topped out at Colonel or Major. He served in a variety of Cabinet posts including 5 years as Secretary of State under Washington and Adams.
Then later we have a notable pair just after the Civil War. In 1868 Johnson finally forced Stanton out and appointed in his place on an interim basis General John Scofield. Scofield though more than any of the others was really just on a leave of absence from the Regular Army. He had been serving as the commander of the Department of Virginia, and after his holding down the fort was promoted to Major General and sent out to Missouri.
Replacing him on a permanent basis under Grant was then General John Rawlins who had been his Chief of Staff through the war and close friend though he died of TB about 6 months later. However in that time he had acted to restrict authority of the Commanding General, Sherman, by having Grant agree to once again place the administrative Bureau heads under the Secretary's authority as opposed to the senior general's. This led to a hardening of feelings between Grant and Sherman when Grant refused to reverse the move, in part perhaps because of feelings about not wanting to mire the ill Rawlins in a battle. His replacement then was William Belknap who had risen to Brevet Major General of Volunteers under Sherman in honor of his distinguished service while taking Atlanta.
Long story short it is still uncommon, especially for career soldiers, and in an era when you are far less likely to see such quick promotion as you did in the Revolution of Civil War. But those saying that Marshall is the only other comparable example do miss some of the nuance of the subject.