[SERVER-23914] Implement reformat-branch clang-format command Created: 25/Apr/16  Updated: 14/Jul/16  Resolved: 01/Jun/16

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 3.3.8

Type: Task Priority: Major - P3
Reporter: Mark Benvenuto Assignee: Mark Benvenuto
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Platforms 14 (05/13/16), Platforms 15 (06/03/16)
Participants:

 Description   

lang_format.py script will have a new command:

reformat-branch <no arguments>

Reformat-branch will reformat an existing branch by applying clang-format to an existing set of changes in a branch. In order to work the script will need to know a suitable start point. The suitable start point will be the hash of the change that updates .clang-format to the new style format. This will be followed by an update of the script itself with the new hash to use as the starting point after the reformat commit has happened. The commits will be in git in the following order:

  1. Precursor changes like disabling format in tomcrypt.h (see SortIncludes discussion above)
  2. Commit to update .clang-format & clang_format.py
  3. Reformat change
  4. Commit to update clang_format.py with changes #2 & #3 for this command.

Note: Yes lint will break on change 2, but I do not want one super change.

The script will do the following steps:

  1. Validate branch has been rebased to hash XXX (Commit #2 above)
  2. For each commit in branch
    1. Checkout commit
    2. Reformat file as needed with clang-format
    3. Commit changes as YYY
    4. Move change YYY onto of reformat commit (Commit #3 above)


 Comments   
Comment by Githook User [ 30/May/16 ]

Author:

{u'username': u'markbenvenuto', u'name': u'Mark Benvenuto', u'email': u'mark.benvenuto@mongodb.com'}

Message: SERVER-23914 Fix reformat-branch and improve message
Branch: master
https://github.com/mongodb/mongo/commit/b47deb5910ac97ed1741efad08d5e4a11bdd0740

Comment by Githook User [ 28/May/16 ]

Author:

{u'username': u'markbenvenuto', u'name': u'Mark Benvenuto', u'email': u'mark.benvenuto@mongodb.com'}

Message: SERVER-23914 Implement reformat-branch clang-format command
Branch: master
https://github.com/mongodb/mongo/commit/59a3973032eb65d0fcc46aae318f18dc78a084c7

Generated at Thu Feb 08 04:04:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.