Hasty Briefsbeta

Bilingual

Converting a Git repo from tabs to spaces (2016)

a year ago
  • #Python
  • #Git
  • #Whitespace
  • The author converted Yelp's Python codebase from tabs to four spaces in 2013.
  • Key steps included fixing inconsistent indentation, distributing a Git filter, and performing the conversion during a low-activity period.
  • Git filters were used to ensure no new tabs were introduced, with both clean and smudge filters converting tabs to spaces.
  • Merging and rebasing strategies were adjusted to handle the whitespace conversion, with some complications for old branches and stashes.
  • The conversion caused minor issues like phantom-modified files and slow Git status checks, but these were manageable.
  • The author recommends final cleanup steps like adding a pre-commit hook to reject tabs outright.