← All updates

Engineering / Field note

A Git report can count the wrong work

File selection, surrounding context and comparison boundaries shape a change report. A useful total explains what it counted before anyone treats it as a measure of engineering contribution.

By Zyel · Published · 5 min read

A change report can produce an exact-looking total for the wrong collection of files. It can also inflate a result by treating surrounding, unchanged text as deleted work. For a team using repository statistics to discuss a release, an estimate or a handover, those mistakes can change the conversation long before anyone opens the underlying changes.

This November 9, 2026 field note examines established Git behavior and its reporting implications. The situations below are hypothetical examples. Zyel’s interpretation is that a trustworthy engineering metric needs a clear measurement boundary and evidence that the report actually respected it.

A filename can become a pattern

Git calls its path-selection expression a pathspec. Its documented matching rules allow a path to match itself and also allow pattern matching. A filename taken from a repository therefore needs deliberate treatment when a reporting tool passes it back into Git. [1]

Imagine a hypothetical application with one filename containing square brackets and another with a similar name containing a digit. Both change during the reporting period. If an analyzer intends to examine the first file but supplies its name as a pattern, it can include the other file too. A total presented as one component’s work would then include a neighbor’s changes.

Git provides a global literal-path setting that disables globbing and special pathspec syntax. That is an explicit selection mode, rather than an assumption that every supplied filename will receive literal treatment. [2]

The business consequence is misattribution. A report might allocate maintenance to the wrong module, attach unrelated edits to a handover, or make a small release appear broader than it was. These examples describe possible reporting errors, not observed client incidents. The relevant question for a reviewer is whether the requested file set and the measured file set actually agree.

Context belongs to the review

A patch can include unchanged lines around an edit to help a person understand it. Git documents a configurable amount of context and distinguishes added, removed and context lines with separate output indicators. The visible size of a patch therefore includes more than the changed text. [3]

In another hypothetical report, a reviewer requests more surrounding lines to understand an edit. The underlying change stays the same. If the analyzer’s total rises simply because the review includes more context, the report has coupled its measurement to a display preference. That is a useful warning sign: presentation settings should not silently redefine what the dashboard calls changed work.

This matters when a report follows a function through successive revisions. Nearby lines can help explain a change without being part of that change. A visually convincing extract, complete with a familiar function name, does not by itself establish that every line in the extract was added or removed.

The output format carries meaning

Git’s numeric change format reports additions and deletions in a form intended for machine consumption. Its NUL-terminated variant preserves pathnames, and rename records have a different path layout. For binary files, the numeric format marks the line counts as unavailable rather than reporting numeric zeroes. [3]

For a reporting product, these distinctions belong in its data model. An unavailable count should remain visibly unavailable. A renamed file needs an identity policy. An output stream that stopped early needs an incomplete-result state. Silently replacing all three situations with a tidy number would discard information the reviewer needs to interpret that number.

Consider a hypothetical release report containing a changed image alongside source files. A line-based view can describe the source edits while separately acknowledging that the image changed. Converting the image’s unavailable line count into evidence of no work would be an additional judgment made by the reporting tool.

The comparison defines the question

Git supports comparisons between different repository states, including two commits, the index and the working tree. Its documented three-dot comparison uses the common ancestor with the second commit. The chosen endpoints and comparison mode are part of what a result means. [3]

Suppose a hypothetical team adds an experiment, revises it and removes it before a release. A report of intervening edits can show that activity. A comparison of the release’s final contents with its starting contents can show no surviving experiment. Those observations answer different questions: one concerns changes made along the way; the other concerns the difference between two delivered states.

A label such as “contribution” leaves too much of that choice unstated. It may refer to editing activity, surviving code, review work or something else. Our view is that the label should describe the actual measure closely enough that a reader can explain why two legitimate reports of the same history might differ.

Evidence makes the total useful

A credible report has enough information to reproduce its scope: the repository revision, selected paths, comparison policy, relevant settings and any incomplete inputs. Small synthetic cases can expose a boundary error more clearly than a large screenshot. Punctuation in names, expanded context, renames, binary changes and temporary edits each challenge a different assumption.

That evidence still leaves an interpretation task for people. A change count can help locate activity or frame a review discussion. Whether the work solved the customer’s problem, improved reliability or justified an estimate needs its own support. The strongest engineering report makes those follow-up questions easier to ask and gives the reviewer a reliable route back to the work.

Sources + further reading

Source dates describe the original material. Publication above is the date this Zyel article went live.

  1. Git glossary: pathspec semanticsGit project · Checked Nov 9, 2026
  2. Git command options: literal path selectionGit project · Checked Nov 9, 2026
  3. Git diff: context, numeric output and comparisonsGit project · Checked Nov 9, 2026

Reader discussion

What would you ask next?

Questions, useful corrections and thoughtful disagreement are welcome. Comments are reviewed before they appear.

No reader comments yet.

10–2,000 characters. Plain text. Leave out passwords, private project data and personal contact details. A blank display name appears as Anonymous.

Complete the CAPTCHA before sending. Verification runs on your device.