{"thread":{"id":"45368","subject":"'git add --patch' no longer allows you to select files before selecting patches","startedAt":"2017-03-13T18:52:02Z","lastAt":"2017-03-13T19:16:28Z","messageCount":4,"participants":["Anthony Scian","Jeff King","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"313924","messageId":"DF55CDE6-E556-4C07-B661-0F5AA00D306E@auvik.com","threadId":"45368","inReplyTo":null,"subject":"'git add --patch' no longer allows you to select files before selecting patches","fromName":"Anthony Scian","fromEmail":"ascian@auvik.com","sentAt":"2017-03-13T18:51:52Z","receivedAt":"2017-03-13T18:52:02Z","isPatch":false,"sender":{"key":"ascian@auvik.com","avatar":null},"body":"Similarly the patch sub-command in ‘git add —interactive’ goes immediately to selecting patches starting with the first file.\nIs there a git configuration that would being back the old behaviour? Why was this changed?\n\nhere is a sample interaction that shows the ‘r’ sub-command still retains the desired behaviour of asking what files to involve but the ‘p’\nsub-command immediately assumes all files are important and starts stepping through all the patches…\n\n:~$ brew list\n... git ...\n:~$ which git\n/usr/local/bin/git\n:~$ git version\ngit version 2.12.0\n:~$ \n:~$  git add --interactive\n           staged     unstaged path\n  1:    unchanged       +43/-2 core/src/main/scala/com/company/npl/planner/TrAc.scala\n  2:    unchanged        +4/-4 core/src/main/scala/com/company/npl/tools/AnFu.scala\n  3:    unchanged      +59/-12 core/src/main/scala/com/company/npl/tools/CoFu.scala\n  4:    unchanged        +7/-1 module/reports/src/main/scala/com/company/npl/reports/ReStCo.scala\n  5:    unchanged      +10/-23 runtime/src/main/npl/migrationSchemas/schema_for_migration_to_W4.npl\n  6:    unchanged        +5/-3 runtime/src/main/scala/com/company/npl/table/adapter/InPe.scala\n  7:    unchanged      +39/-82 runtime/src/main/scala/com/company/npl/table/migrations/schema_for_W4.scala\n  8:    unchanged       +14/-1 ui/modules/admin/app/assets/javascripts/defs/de_sub.js\n\n*** Commands ***\n  1: status\t  2: update\t  3: revert\t  4: add untracked\n  5: patch\t  6: diff\t  7: quit\t  8: help\nWhat now> r\n           staged     unstaged path\n  1:    unchanged       +43/-2 core/src/main/scala/com/company/npl/planner/TrAc.scala\n  2:    unchanged        +4/-4 core/src/main/scala/com/company/npl/tools/AnFu.scala\n  3:    unchanged      +59/-12 core/src/main/scala/com/company/npl/tools/CoFu.scala\n  4:    unchanged        +7/-1 module/reports/src/main/scala/com/company/npl/reports/ReStCo.scala\n  5:    unchanged      +10/-23 runtime/src/main/npl/migrationSchemas/schema_for_migration_to_W4.npl\n  6:    unchanged        +5/-3 runtime/src/main/scala/com/company/npl/table/adapter/InPe.scala\n  7:    unchanged      +39/-82 runtime/src/main/scala/com/company/npl/table/migrations/schema_for_W4.scala\n  8:    unchanged       +14/-1 ui/modules/admin/app/assets/javascripts/defs/de_sub.js\nRevert>> 5\n           staged     unstaged path\n  1:    unchanged       +43/-2 core/src/main/scala/com/company/npl/planner/TrAc.scala\n  2:    unchanged        +4/-4 core/src/main/scala/com/company/npl/tools/AnFu.scala\n  3:    unchanged      +59/-12 core/src/main/scala/com/company/npl/tools/CoFu.scala\n  4:    unchanged        +7/-1 module/reports/src/main/scala/com/company/npl/reports/ReStCo.scala\n* 5:    unchanged      +10/-23 runtime/src/main/npl/migrationSchemas/schema_for_migration_to_W4.npl\n  6:    unchanged        +5/-3 runtime/src/main/scala/com/company/npl/table/adapter/InPe.scala\n  7:    unchanged      +39/-82 runtime/src/main/scala/com/company/npl/table/migrations/schema_for_W4.scala\n  8:    unchanged       +14/-1 ui/modules/admin/app/assets/javascripts/defs/de_sub.js\nRevert>> 7\n           staged     unstaged path\n  1:    unchanged       +43/-2 core/src/main/scala/com/company/npl/planner/TrAc.scala\n  2:    unchanged        +4/-4 core/src/main/scala/com/company/npl/tools/AnFu.scala\n  3:    unchanged      +59/-12 core/src/main/scala/com/company/npl/tools/CoFu.scala\n  4:    unchanged        +7/-1 module/reports/src/main/scala/com/company/npl/reports/ReStCo.scala\n* 5:    unchanged      +10/-23 runtime/src/main/npl/migrationSchemas/schema_for_migration_to_W4.npl\n  6:    unchanged        +5/-3 runtime/src/main/scala/com/company/npl/table/adapter/InPe.scala\n* 7:    unchanged      +39/-82 runtime/src/main/scala/com/company/npl/table/migrations/schema_for_W4.scala\n  8:    unchanged       +14/-1 ui/modules/admin/app/assets/javascripts/defs/de_sub.js\nRevert>> \nreverted 2 paths\n\n*** Commands ***\n  1: status\t  2: update\t  3: revert\t  4: add untracked\n  5: patch\t  6: diff\t  7: quit\t  8: help\nWhat now> p\ndiff --git a/core/src/main/scala/com/company/npl/planner/TrAc.scala b/core/src/main/scala/com/company/npl/planner/TrAc.scala\nindex 938cdc2a1b..669dc5f95b 100644\n--- a/core/src/main/scala/com/company/npl/planner/TrAc.scala\n+++ b/core/src/main/scala/com/company/npl/planner/TrAc.scala\n@@ -24,8 +24,7 @@ import com.company.npl.tools.CoFu\n  */\n case class TrAc(action: View with Generator, when: View, exceptWhen: Option[View], required: Boolean) {\n   private def mergeAction(rhs: TrAc): View with Generator = action match {\n-    case Always | Never =>\n-      rhs.action\n+    case Always | Never => rhs.action\n     case _ =>\n       require(rhs.action == Always || rhs.action == Never)\n       action\nStage this hunk [y,n,q,a,d,/,j,J,g,e,?]? q\n\n*** Commands ***\n  1: status\t  2: update\t  3: revert\t  4: add untracked\n  5: patch\t  6: diff\t  7: quit\t  8: help\nWhat now> q\nBye.\n:~$\n\n\n\n"},{"id":"313929","messageId":"20170313190936.vjyzdr2s2rc66frc@sigill.intra.peff.net","threadId":"45368","inReplyTo":"DF55CDE6-E556-4C07-B661-0F5AA00D306E@auvik.com","subject":"Re: 'git add --patch' no longer allows you to select files before selecting patches","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-03-13T19:09:36Z","receivedAt":"2017-03-13T19:09:43Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Mar 13, 2017 at 02:51:52PM -0400, Anthony Scian wrote:\n\n> Similarly the patch sub-command in ‘git add —interactive’ goes\n> immediately to selecting patches starting with the first file.\n> Is there a git configuration that would being back the old behaviour?\n> Why was this changed?\n\nMy, this seems to be a popular bug. This is the third report already. :)\n\nThe answer to your final question is that it's a bug. The fix is in\nc852bd54bd87fdcdc825f5d45c26aa745be13ba6, which is currently in the\n\"master\" branch of git.git.\n\nJunio, I notice this isn't in \"maint\", and probably should be. It's a\nregression in v2.12.0, so hopefully we'd fix it in v2.12.1.\n\n-Peff\n"},{"id":"313930","messageId":"xmqq8to9rnwe.fsf@gitster.mtv.corp.google.com","threadId":"45368","inReplyTo":"DF55CDE6-E556-4C07-B661-0F5AA00D306E@auvik.com","subject":"Re: 'git add --patch' no longer allows you to select files before selecting patches","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-03-13T19:13:05Z","receivedAt":"2017-03-13T19:13:39Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Anthony Scian <ascian@auvik.com> writes:\n\n> Similarly the patch sub-command in ‘git add —interactive’ goes\n> immediately to selecting patches starting with the first file.  Is\n> there a git configuration that would being back the old behaviour?\n> Why was this changed?\n\nBecause people are careless ;-) \n\nThe fix is already proposed and in the 'master' branch.  Please keep\nusing that version to make sure there is no unexpected regression\ncaused by the fix.\n\nThanks.\n"},{"id":"313932","messageId":"xmqq4lyxrnr3.fsf@gitster.mtv.corp.google.com","threadId":"45368","inReplyTo":"20170313190936.vjyzdr2s2rc66frc@sigill.intra.peff.net","subject":"Re: 'git add --patch' no longer allows you to select files before selecting patches","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-03-13T19:16:16Z","receivedAt":"2017-03-13T19:16:28Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> My, this seems to be a popular bug. This is the third report already. :)\n>\n> The answer to your final question is that it's a bug. The fix is in\n> c852bd54bd87fdcdc825f5d45c26aa745be13ba6, which is currently in the\n> \"master\" branch of git.git.\n\nIf only more people learn to run 'next', we would get less reports on\nalready fixed bug and instead get more reports on unexpected regressions\ncaused by these fixes, both of which would be a very good thing ;-)\n\n> Junio, I notice this isn't in \"maint\", and probably should be. It's a\n> regression in v2.12.0, so hopefully we'd fix it in v2.12.1.\n\nYes, thanks for an extra reminder.  The reason why I pushed it out\non 'master' during weekend is so that we can have it at least for a\nfew days there before merging it down to 'maint'.\n"}]}