Re: [PATCH 09/17] revert: Don't create invalid replay_opts in parse_args
- From
Ramkumar Ramachandra <artagnon@gmail.com>
- Date
- Jul 17, 2011, 11:56 UTC
- Message-ID
- <CALkWK0kcZi87watFTZCFUJpNf1T-wnRPyQ6FcDxmvFzAZE3osg@mail.gmail.com>
- In-Reply-To
- <20110712182958.GE14120@elie>
Hi again,
Jonathan Nieder writes:
Show 8 quoted lines
> Ramkumar Ramachandra wrote: >> The "--ff" command-line option cannot be used with four other >> command-line options. > > The above sounds like --ff is a bit of a diva and does not like to > be on a commandline with argc >= 6. But I get the idea. > > Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Thanks. New commit message de-emphasizing "four":
revert: Don't create invalid replay_opts in parse_args
The "--ff" command-line option cannot be used with some other command-line options. However, parse_args still parses these incompatible options into a replay_opts structure for use by the rest of the program. Although pick_commits, the current gatekeeper to the cherry-pick machinery, checks the validity of the replay_opts structure before before starting its operation, there will be multiple entry points to the cherry-pick machinery in future. To futureproof the code and catch these errors in one place, make sure that an invalid replay_opts structure is not created by parse_args in the first place. Also ensure that regressions in maintaining this invariant are caught in the future by adding an assertion in pick_commits.
-- Ram