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

Re: [RFC] [GSoC] Port git-add--interactive.perl:status_cmd to C

From
Junio C Hamano <gitster@pobox.com>
Date
May 2, 2017, 00:32 UTC
Message-ID
<xmqqo9vcf68f.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CAEA2_RLvjRDytE03hfe84TTqvCQm324BXV=GvTU3UVqNWJUXiQ@mail.gmail.com>
"Daniel Ferreira (theiostream)" <bnmvco@gmail.com> writes:
> Reproducing either of these comparisons "natively" would simply
> require running run_diff_index() or run_diff_files() with
> DIFF_FORMAT_NUMSTAT and tweaking diff_flush() to format appropriately
> for the "interactive--add case".

A more usual way to drive the diff machinery and react to its findings is to use DIFF_FORMAT_CALLBACK interface, and walk the collected diff_queue to work on the paths discovered. The way wt-status.c builds "Changes to be committed" list out of the "diff-index --cached" it internally runs and "Changes not staged for commit" out of the "diff-files" it internally runs would be a good example to study.

Previous: Daniel Ferreira (theiostream)Next: Junio C Hamano
Message 2 of 3 in “[RFC] [GSoC] Port git-add--interactive.perl:status_cmd to C”
  1. Daniel Ferreira (theiostream)May 1, 2017
  2. Junio C HamanoMay 2, 2017
  3. Junio C HamanoMay 2, 2017

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.