Git development
 help / color / mirror / Atom feed
* 'git add --patch' no longer allows you to select files before selecting patches
@ 2017-03-13 18:51 Anthony Scian
  2017-03-13 19:09 ` Jeff King
  2017-03-13 19:13 ` Junio C Hamano
  0 siblings, 2 replies; 4+ messages in thread
From: Anthony Scian @ 2017-03-13 18:51 UTC (permalink / raw)
  To: git

Similarly the patch sub-command in ‘git add —interactive’ goes immediately to selecting patches starting with the first file.
Is there a git configuration that would being back the old behaviour? Why was this changed?

here is a sample interaction that shows the ‘r’ sub-command still retains the desired behaviour of asking what files to involve but the ‘p’
sub-command immediately assumes all files are important and starts stepping through all the patches…

:~$ brew list
... git ...
:~$ which git
/usr/local/bin/git
:~$ git version
git version 2.12.0
:~$ 
:~$  git add --interactive
           staged     unstaged path
  1:    unchanged       +43/-2 core/src/main/scala/com/company/npl/planner/TrAc.scala
  2:    unchanged        +4/-4 core/src/main/scala/com/company/npl/tools/AnFu.scala
  3:    unchanged      +59/-12 core/src/main/scala/com/company/npl/tools/CoFu.scala
  4:    unchanged        +7/-1 module/reports/src/main/scala/com/company/npl/reports/ReStCo.scala
  5:    unchanged      +10/-23 runtime/src/main/npl/migrationSchemas/schema_for_migration_to_W4.npl
  6:    unchanged        +5/-3 runtime/src/main/scala/com/company/npl/table/adapter/InPe.scala
  7:    unchanged      +39/-82 runtime/src/main/scala/com/company/npl/table/migrations/schema_for_W4.scala
  8:    unchanged       +14/-1 ui/modules/admin/app/assets/javascripts/defs/de_sub.js

*** Commands ***
  1: status	  2: update	  3: revert	  4: add untracked
  5: patch	  6: diff	  7: quit	  8: help
What now> r
           staged     unstaged path
  1:    unchanged       +43/-2 core/src/main/scala/com/company/npl/planner/TrAc.scala
  2:    unchanged        +4/-4 core/src/main/scala/com/company/npl/tools/AnFu.scala
  3:    unchanged      +59/-12 core/src/main/scala/com/company/npl/tools/CoFu.scala
  4:    unchanged        +7/-1 module/reports/src/main/scala/com/company/npl/reports/ReStCo.scala
  5:    unchanged      +10/-23 runtime/src/main/npl/migrationSchemas/schema_for_migration_to_W4.npl
  6:    unchanged        +5/-3 runtime/src/main/scala/com/company/npl/table/adapter/InPe.scala
  7:    unchanged      +39/-82 runtime/src/main/scala/com/company/npl/table/migrations/schema_for_W4.scala
  8:    unchanged       +14/-1 ui/modules/admin/app/assets/javascripts/defs/de_sub.js
Revert>> 5
           staged     unstaged path
  1:    unchanged       +43/-2 core/src/main/scala/com/company/npl/planner/TrAc.scala
  2:    unchanged        +4/-4 core/src/main/scala/com/company/npl/tools/AnFu.scala
  3:    unchanged      +59/-12 core/src/main/scala/com/company/npl/tools/CoFu.scala
  4:    unchanged        +7/-1 module/reports/src/main/scala/com/company/npl/reports/ReStCo.scala
* 5:    unchanged      +10/-23 runtime/src/main/npl/migrationSchemas/schema_for_migration_to_W4.npl
  6:    unchanged        +5/-3 runtime/src/main/scala/com/company/npl/table/adapter/InPe.scala
  7:    unchanged      +39/-82 runtime/src/main/scala/com/company/npl/table/migrations/schema_for_W4.scala
  8:    unchanged       +14/-1 ui/modules/admin/app/assets/javascripts/defs/de_sub.js
Revert>> 7
           staged     unstaged path
  1:    unchanged       +43/-2 core/src/main/scala/com/company/npl/planner/TrAc.scala
  2:    unchanged        +4/-4 core/src/main/scala/com/company/npl/tools/AnFu.scala
  3:    unchanged      +59/-12 core/src/main/scala/com/company/npl/tools/CoFu.scala
  4:    unchanged        +7/-1 module/reports/src/main/scala/com/company/npl/reports/ReStCo.scala
* 5:    unchanged      +10/-23 runtime/src/main/npl/migrationSchemas/schema_for_migration_to_W4.npl
  6:    unchanged        +5/-3 runtime/src/main/scala/com/company/npl/table/adapter/InPe.scala
* 7:    unchanged      +39/-82 runtime/src/main/scala/com/company/npl/table/migrations/schema_for_W4.scala
  8:    unchanged       +14/-1 ui/modules/admin/app/assets/javascripts/defs/de_sub.js
Revert>> 
reverted 2 paths

*** Commands ***
  1: status	  2: update	  3: revert	  4: add untracked
  5: patch	  6: diff	  7: quit	  8: help
What now> p
diff --git a/core/src/main/scala/com/company/npl/planner/TrAc.scala b/core/src/main/scala/com/company/npl/planner/TrAc.scala
index 938cdc2a1b..669dc5f95b 100644
--- a/core/src/main/scala/com/company/npl/planner/TrAc.scala
+++ b/core/src/main/scala/com/company/npl/planner/TrAc.scala
@@ -24,8 +24,7 @@ import com.company.npl.tools.CoFu
  */
 case class TrAc(action: View with Generator, when: View, exceptWhen: Option[View], required: Boolean) {
   private def mergeAction(rhs: TrAc): View with Generator = action match {
-    case Always | Never =>
-      rhs.action
+    case Always | Never => rhs.action
     case _ =>
       require(rhs.action == Always || rhs.action == Never)
       action
Stage this hunk [y,n,q,a,d,/,j,J,g,e,?]? q

*** Commands ***
  1: status	  2: update	  3: revert	  4: add untracked
  5: patch	  6: diff	  7: quit	  8: help
What now> q
Bye.
:~$




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: 'git add --patch' no longer allows you to select files before selecting patches
  2017-03-13 18:51 'git add --patch' no longer allows you to select files before selecting patches Anthony Scian
@ 2017-03-13 19:09 ` Jeff King
  2017-03-13 19:16   ` Junio C Hamano
  2017-03-13 19:13 ` Junio C Hamano
  1 sibling, 1 reply; 4+ messages in thread
From: Jeff King @ 2017-03-13 19:09 UTC (permalink / raw)
  To: Anthony Scian; +Cc: Junio C Hamano, git

On Mon, Mar 13, 2017 at 02:51:52PM -0400, Anthony Scian wrote:

> Similarly the patch sub-command in ‘git add —interactive’ goes
> immediately to selecting patches starting with the first file.
> Is there a git configuration that would being back the old behaviour?
> Why was this changed?

My, this seems to be a popular bug. This is the third report already. :)

The answer to your final question is that it's a bug. The fix is in
c852bd54bd87fdcdc825f5d45c26aa745be13ba6, which is currently in the
"master" branch of git.git.

Junio, I notice this isn't in "maint", and probably should be. It's a
regression in v2.12.0, so hopefully we'd fix it in v2.12.1.

-Peff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 'git add --patch' no longer allows you to select files before selecting patches
  2017-03-13 18:51 'git add --patch' no longer allows you to select files before selecting patches Anthony Scian
  2017-03-13 19:09 ` Jeff King
@ 2017-03-13 19:13 ` Junio C Hamano
  1 sibling, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2017-03-13 19:13 UTC (permalink / raw)
  To: Anthony Scian; +Cc: git

Anthony Scian <ascian@auvik.com> writes:

> Similarly the patch sub-command in ‘git add —interactive’ goes
> immediately to selecting patches starting with the first file.  Is
> there a git configuration that would being back the old behaviour?
> Why was this changed?

Because people are careless ;-) 

The fix is already proposed and in the 'master' branch.  Please keep
using that version to make sure there is no unexpected regression
caused by the fix.

Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 'git add --patch' no longer allows you to select files before selecting patches
  2017-03-13 19:09 ` Jeff King
@ 2017-03-13 19:16   ` Junio C Hamano
  0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2017-03-13 19:16 UTC (permalink / raw)
  To: Jeff King; +Cc: Anthony Scian, git

Jeff King <peff@peff.net> writes:

> My, this seems to be a popular bug. This is the third report already. :)
>
> The answer to your final question is that it's a bug. The fix is in
> c852bd54bd87fdcdc825f5d45c26aa745be13ba6, which is currently in the
> "master" branch of git.git.

If only more people learn to run 'next', we would get less reports on
already fixed bug and instead get more reports on unexpected regressions
caused by these fixes, both of which would be a very good thing ;-)

> Junio, I notice this isn't in "maint", and probably should be. It's a
> regression in v2.12.0, so hopefully we'd fix it in v2.12.1.

Yes, thanks for an extra reminder.  The reason why I pushed it out
on 'master' during weekend is so that we can have it at least for a
few days there before merging it down to 'maint'.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-13 19:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-13 18:51 'git add --patch' no longer allows you to select files before selecting patches Anthony Scian
2017-03-13 19:09 ` Jeff King
2017-03-13 19:16   ` Junio C Hamano
2017-03-13 19:13 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox