https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112022-07-02T14:17:16ZRuby Issue Tracking SystemRuby master - Misc #18891: Expand tabs in C codehttps://bugs.ruby-lang.org/issues/18891?journal_id=982612022-07-02T14:17:16Zgraywolf (Gray Wolf)
<ul></ul><p>One more solution would be:</p>
<ol start="4">
<li>Do not use broken editors.</li>
</ol>
<p>¯\_(ツ)_/¯</p>
<p>Should be at least listed here as an option.</p> Ruby master - Misc #18891: Expand tabs in C codehttps://bugs.ruby-lang.org/issues/18891?journal_id=982622022-07-03T04:28:25Zk0kubun (Takashi Kokubun)takashikkbn@gmail.com
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/98262/diff?detail_id=62819">diff</a>)</li></ul><p>Sure, I added your solution to the description.</p> Ruby master - Misc #18891: Expand tabs in C codehttps://bugs.ruby-lang.org/issues/18891?journal_id=982782022-07-04T20:02:00ZEregon (Benoit Daloze)
<ul></ul><p>Thank you for the clear and precise issue.</p>
<p>(2) seems very obviously the way, and it's amazing it has not been done yet.<br>
This is the #1 problem for new (and some of the existing as well) contributors to CRuby..<br>
If CRuby does not do this, it is explicitly rejecting new contributors for no good reasons.</p>
<p>(IMHO mixing spaces and tabs has no sense nowadays, it's an antique legacy non-sense practice with zero advantages, and there is no valid reason to keep that monster alive)</p> Ruby master - Misc #18891: Expand tabs in C codehttps://bugs.ruby-lang.org/issues/18891?journal_id=982912022-07-06T07:20:38Zk0kubun (Takashi Kokubun)takashikkbn@gmail.com
<ul></ul><blockquote>
<p>It might be a bit difficult to find out which C files shouldn't be a target.</p>
</blockquote>
<p>I noticed ruby-commit-hook/bin/auto-style.rb already knows about this. (2) doesn't have any blocker.</p>
<p>So I prepared a pull request: <a href="https://github.com/ruby/ruby/pull/6094" class="external">https://github.com/ruby/ruby/pull/6094</a>. I confirmed GitHub ignores it just fine. If you have <s><code>git config --global blame.ignoreRevsFile .git-blame-ignore-revs</code></s> <code>git config blame.ignoreRevsFile .git-blame-ignore-revs</code>, <code>git blame</code> ignores it properly too. I'm inclined to move forward with this unless somebody has a problem with leaving such a commit.</p> Ruby master - Misc #18891: Expand tabs in C codehttps://bugs.ruby-lang.org/issues/18891?journal_id=982952022-07-06T21:11:57Zk0kubun (Takashi Kokubun)takashikkbn@gmail.com
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/98295/diff?detail_id=62828">diff</a>)</li></ul> Ruby master - Misc #18891: Expand tabs in C codehttps://bugs.ruby-lang.org/issues/18891?journal_id=982972022-07-06T21:18:38Zk0kubun (Takashi Kokubun)takashikkbn@gmail.com
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/98297/diff?detail_id=62829">diff</a>)</li></ul> Ruby master - Misc #18891: Expand tabs in C codehttps://bugs.ruby-lang.org/issues/18891?journal_id=982992022-07-07T00:20:20Zhsbt (Hiroshi SHIBATA)hsbt@ruby-lang.org
<ul></ul><p>I'm +1 for <a href="https://github.com/ruby/ruby/pull/6094" class="external">https://github.com/ruby/ruby/pull/6094</a></p> Ruby master - Misc #18891: Expand tabs in C codehttps://bugs.ruby-lang.org/issues/18891?journal_id=983082022-07-08T08:53:32Zeightbitraptor (Matthew Valentine-House)matt@eightbitraptor.com
<ul></ul><p>I'm also in favour of <a href="https://github.com/ruby/ruby/pull/6094" class="external">https://github.com/ruby/ruby/pull/6094</a> - It feels like the most elegant solution of those proposed</p> Ruby master - Misc #18891: Expand tabs in C codehttps://bugs.ruby-lang.org/issues/18891?journal_id=984022022-07-21T03:05:36Znagachika (Tomoyuki Chikanaga)nagachika00@gmail.com
<ul></ul><p>I also support the 2nd solution from the perspective of stable branch maintenance.</p> Ruby master - Misc #18891: Expand tabs in C codehttps://bugs.ruby-lang.org/issues/18891?journal_id=984032022-07-21T03:53:27Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul></ul><p><a class="user active user-mention" href="https://bugs.ruby-lang.org/users/404">@nagachika (Tomoyuki Chikanaga)</a> Thank you for your comment. I vote for 2 too.</p>
<blockquote>
<p>If CRuby does not do this, it is explicitly rejecting new contributors for no good reasons.</p>
</blockquote>
<p>I want to use VSCode, but this expression is not correct in my perspective. VSCode is explicitly rejecting new users who have been working on any project with emacs-style indentation.</p> Ruby master - Misc #18891: Expand tabs in C codehttps://bugs.ruby-lang.org/issues/18891?journal_id=984122022-07-21T12:23:19Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li></ul><p>We discussed this issue at the dev meeting.</p>
<p>Finally, we were able to reach an agreement to expand hard tabs. Congratulations!</p> Ruby master - Misc #18891: Expand tabs in C codehttps://bugs.ruby-lang.org/issues/18891?journal_id=984252022-07-21T15:36:18Zetienne (Étienne Barrié)
<ul></ul><blockquote>
<p>If you have <code>git config --global blame.ignoreRevsFile .git-blame-ignore-revs</code>, git blame ignores it properly too.</p>
</blockquote>
<p>Unfortunately you can't set it at the global level because <code>git blame</code> fails if the file does not exist, and that would cause issues when working on other repos (see <a href="https://lore.kernel.org/all/a30ebbe3-596e-84a5-9023-b53402dfe70c@gmail.com/T/" class="external">this discussion in the Git mailing list</a>). 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.</p>
<p>I would also recommend setting these two configs which can help in case the ignored revisions end up hiding the origin of a line: <code>blame.markUnblamableLines</code> and <code>blame.markIgnoredLines</code>. Looking at the output of <code>git blame</code> at least you'll see that a revision was ignored. These two can be set at the global level.</p> Ruby master - Misc #18891: Expand tabs in C codehttps://bugs.ruby-lang.org/issues/18891?journal_id=984262022-07-21T16:41:03Zk0kubun (Takashi Kokubun)takashikkbn@gmail.com
<ul></ul><blockquote>
<p>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</p>
</blockquote>
<p>Right, I noticed that behavior after writing the comment but forgot to update the comment about it. I corrected the comment to not use <code>--global</code>, which would write <code>.git/config</code>. <s>Given that you could always use <code>~/.gitconfig</code> or <code>.git/config</code> for your original git configuration, I guess it's fair to just commit <code>.gitconfig</code> to the repository. I'll add that once I merge it.</s> (edit: I noticed committing <code>.gitconfig</code> doesn't work and you'd need to do something in <code>.git/config</code> like including it anyway) I'll leave a comment about it in <code>.git-blame-ignore-revs</code>. Hopefully, you wouldn't need to initialize your repository so often.</p>
<blockquote>
<p>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.</p>
</blockquote>
<p>Good to know. I guess the change of this time doesn't introduce new lines, but I'll consider adding that when I see something weird that can be solved by that.</p> Ruby master - Misc #18891: Expand tabs in C codehttps://bugs.ruby-lang.org/issues/18891?journal_id=984272022-07-21T16:42:26Zk0kubun (Takashi Kokubun)takashikkbn@gmail.com
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li></ul><p>Applied in changeset <a class="changeset" title="Expand tabs [ci skip] [Misc #18891]" href="https://bugs.ruby-lang.org/projects/ruby-master/repository/git/revisions/5b21e94bebed90180d8ff63dad03b8b948361089">git|5b21e94bebed90180d8ff63dad03b8b948361089</a>.</p>
<hr>
<p>Expand tabs [ci skip]</p>
<p>[Misc <a class="issue tracker-5 status-5 priority-4 priority-default closed" title="Misc: Expand tabs in C code (Closed)" href="https://bugs.ruby-lang.org/issues/18891">#18891</a>]</p> Ruby master - Misc #18891: Expand tabs in C codehttps://bugs.ruby-lang.org/issues/18891?journal_id=984282022-07-21T16:44:00Zk0kubun (Takashi Kokubun)takashikkbn@gmail.com
<ul></ul><p>I forgot to mention that I appreciate everybody who supported this decision. Thank you so much.</p>