Re: [PATCH v3 4/4] editor: use standard strvec API to receive environment for external editors
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 11, 2025, 23:58 UTC
- Message-ID
- <xmqq8qjpz9zj.fsf@gitster.g>
- In-Reply-To
- <CAPig+cTXuTaMd1+sbSSDNbGKxxciyxAT3LMk44aSaimPco8XTQ@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 8 quoted lines
>> int launch_editor(const char *path, struct strbuf *buffer, >> - const char *const *env); >> + const struct strvec *env); > > Typically, we would want to have the API accept the narrowest type in > order to remain as general as possible, but this change makes it a > requirement that a caller must have the much wider `strvec` type at > hand, which seems counterproductive.
Yup, very good point. I do not see the point of this change even after looking at the whole of this patch. It is not like (being const) this would make it easier for launch_editor() to further tweak the environment. Let's not do this.