{"thread":{"id":"45366","subject":"Possible tiny bug in reset's error message","startedAt":"2017-03-13T14:55:17Z","lastAt":"2017-03-13T14:55:17Z","messageCount":1,"participants":["Martin Kletzander"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"313894","messageId":"20170313145508.GA3222@wheatley","threadId":"45366","inReplyTo":null,"subject":"Possible tiny bug in reset's error message","fromName":"Martin Kletzander","fromEmail":"mk@linux.com","sentAt":"2017-03-13T14:55:08Z","receivedAt":"2017-03-13T14:55:17Z","isPatch":false,"sender":{"key":"mk@linux.com","avatar":null},"body":"Hi,\n\nwhen I was trying to learn some details about various types of resets, I\nfound out that the default reset type is --mixed, but not specifying it\nis not the same as specifying it.  That's mostly because there are some\nchecks for reset_type before setting it to default value.  Since one of\nthe checks seem deliberate, I'm rather asking here before sending wrong\npatch.\n\nThe \"bug\" I am talking about is:\n\n  $ g reset -p --mixed\n  fatal: --patch is incompatible with --{hard,mixed,soft}\n  $ g reset -p\n  No changes.\n\nDespite the fact that `git help reset` says:\n\n  If <mode> is omitted, defaults to \"--mixed\".\n\n\nThe reason why I'm rather asking is the part of the code that handles\nthe warning message for:\n\n  $ git reset --mixed -- path\n  warning: --mixed with paths is deprecated; use 'git reset -- <paths>'\n  instead.\n\nSpecifically:\n\t/* git reset tree [--] paths... can be used to\n\t * load chosen paths from the tree into the index without\n\t * affecting the working tree nor HEAD. */\n\tif (pathspec.nr) {\n\t\tif (reset_type == MIXED)\n\t\t\twarning(_(\"--mixed with paths is deprecated; use 'git reset -- <paths>' instead.\"));\n\t\telse if (reset_type != NONE)\n\t\t\tdie(_(\"Cannot do %s reset with paths.\"),\n\t\t\t\t\t_(reset_type_names[reset_type]));\n\t}\n\nSee how NONE and MIXED are both purposefully checked?\n\nSo my question is, should reset_type be set to MIXED if it was not\nspecified on the command-line before all these checks?  If not, what's\nthe reason for that?\n\nHave a nice day,\nMartin\n"}]}