This is an archive of the discontinued LLVM Phabricator instance.

[git-clang-format] Do not apply clang-format to symlinks
ClosedPublic

Authored by pirama on May 4 2021, 5:57 PM.

Details

Summary

This fixes PR46992.

Git stores symlinks as text files and we should not format them even if
they have one of the requested extensions.

(Move the call to cd_to_toplevel() up a few lines so we can also print
the skipped symlinks during verbose output.)

Diff Detail

Event Timeline

pirama requested review of this revision.May 4 2021, 5:57 PM
pirama created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptMay 4 2021, 5:57 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
pirama updated this revision to Diff 342927.May 4 2021, 5:59 PM

Leave two empty lines after filter_symlinks.

HazardyKnusperkeks added a project: Restricted Project.May 5 2021, 12:51 PM

I have not a great knowledge about python, but it looks okay.

curdeius added inline comments.May 5 2021, 1:40 PM
clang/tools/clang-format/git-clang-format
345

Is this print supposed to stay or is it a remnant of print-debugging?

pirama updated this revision to Diff 343171.May 5 2021, 1:41 PM

Remove debug print().

pirama marked an inline comment as done.May 5 2021, 1:42 PM
pirama added inline comments.
clang/tools/clang-format/git-clang-format
345

Oops, can't believe it slipped through. Sorry about that.

curdeius accepted this revision.May 5 2021, 1:54 PM

LGTM but let's wait a day or two before landing, so that others can chime in.
Btw, do you have commit rights? If no, please provide "Name <email>" for commit attribution.

clang/tools/clang-format/git-clang-format
345

No worries, the review serves its purpose!

This revision is now accepted and ready to land.May 5 2021, 1:54 PM
pirama marked an inline comment as done.May 5 2021, 1:57 PM

LGTM but let's wait a day or two before landing, so that others can chime in.
Btw, do you have commit rights? If no, please provide "Name <email>" for commit attribution.

Yes, I do have commit rights. Let's wait for comments and I'll submit it on Monday.

Oh, I forgot, please add a release note.

pirama updated this revision to Diff 343194.May 5 2021, 2:28 PM

Add release note

This revision was automatically updated to reflect the committed changes.