$Date$ and $LastChangedBy$ - should we keep them?
Alexander E. Patrakov
patrakov at gmail.com
Mon Apr 14 21:15:27 PDT 2008
this is a piece of the IRC log on #svn on irc.freenode.net:
09:27:59) patrakov: Hello, our project has $Date$ in some files. However,
Subversion expands this based on the current locale, which is wrong for us. How
to make it always insert the English representation of date into files of this
project, without manually changing the locale?
(09:31:35) kfogel: patrakov: I know of no way to do that, without setting some
env variable temporarily.
(09:31:37) Yanroy: patrakov: why is that the wrong behavior? AFAIK, the client
expands that tag every time a checkout or update is performed, so it isn't on
(09:33:18) patrakov: Yanroy: this is wrong because it is intermixed with HTML
that has a specified encoding, you can't just arbitrarily mix it (this is the
"last modified" string in HTML files, and it is user-visible)
(09:33:35) Yanroy: ah, I see
(09:33:55) Yanroy: well, I would hope that it's only an issue on your server, in
which case I'd suggest changing the server's locale
(09:34:26) patrakov: this is a client issue
(09:35:37) patrakov: the server is in USA and can render the pages correctly if
I ssh there and check out the files. But on my computer the result is garbage
until I temporarily set LC_TIME=C
(09:36:19) patrakov: (garbage = Russian representation of dates in English
(09:41:13) patrakov: if no solution is available, I'll report a bug
(09:42:24) kfogel: patrakov: call it rather a proposed enhancement, not a bug.
The current behavior is intended; we could add more control, but at the cost of
a more complex interface.
(09:42:50) Yanroy: could you set up an alias in your shell such that it sets the
environment variable before invoking svn?
(09:44:06) patrakov: Yanroy: I did just that, but I can't call this a solution,
because a French project would require the dates to be in French, and so on.
I.e., this really should be a property of the repository
(09:45:32) Yanroy: patrakov: I'd say it's a property of the file, not the repo
(09:46:06) Yanroy: patrakov: also, I can almost guarnatee the response you'll
get on the dev mailing list: don't use keyword expansions, they're only provided
to be backwards-compatible with CVS
Thus, we should probably find some other method to extract the date and last
author metadata and put them into the files. Or just drop this.
P.S. Take the above with a grain of salt, because the Subversion project itself
uses $LastChangedDate$ in its HTML files. See, for example,
Alexander E. Patrakov
More information about the blfs-dev