Differences between revisions 1 and 2
Revision 1 as of 2015-02-19 05:57:09
Size: 1249
Editor: dx
Comment: create page
Revision 2 as of 2015-03-28 01:21:44
Size: 1330
Editor: dx
Comment: improve patch instructions a bit
Deletions are marked like this. Additions are marked like this.
Line 26: Line 26:
Given `indent` as the indent commit and `indent^` as the previous one (the one which adds this file) Given `reindent` as the indent commit (the one pointed by the bitlbee/reindent branch) and `reindent^` as the previous one (the one which adds the uncrustify configuration file)
Line 28: Line 28:
 1. Apply patches against `indent^`, fix merge conflicts normally as needed, if any.  1. Apply patches against `reindent^`, fix merge conflicts normally as needed, if any.
Line 32: Line 32:
 5. Rebase with `-X ours` against the indent commit: `git rebase indent -X ours`  5. Merge with `-X ours` against the indent commit: `git merge reindent -X ours`
Line 34: Line 34:
 7. Squash or make a new patch with `git diff indent`  7. Squash or make a new patch with `git diff reindent`

Some brief notes regarding the code reindent.

Pull request: https://github.com/bitlbee/bitlbee/pull/14

Why

It's not my fault don't look at me like that.

How

The commands used were the following:

find . -name '*.[hc]' > filelist
uncrustify -c uncrustify.cfg --replace --no-backup -F filelist

uncrustify is http://uncrustify.sourceforge.net/

The configuration file (uncrustify.cfg) was added to the doc/ directory of the repository one commit before the reindent itself. It only includes the differences with the default config of uncrustify 0.60.

Adapting out of tree patches

To minimize the pain when adapting your patches to the new code style, follow these instructions

Given reindent as the indent commit (the one pointed by the bitlbee/reindent branch) and reindent^ as the previous one (the one which adds the uncrustify configuration file)

  1. Apply patches against reindent^, fix merge conflicts normally as needed, if any.

  2. Run the uncrustify command from above.
  3. Stage all the changes: git add -u

  4. Create a temporary commit: git commit -m "reindent temp commit"

  5. Merge with -X ours against the indent commit: git merge reindent -X ours

  6. Review resulting diff
  7. Squash or make a new patch with git diff reindent

BitlBee Wiki: Reindent (last edited 2015-03-28 01:21:44 by dx)