From: Ramkumar Ramachandra Date: Sun, 17 Jul 2011 11:56:52 GMT Subject: Re: [PATCH 09/17] revert: Don't create invalid replay_opts in parse_args Message-ID: In-Reply-To: <20110712182958.GE14120@elie> Hi again, Jonathan Nieder writes: > 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 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