If you try to back out a patch that includes some clang-format reformatting, the reformatting doesn't get backed out
Categories
(Developer Infrastructure :: Lint and Formatting, task)
Tracking
(Not tracked)
People
(Reporter: dholbert, Unassigned)
References
Details
Rough STR:
- Find some file with some latent clang-format reformatting to be done.
- Make some edit to that file and
hg commit
. This will automatically make mercurial address the unrelated clang-format reformatting in that file, as part of your commit. - Back out that commit (
hg backout $COMMIT
) - Inspect the final state of that file and the backout commit.
EXPECTED RESULTS:
The backout commit should fully revert the commit that it's backing out.
ACTUAL RESULTS:
Your backout commit will not back out the reformatting changes. It only backs out your non-reformatting changes. I assume this is because, as part of generating the backout-commit, our clang-format hook runs on the "changed" file and auto-reformats it and reapplies the formatting changes right after it reverts them.
This might be sort of a special case of bug 1556088.
Reporter | ||
Comment 1•6 years ago
|
||
In my case (using a local tree with autoland cloned), here's some specific STR that you should be able to do:
hg pull autoland # this step won't be needed in a day or so, after stuff's been merged around.
hg export 4d8eb840fc2e # notice all the clang-format formatting changes in this patch, all the SCROLLABLE_XUL_FCDATA stuff
hg up -r 4d8eb840fc2e
hg backout 4d8eb840fc2e
# my terminal tells me the ID for the backout commit
hg export [whatever the backout commit ID is]
This shows that the backout commit is much smaller than 4d8eb840fc2e (i.e. it doesn't fully back it out). None of the SCROLLABLE_XUL_FCDATA formatting changes are in there.
Reporter | ||
Comment 2•6 years ago
|
||
(This probably requires that you have the clang-format
hg extension enabled in your .hgrc, BTW.)
Updated•3 years ago
|
Updated•2 years ago
|
Description
•