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

Re: Efficient parsing of `status -z` output

From
Jeff King <peff@peff.net>
Date
Mar 9, 2015, 06:19 UTC
Message-ID
<20150309061920.GB27128@peff.net>
In-Reply-To
<CAMJduDvDO4GesL+eru3h1YHrbF5hFmyycX3f4ADQOo+VnD7GDg@mail.gmail.com>
On Sun, Mar 08, 2015 at 09:41:08PM -0400, Matthew Rothenberg wrote:
Show 7 quoted lines
> I see, thank you. But how would one ever get a copy operation to show
> up in the output of `git status -z` to begin with? It appears copies
> are only detected in `diff` and `show`, can be forced with the
> --find-copies-harder option, but that `git status` does not appear to
> take that option nor detect copies in any way that I can get it to
> replicate and output that status code to me... a test case would be
> great if you know one, thanks!

We don't turn on copy-detection in "git status" by default (only rename detection), and I think you are right that there is currently no way to turn it on manually. However, it would probably be sensible to handle "C" diffs in your parser, if only to future-proof against a day when that changes (and because it should fairly trivial once you build "R" support).

I don't know if anybody is actively working on such a change, but somebody expressed interest recently-ish:

  http://thread.gmane.org/gmane.comp.version-control.git/260381
-Peff
Previous: Matthew RothenbergNext: Jeff King
Message 4 of 7 in “Efficient parsing of `status -z` output”
  1. Matthew RothenbergMar 7, 2015
  2. Junio C HamanoMar 8, 2015
  3. Matthew RothenbergMar 9, 2015
  4. Jeff KingMar 9, 2015
  5. Jeff KingMar 9, 2015
  6. Matthew RothenbergMar 9, 2015
  7. Jeff KingMar 10, 2015

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.