Subject: Re: [PATCH 2/8] revert: decouple sequencer actions from builtin commands

From: Jonathan Nieder <[email-masked]>
Date: Tue, 10 Jan 2012 23:04:04 -0600

Ramkumar Ramachandra wrote:

> I wrote that too quickly.  I can't stand seeing so many strcmp() calls
> all over my codebase -- look at the number of instances of matching
> opts->command to REPLAY_CMD_*.

If the number of such in sequencer.c is greater than 0, it's probably
a bug.  Why would the sequencer change behavior based on its caller's
name?

It's very easy for me to be wrong, though --- this is just a first
reaction, and I haven't looked at this version of sequencer.c yet,
since it doesn't exist. :)

Is this what you're talking about?

	if (opts->action == CHERRY_PICK)
		error(_("Your local changes would be overwritten by cherry-pick."));
	else
		error(_("Your local changes would be overwritten by revert."));

Now imagine "git rebase" wants to hook into the same stuff. What
should the message be?

Maybe:

	error(_("your local changes would be overwritten - aborting"));

Or:

	error(_(opts->error_msgs[REPLAY_WOULD_CLOBBER_LOCAL_CHANGES]));