Thread (64 messages) flat view 64 messages, 2 authors, 2016-06-15

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

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:52:46

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]));
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help