Re: [RFC PATCH 0/1] adding user.hideTimezone for setting UTC timezone
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 3, 2020, 04:42 UTC
- Message-ID
- <xmqq4knb9az0.fsf@gitster.c.googlers.com>
- In-Reply-To
- <20201003035050.151766-1-shengfa@google.com>
Shengfa Lin <shengfa@google.com> writes:
Show 15 quoted lines
> Junio C Hamano <gitster@pobox.com> writes: > >>> If we have a setting of "core.recordTimeZone", do we need to make it >>> as a command option as Junio suggested earlier? >> >> Usually we add command line option --[no-]record-time-zone first >> without configuration option when introducing a new features like >> this one. Once the feature proves useful, we'd add a matching >> configuration variable for convenience, but leave the command line >> option (negative form in this case) so that a configured per-user >> default can be overridden as needed. > > Any recommendation as to where to add this command line option? > Should the option be added separately in "git merge", "git rebase", > "git commit", "git pull" and other places as OPT_BOOL?
I think that would be most end-user friendly.
> Or could it be added directly to handle_options in git.c? > If added to git.c, it will only be added it once.
That would be easier for lazy developers, but not as end-user friendly as giving it to individual commands, I would think.
> Then an environment variable(such as GIT_RECORD_TIME_ZONE) can be added > to save the option and datestamp in date.c can set offset accordingly.
We prefer not to use new environment variable unless there is a clear advantage. Consider GIT_DIR etc. that were added early in Git's history as historical mistakes.