git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git diff with add/modified codes

From
Jakub Narebski <jnareb@gmail.com>
Date
Jul 29, 2007, 21:36 UTC
Message-ID
<200707292336.14473.jnareb@gmail.com>
In-Reply-To
<9e4733910707281107w6aff86f5sf746ca3f2c74d098@mail.gmail.com>
On Sat, 28 July 2007, Jon Smirl wrote:
Show 18 quoted lines
> 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
Previous: Jon SmirlNext: Johannes Schindelin
Message 7 of 9 in “git diff with add/modified codes”
  1. Jon SmirlJul 27, 2007
  2. Junio C HamanoJul 27, 2007
  3. Jon SmirlJul 28, 2007
  4. Jeff KingJul 28, 2007
  5. Jakub NarebskiJul 28, 2007
  6. Jon SmirlJul 28, 2007
  7. Jakub NarebskiJul 29, 2007
  8. Johannes SchindelinJul 28, 2007
  9. Jon SmirlJul 28, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.