# Unable to use --patch with git add

8 messages from 2017-10-11 to 2017-10-12. Participants: Ayush Goel, Santiago Torres, Jeff King, Kevin Daudt, Jonathan Nieder.
Thread: https://gitlist.dev/t/46951

## Ayush Goel, 2017-10-11 17:46

Subject: Unable to use --patch with git add
Message-ID: <CAEBs8jLnU44n2fhE8tGommqfEpFPdd0FLUtmeZXZ+qhB1RV6XQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAEBs8jLnU44n2fhE8tGommqfEpFPdd0FLUtmeZXZ%2BqhB1RV6XQ%40mail.gmail.com

```
$ git --version
git version 2.14.2

What more details can I provide to help debug this?

-- 
Regards,
Ayush Goel

```

## Santiago Torres, 2017-10-11 17:49

Subject: Re: Unable to use --patch with git add
Message-ID: <20171011174952.almye3qa2tmyrmol@LykOS.localdomain>
URL: https://gitlist.dev/e/20171011174952.almye3qa2tmyrmol%40LykOS.localdomain
In-Reply-To: <CAEBs8jLnU44n2fhE8tGommqfEpFPdd0FLUtmeZXZ+qhB1RV6XQ@mail.gmail.com>

```
It'd be helpful to know:

- What did you do?
- What did you expect to happen?
- What happened instead?

I suspect you are using --patch with a new file, so you probably need to first
add it with -N or so. This is just a shot in the dark though...

Thanks,
-Santiago.

On Wed, Oct 11, 2017 at 11:16:39PM +0530, Ayush Goel wrote:
> $ git --version
> git version 2.14.2
> 
> What more details can I provide to help debug this?
> 
> -- 
> Regards,
> Ayush Goel

```

## Ayush Goel, 2017-10-11 17:55

Subject: Re: Unable to use --patch with git add
Message-ID: <CAEBs8jKAsb3B-6WJ=ptL2AsGvDRFVPYLCsztpdTN6KCBLOo1XA@mail.gmail.com>
URL: https://gitlist.dev/e/CAEBs8jKAsb3B-6WJ%3DptL2AsGvDRFVPYLCsztpdTN6KCBLOo1XA%40mail.gmail.com
In-Reply-To: <20171011174952.almye3qa2tmyrmol@LykOS.localdomain>

```
Hello Santiago,

Thank you for picking this up.


On Wed, Oct 11, 2017 at 11:19 PM, Santiago Torres <santiago@nyu.edu> wrote:
> It'd be helpful to know:
>
> - What did you do?

I have recently updated to git version 2.14.2. The problem started
happening after that.
Made changes to a file. Tried `git add -p`.

> - What did you expect to happen?

Enter the patch add mode of git.

> - What happened instead?

Usual git patch mode is that it shows a patch and expects user to
add/skip/split etc. Instead it never stops to take input from me.

See this ->


git add -p
diff --git a/Tests/OSXTests/TDTStreamingTests.m
b/Tests/OSXTests/TDTStreamingTests.m
index 35757bc..525fe56 100644
--- a/Tests/OSXTests/TDTStreamingTests.m
+++ b/Tests/OSXTests/TDTStreamingTests.m
@@ -116,7 +116,7 @@ static NSTask *compressionServerTask;
 }

 - (void)breathe {
-  NSDate *date = [NSDate dateWithTimeIntervalSinceNow:0.1];
+  NSDate *date = [NSDate dateWithTimeIntervalSinceNow:0.01];
   [[NSRunLoop currentRunLoop] runUntilDate:date];
 }

#### Expecting git input mode to stop the process here #####
#### Instead git exits without any error #####

>
> I suspect you are using --patch with a new file, so you probably need to first
> add it with -N or so. This is just a shot in the dark though...
>

Not adding new file.

> Thanks,
> -Santiago.
>
> On Wed, Oct 11, 2017 at 11:16:39PM +0530, Ayush Goel wrote:
>> $ git --version
>> git version 2.14.2
>>
>> What more details can I provide to help debug this?
>>
>> --
>> Regards,
>> Ayush Goel



-- 
Regards,
Ayush Goel

```

## Jeff King, 2017-10-11 18:00

Subject: Re: Unable to use --patch with git add
Message-ID: <20171011180015.mqn5xkj5z4yjdrhm@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20171011180015.mqn5xkj5z4yjdrhm%40sigill.intra.peff.net
In-Reply-To: <CAEBs8jKAsb3B-6WJ=ptL2AsGvDRFVPYLCsztpdTN6KCBLOo1XA@mail.gmail.com>

```
On Wed, Oct 11, 2017 at 11:25:52PM +0530, Ayush Goel wrote:

> On Wed, Oct 11, 2017 at 11:19 PM, Santiago Torres <santiago@nyu.edu> wrote:
> > It'd be helpful to know:
> >
> > - What did you do?
> 
> I have recently updated to git version 2.14.2. The problem started
> happening after that.
> Made changes to a file. Tried `git add -p`.

This is a known issue in v2.14.2 with having "color.ui" set to "always"
in your config.

There's a fix in v2.15.0-rc1. You can either upgrade to that, or as a
workaround set "color.ui" to "auto" (or remove it completely from your
config, as "auto" is the default).

-Peff

```

## Ayush Goel, 2017-10-11 18:13

Subject: Re: Unable to use --patch with git add
Message-ID: <CAEBs8jLyvyE+t=9mDHkD0nUY2SBYymg44BeQbUF0Li4CSZhMWg@mail.gmail.com>
URL: https://gitlist.dev/e/CAEBs8jLyvyE%2Bt%3D9mDHkD0nUY2SBYymg44BeQbUF0Li4CSZhMWg%40mail.gmail.com
In-Reply-To: <20171011180015.mqn5xkj5z4yjdrhm@sigill.intra.peff.net>

```
Hey Jeff,

Thank you for your mail. It works :)

For future reference, is there a page for known issues of git?

On Wed, Oct 11, 2017 at 11:30 PM, Jeff King <peff@peff.net> wrote:
> On Wed, Oct 11, 2017 at 11:25:52PM +0530, Ayush Goel wrote:
>
>> On Wed, Oct 11, 2017 at 11:19 PM, Santiago Torres <santiago@nyu.edu> wrote:
>> > It'd be helpful to know:
>> >
>> > - What did you do?
>>
>> I have recently updated to git version 2.14.2. The problem started
>> happening after that.
>> Made changes to a file. Tried `git add -p`.
>
> This is a known issue in v2.14.2 with having "color.ui" set to "always"
> in your config.
>
> There's a fix in v2.15.0-rc1. You can either upgrade to that, or as a
> workaround set "color.ui" to "auto" (or remove it completely from your
> config, as "auto" is the default).
>
> -Peff



-- 
Regards,
Ayush Goel

```

## Jeff King, 2017-10-11 18:27

Subject: Re: Unable to use --patch with git add
Message-ID: <20171011182709.be6qwvbsdnam66u7@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20171011182709.be6qwvbsdnam66u7%40sigill.intra.peff.net
In-Reply-To: <CAEBs8jLyvyE+t=9mDHkD0nUY2SBYymg44BeQbUF0Li4CSZhMWg@mail.gmail.com>

```
On Wed, Oct 11, 2017 at 11:43:46PM +0530, Ayush Goel wrote:

> Thank you for your mail. It works :)
> 
> For future reference, is there a page for known issues of git?

No, there's just the mailing list archive. But you can search it. E.g.:

  https://public-inbox.org/git/?q=%22add+-p%22

finds the relevant threads.

-Peff

```

## Kevin Daudt, 2017-10-11 18:49

Subject: Re: Unable to use --patch with git add
Message-ID: <20171011184907.GD16800@alpha.vpn.ikke.info>
URL: https://gitlist.dev/e/20171011184907.GD16800%40alpha.vpn.ikke.info
In-Reply-To: <CAEBs8jLnU44n2fhE8tGommqfEpFPdd0FLUtmeZXZ+qhB1RV6XQ@mail.gmail.com>

```
On Wed, Oct 11, 2017 at 11:16:39PM +0530, Ayush Goel wrote:
> $ git --version
> git version 2.14.2
> 
> What more details can I provide to help debug this?
> 

Hello Ayush,

Run:

  git config --global color.ui auto
  git config --unset --local color.ui #in case it's set locally

This is a known 'breakage' because people have set color.ui to always
(which should not be used anyway).

Kind regards, Kevin

```

## Jonathan Nieder, 2017-10-12 03:05

Subject: Re: Unable to use --patch with git add
Message-ID: <20171012030543.GA155740@aiede.mtv.corp.google.com>
URL: https://gitlist.dev/e/20171012030543.GA155740%40aiede.mtv.corp.google.com
In-Reply-To: <CAEBs8jLyvyE+t=9mDHkD0nUY2SBYymg44BeQbUF0Li4CSZhMWg@mail.gmail.com>

```
Hi Ayush,

Ayush Goel wrote:

> Thank you for your mail. It works :)
>
> For future reference, is there a page for known issues of git?

We usually try not to have known issues that would require such a
warning for long.  And when we fail, reminders like yours are very
welcome, though a search through the mailing list archive for an
existing thread to reply to instead of starting a new one is always
welcome.

Sorry for the trouble.

Sincerely,
Jonathan

```
