On 2020-10-01 at 03:43:50, Jonathan Nieder wrote: > Junio C Hamano wrote: > > You can let the existing code produce its natural result and then > > when the "force UTC" flag is set, override the offset part to +0000 > > if and only if the timezone was obtained from the current > > environment (this if-and-only-if is necessary, because you do not > > want to rewrite and force UTC when you run "git commit --amend" > > without the "--reset-author" option to update a commit that was > > created somewhere else to UTC). That way, we do not have to futz > > with TZ environment or tzset. > > Yes, I think this is simpler and nicer than the proposal in my other > reply. Yeah, I agree this is more desirable. > In addition to not having to futz with TZ, I think I like the > semantics better. The motivation that started this thread was not so > much "I want to set a custom timezone to blend in" but rather "why are > we recording the timezone at all here?" In that context, it makes > sense to me to have a setting such as > > core.recordTimeZone > > that I can turn *off* to say that I don't think datestamp() callers > should consider the timezone to be information worth recording (and > instead they should write +0000). To me that seems a little simpler > to understand than user.hideTimezone since this focuses on turning > some functionality off (recording of the time zone) instead of turning > on a new stealth mode. I'd like to make one suggestion here, and that's that instead of writing "+0000" in this case, we write "-0000". As far as I'm aware, it should be parsed equivalently but it mirrors RFC 5322: Though "-0000" also indicates Universal Time, it is used to indicate that the time was generated on a system that may be in a local time zone other than Universal Time and that the date-time contains no information about the local time zone. This is exactly my case. As you can tell from my emails, I'm not physically located in a UTC timezone, but my system is in UTC and uses that for timestamps. I use UTC because I know and work with people from around the world and it's more convenient to use an objective standard; my real time zone is unimportant. That's materially different than someone who's located in Reykjavík, where we'd want to write +0000, since they are physically located in a UTC-equivalent timezone. -- brian m. carlson: Houston, Texas, US