# git diff with add/modified codes

9 messages from 2007-07-27 to 2007-07-29. Participants: Jon Smirl, Junio C Hamano, Johannes Schindelin, Jeff King, Jakub Narebski.
Thread: https://gitlist.dev/t/9267

## Jon Smirl, 2007-07-27 22:05

Subject: git diff with add/modified codes
Message-ID: <9e4733910707271505x4eac928axe639308afed20cb3@mail.gmail.com>
URL: https://gitlist.dev/e/9e4733910707271505x4eac928axe639308afed20cb3%40mail.gmail.com

```
Is there a magic git diff incantation that will add file status codes
(Added (A), Copied (C), Deleted (D), Modified (M), Renamed (R)) to the
--stat output? I can't see how to get this info on any diff output
without doing multiple diffs with --diff-filter.

-- 
Jon Smirl
jonsmirl@gmail.com

```

## Junio C Hamano, 2007-07-27 23:22

Subject: Re: git diff with add/modified codes
Message-ID: <7vir85whxy.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vir85whxy.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <9e4733910707271505x4eac928axe639308afed20cb3@mail.gmail.com>

```
Would --stat --summary be satisfactory?

```

## Jon Smirl, 2007-07-28 00:17

Subject: Re: git diff with add/modified codes
Message-ID: <9e4733910707271717q5ea33b55r227d8dbb1023de47@mail.gmail.com>
URL: https://gitlist.dev/e/9e4733910707271717q5ea33b55r227d8dbb1023de47%40mail.gmail.com
In-Reply-To: <7vir85whxy.fsf@assigned-by-dhcp.cox.net>

```
On 7/27/07, Junio C Hamano <gitster@pobox.com> wrote:
> Would --stat --summary be satisfactory?

That's not what I want. I'm looking a report that indicates new files
vs modified ones in a single list. These old patches I am working with
often create 100 files and modify another 200.

Adding a code like (Added (A), Copied (C), Deleted (D), Modified (M),
Renamed (R))  to --stat would be perfect.

-- 
Jon Smirl
jonsmirl@gmail.com

```

## Johannes Schindelin, 2007-07-28 00:48

Subject: Re: git diff with add/modified codes
Message-ID: <Pine.LNX.4.64.0707280148340.14781@racer.site>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0707280148340.14781%40racer.site
In-Reply-To: <7vir85whxy.fsf@assigned-by-dhcp.cox.net>

```
Hi,

On Fri, 27 Jul 2007, Junio C Hamano wrote:

> Would --stat --summary be satisfactory?

Or does "--raw" do the job?

Ciao,
Dscho

```

## Jon Smirl, 2007-07-28 00:54

Subject: Re: git diff with add/modified codes
Message-ID: <9e4733910707271754u3f18f2fdrf508068879acb778@mail.gmail.com>
URL: https://gitlist.dev/e/9e4733910707271754u3f18f2fdrf508068879acb778%40mail.gmail.com
In-Reply-To: <Pine.LNX.4.64.0707280148340.14781@racer.site>

```
On 7/27/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> Hi,
>
> On Fri, 27 Jul 2007, Junio C Hamano wrote:
>
> > Would --stat --summary be satisfactory?
>
> Or does "--raw" do the job?

Raw is much closer. Combine the file stats from --raw with --stat and
it would be perfect.

>
> Ciao,
> Dscho
>
>


-- 
Jon Smirl
jonsmirl@gmail.com

```

## Jeff King, 2007-07-28 04:39

Subject: Re: git diff with add/modified codes
Message-ID: <20070728043901.GB11916@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20070728043901.GB11916%40coredump.intra.peff.net
In-Reply-To: <9e4733910707271717q5ea33b55r227d8dbb1023de47@mail.gmail.com>

```
On Fri, Jul 27, 2007 at 08:17:54PM -0400, Jon Smirl wrote:

> That's not what I want. I'm looking a report that indicates new files
> vs modified ones in a single list. These old patches I am working with
> often create 100 files and modify another 200.
> 
> Adding a code like (Added (A), Copied (C), Deleted (D), Modified (M),
> Renamed (R))  to --stat would be perfect.

How about --name-status?

-Peff

```

## Jakub Narebski, 2007-07-28 15:26

Subject: Re: git diff with add/modified codes
Message-ID: <f8fn72$l30$1@sea.gmane.org>
URL: https://gitlist.dev/e/f8fn72%24l30%241%40sea.gmane.org
In-Reply-To: <20070728043901.GB11916@coredump.intra.peff.net>

```
Jeff King wrote:

> On Fri, Jul 27, 2007 at 08:17:54PM -0400, Jon Smirl wrote:
> 
>> That's not what I want. I'm looking a report that indicates new files
>> vs modified ones in a single list. These old patches I am working with
>> often create 100 files and modify another 200.
>> 
>> Adding a code like (Added (A), Copied (C), Deleted (D), Modified (M),
>> Renamed (R))  to --stat would be perfect.
> 
> How about --name-status?

Or -r --name-status?

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

```

## Jon Smirl, 2007-07-28 18:07

Subject: Re: git diff with add/modified codes
Message-ID: <9e4733910707281107w6aff86f5sf746ca3f2c74d098@mail.gmail.com>
URL: https://gitlist.dev/e/9e4733910707281107w6aff86f5sf746ca3f2c74d098%40mail.gmail.com
In-Reply-To: <f8fn72$l30$1@sea.gmane.org>

```
On 7/28/07, Jakub Narebski <jnareb@gmail.com> wrote:
> Jeff King wrote:
>
> > On Fri, Jul 27, 2007 at 08:17:54PM -0400, Jon Smirl wrote:
> >
> >> That's not what I want. I'm looking a report that indicates new files
> >> vs modified ones in a single list. These old patches I am working with
> >> often create 100 files and modify another 200.
> >>
> >> Adding a code like (Added (A), Copied (C), Deleted (D), Modified (M),
> >> Renamed (R))  to --stat would be perfect.
> >
> > How about --name-status?
>
> Or -r --name-status?

-r is not in the git diff doc but it is used in the examples.
http://www.kernel.org/pub/software/scm/git/docs/git-diff.html

-- 
Jon Smirl
jonsmirl@gmail.com

```

## Jakub Narebski, 2007-07-29 21:36

Subject: Re: git diff with add/modified codes
Message-ID: <200707292336.14473.jnareb@gmail.com>
URL: https://gitlist.dev/e/200707292336.14473.jnareb%40gmail.com
In-Reply-To: <9e4733910707281107w6aff86f5sf746ca3f2c74d098@mail.gmail.com>

```
On Sat, 28 July 2007, Jon Smirl wrote:
> On 7/28/07, Jakub Narebski <jnareb@gmail.com> wrote:
>> Jeff King wrote:
>>
>>> On Fri, Jul 27, 2007 at 08:17:54PM -0400, Jon Smirl wrote:
>>>
>>>> That's not what I want. I'm looking a report that indicates new files
>>>> vs modified ones in a single list. These old patches I am working with
>>>> often create 100 files and modify another 200.
>>>>
>>>> Adding a code like (Added (A), Copied (C), Deleted (D), Modified (M),
>>>> Renamed (R))  to --stat would be perfect.
>>>
>>> How about --name-status?
>>
>> Or -r --name-status?
> 
> -r is not in the git diff doc but it is used in the examples.
> http://www.kernel.org/pub/software/scm/git/docs/git-diff.html

<quote>
  <2> show only names and the nature of change, but not actual
  diff output.  --name-status disables usual patch generation
  which in turn also disables recursive behavior, so without -r
  you would only see the directory name if there is a change in a
  file in a subdirectory.
</quote>

"Of course" one knows that "git diff <tree-ish> <tree-ish>" is
git-diff-tree in disguise, and accepts git-diff-tree options.

By the way, I was thinking about extending --numstat output to include
also status. Current --numstat output is ill fitted to deal with renames
and copies, at least ill fitted for machine consumption of renames
output; it uses "old_name => new_name" as a filename for renames. While
it would be fairly easy to put pre- and after-rename names separated
by TAB, and quoted if needed (including embedded TAB character in
the filename, which would be quoted as \t instead) without breaking
anu current --numstat output parsers (although I don't think any of
them uses -M/-C), it would be hard to do the same for --numstat -z output.
A solution (not best, I admit) would be to use NUL NUL to separate pre-
and post-image filename, but I think it would be best to add new
--numstat-extended format to git-diff.

P.S. Is binary diff output described somewhere?
-- 
Jakub Narebski
Poland

```
