Re: [PATCH v2 13/18] build-helper: link against libgit.a and any other required C libraries
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Sep 17, 2025, 23:31 UTC
- Message-ID
- <CAPig+cTdJAjuekz6YXDkxTjTRxsPEzSUxhoD8nK9k7uA4s=rHQ@mail.gmail.com>
- In-Reply-To
- <CALnO6CAmNTAOj0wkkPoEMOhHB1bgM4xBKa1=4zuS1Cs=UAq_BA@mail.gmail.com>
On Wed, Sep 17, 2025 at 7:07 PM D. Ben Knoble <ben.knoble@gmail.com> wrote:
Show 28 quoted lines
> On Wed, Sep 17, 2025 at 4:52 AM Eric Sunshine <sunshine@sunshineco.com> wrote: > > There are more than a few developers on this project (including > > myself) who still use 80-column editors and terminals. As a general > > style guideline, this project does recommend wrapping code to fit > > within 80 columns (except in cases when doing so would severely hurt > > readability). I imagine that the same sort of guideline would be > > appreciated in Rust code, as well, by those who still stick with 80 > > columns. > > > > I bring this up because, although it hasn't been such a big deal with > > the existing C code, assuming that developers run `rustfmt` on the > > code before sending a patch series, then this may become an issue if > > different developers have `rustfmt` configured to enforce different > > maximum column width, especially since `rustfmt` is likely to reformat > > the entire file rather than just the region that has just been edited. > > So, if this code gets checked in as-is with these very wide lines, and > > then someone else, who has `rustfmt` configured for 80-columns edits > > the file, then it becomes a problem. > > > > As such, can we also add a project-wide `rustfmt.toml` which, at > > minimum, sets the maximum line width to 80? For instance: > > > > max_width = 80 > > I believe rustfmt and Rust generally uses a 100 column limit. > > Perhaps you knew this, and are really suggesting we break with Rust > style for our own style?
Correct, I did know that, and I also know that there are a number of developers on the Git project who still adhere to (perhaps archaic) 80-column editor and terminal window sizes.
Project guidelines have long suggested 80 columns as a desirable maximum not only for C code, but for pretty much all other resources, including shell code, Perl code, and documentation files. This suggested maximum works well for adherents of 80-columns and (presumably) hasn't been too onerous for developers who use wider windows; at least we haven't heard people clamoring to increase the suggested maximum column limit. As such, it does not seem far-fetched to expect that the project guidelines should/could/would also apply to Rust code.
Show 7 quoted lines
> For handling personal configs, we could try to maintain a config here > that repeats all the defaults, but that seems like more maintenance > headache than noticing unnecessary reformatting and reminding folks we > use the defaults (except where we have config that specifies > otherwise). Although the docs site doesn’t suggest the configs are > layered like for Git, so perhaps a blank config is sufficient to > enforce « we use the defaults »?
Sorry, I'm not following what you are asking. I'm simply suggesting the possibility of adding a toplevel "$GIT/.rustfmt.toml" to the project with the single line content:
max_width = 80
That aside, we probably also ought to insist (via documentation) that contributors run `rustfmt` on Rust code before submitting a patch series.