git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Tabs in commit messages - de-tabify option in strbuf_stripspace()?

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Mar 16, 2016, 00:16 UTC
Message-ID
<CA+55aFzHMp4hiCp7+2Yxy=KNQ_rBru3RM-pghXUPtoxr_L+w2w@mail.gmail.com>

So I end up doing this manually when I notice, but I was wondering ig maybe git could just have an option to "git am" and friends to de-tabify the commit message.

It's particularly noticeable when people line things up using tabs (for the kernel, it's often things like "cpu1 does X, cpu2 does Y"), and then when you do "git log" it looks like a unholy mess, because the 4-char indentation of the log message ends up causing those things to not line up at all after all.

The natural thing to do would be to pass in a "tab size" parameter to strbuf_stripspace(), and default it to 0 (for no change), but have some way to let people say "expand tabs to spaces at 8-character tab-stops" or similar (but let people use different tab-stops if they want).

Do people hate that idea? I may not get around to it for a while (it's the kernel merge window right now), but I can write the patch eventually - I just wanted to do an RFC first.

                Linus
Next: Stefan Beller
Message 1 of 17 in “Tabs in commit messages - de-tabify option in strbuf_stripspace()?”
  1. Linus TorvaldsMar 16, 2016
  2. Stefan BellerMar 16, 2016
  3. Linus TorvaldsMar 16, 2016
  4. Randall S. BeckerMar 16, 2016
  5. Junio C HamanoMar 16, 2016
  6. Linus TorvaldsMar 16, 2016
  7. Stefan BellerMar 16, 2016
  8. Stefan BellerMar 16, 2016
  9. Marc BranchaudMar 16, 2016
  10. Duy NguyenMar 16, 2016
  11. Linus TorvaldsMar 16, 2016
  12. Junio C HamanoMar 16, 2016
  13. Matthieu MoyMar 20, 2016
  14. Linus TorvaldsMar 16, 2016
  15. Junio C HamanoMar 16, 2016
  16. Linus TorvaldsMar 16, 2016
  17. Jeff KingMar 16, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.