From: Jeff King Date: Thu, 02 Apr 2026 03:55:46 GMT Subject: Re: [PATCH 09/12] pkt-line: make packet_reader.line non-const Message-ID: <20260402035546.GB3492642@coredump.intra.peff.net> In-Reply-To: On Wed, Apr 01, 2026 at 03:18:35PM -0700, Junio C Hamano wrote: > Jeff King writes: > > > The "line" member of a packet_reader struct is marked as const. This > > kind of makes sense, because it's not its own allocated buffer that > > should be freed, and we often use const to indicate that. > > This is interesting. Once we go down this path, will we rethink the > use of "const" as "not ours" hint (which I always found confusing)? Maybe. It is already a weak signal, so I consider it more of a hint than a rule. I think it probably applies more consistently to the return value of functions (most things returning "char *" probably are passing back ownership). -Peff