Many public officials have accomplished much over the course of their careers, having served in various capacities over the years. For example, Leon Panetta represented CA's 17th district in the House of Representatives for nearly 9 terms before President Clinton tapped him for Director of OMB in 1993 and then for White House Chief of Staff a year later. In 2009, President Obama nominated him for Director of the CIA, and then for Secretary of Defense two years later.
Similarly, the military has a "move up or move out" attitude, nearly guaranteeing career servicemembers a number of rank changes over time. David Petraeus commanded the 101st Airborne Division in 2003 as a Major General (two stars) during the invasion of Iraq. In mid-2004, he was promoted to Lieutenant General (three stars), and attained his final rank of General (four stars) in 2007.
When talking about his past, is there a preferred writing style for referring to his rank at the time?
From Petraeus' Wikipedia article:
In 2003, Petraeus, then a major general, saw combat for the first time...
From an article in The Week about the Paula Broadwell scandal:
Broadwell met then–Lt. Gen. Petraeus when she was earning her master's degree
This Washington Post article manages to fit two previous titles into the same caption:
In his first public testimony since resigning as CIA director, former Army Gen. David Petraeus offered an apology
I'm assuming all these examples are perfectly acceptable in use. Is there a definitive recommended style, and are there any demonstrably bad examples of such that should be avoided?