From: etienne Date: 2022-07-21T15:36:18+00:00 Subject: [ruby-core:109289] [Ruby master Misc#18891] Expand tabs in C code Issue #18891 has been updated by etienne (��tienne Barri��). > If you have `git config --global blame.ignoreRevsFile .git-blame-ignore-revs`, git blame ignores it properly too. Unfortunately you can't set it at the global level because `git blame` fails if the file does not exist, and that would cause issues when working on other repos (see [this discussion in the Git mailing list](https://lore.kernel.org/all/a30ebbe3-596e-84a5-9023-b53402dfe70c@gmail.com/T/)). But you can definitely add it as a config local to the repo, and mention how to do that at the top of the file itself. I would also recommend setting these two configs which can help in case the ignored revisions end up hiding the origin of a line: `blame.markUnblamableLines` and `blame.markIgnoredLines`. Looking at the output of `git blame` at least you'll see that a revision was ignored. These two can be set at the global level. ---------------------------------------- Misc #18891: Expand tabs in C code https://bugs.ruby-lang.org/issues/18891#change-98425 * Author: k0kubun (Takashi Kokubun) * Status: Assigned * Priority: Normal ---------------------------------------- # Problem There's no way to handle tab/space-mixed indentation of CRuby's C code properly in VSCode. It impacts the productivity of the VSCode users a lot, including myself. # Suggested solutions I implemented option 2 out of the following options at https://github.com/ruby/ruby/pull/6094. 1. You tell me how to do that in VSCode. * In VSCode, there seems to be no native feature to show tabs as 8 spaces while still indenting with 4 spaces. At least https://github.com/microsoft/vscode/issues/42740 is still open. * @alanwu built https://github.com/XrXr/vscode-tabs-are-two-indents exactly for this purpose, but even with the extension, it still seems to wrongly detect an indentation level on new lines. 2. **Expand all tabs in most of the C code at once and add the commit to `.git-blame-ignore-revs`** * pros: GitHub and `git blame --ignore-revs-file` support it. Unlike option 3, commit logs and `.git-blame-ignore-revs` can be short. * cons: It might be a bit difficult to find out which C files shouldn't be a target. Bare `git blame` could be inconvenient. 3. Allow expanding all tabs in each C file as we want and manage the list of such commits in `.git-blame-ignore-revs` * pros: GitHub and `git blame --ignore-revs-file` support it. You don't introduce unnecessary changes to files you don't care about. * cons: We might see too many commits for this in the commit history. Bare `git blame` could be inconvenient for such files. 4. Discourage contributions to CRuby from VSCode users. (proposed by @graywolf) # Drawbacks The expected drawbacks of doing option 2 are: * Existing patches on hard-tab lines may conflict. * Backporting patches on hard-tab lines made after this commit to revisions before this commit may conflict. I assume that resolving such conflicts wouldn't be too difficult and this problem will not last forever. # Out of scope I'm not interested in discussing the adoption of clang-format. It would change a lot of things that are not related to the problem. # Past discussion https://bugs.ruby-lang.org/issues/16112 touched this topic before, but we haven't discussed `--ignore-revs-file` so much. I also didn't know VSCode still can't deal with it in 2022 (as I've been using Vim). -- https://bugs.ruby-lang.org/ Unsubscribe: