Signed-off-by: Boyd Stephen Smith Jr <bss@iguanasuicide.net> --- On Thursday 2008 December 18 18:21:25 Linus Torvalds wrote:
> I suspect we should warn about reverting merges.
Here is a patch (aginst c0ceb2c, which I believe is master currently) that does just that.
After applying the patch I get the following test results: fixed 1 success 4108 failed 0 broken 4 total 4113
builtin-revert.c | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-)
Show changes to builtin-revert.c +15 −0
diff --git a/builtin-revert.c b/builtin-revert.c index 4038b41..7f121a5 100644 --- a/builtin-revert.c +++ b/builtin-revert.c @@ -296,6 +296,21 @@ static int revert_or_cherry_pick(int argc, const char **argv) int cnt; struct commit_list *p; + do { + switch (action) { + case REVERT: + warning("revert on a merge commit may not do what you expect."); + continue; + case CHERRY_PICK: + /* Cherry picking a merge doesn't merge the history, but + * I don't think many people expect that. + */ + continue; + } + /* Unhandled enum member. */ + die("Unknown action on a merge commit."); + } while (0); + if (!mainline) die("Commit %s is a merge but no -m option was given.", sha1_to_hex(commit->object.sha1));
-- 1.5.6 -- Boyd Stephen Smith Jr. ,= ,-_-. =. bss@iguanasuicide.net ((_/)o o(\_)) ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-' http://iguanasuicide.net/ \_/