Open Bug 1764663 Opened 3 years ago Updated 1 year ago

Git pre-commit hook does not respect working tree/index distinction

Categories

(Developer Infrastructure :: Lint and Formatting, defect, P3)

Tracking

(Not tracked)

People

(Reporter: rkraesig, Unassigned)

Details

If multiple changes are made to a file, and some but not all of those changes are added to the index (as may be the case after running git add -p), then the pre-commit hook will destroy this distinction by silently adding all the remaining changes to the new commit as well.

Presumably this is what the TODO around line 90 is about.

(I think the ideal behavior here is to run clang-format-diff.py on git diff --cached, and if its output doesn't also apply cleanly to the working tree, just reject the commit. Unconditionally erroring in this state is probably an acceptable fallback, though.)

The severity field is not set for this bug.
:ahal, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(ahal)
Severity: -- → S3
Flags: needinfo?(ahal)
Priority: -- → P3
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.