git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH JGIT] Compute the author/commiter name and email from the git configuration

From
Shawn O. Pearce <spearce@spearce.org>
Date
Feb 4, 2009, 00:59 UTC
Message-ID
<20090204005907.GA23383@spearce.org>
In-Reply-To
<alpine.DEB.1.00.0902040019030.9822@pacific.mpi-cbg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 12 quoted lines
> On Tue, 3 Feb 2009, Shawn O. Pearce wrote:
> > Yann Simon <yann.simon.fr@gmail.com> wrote:
> > > +			username = System.getProperty(gitVariableKey);
> > 
> > Shouldn't that be System.getenv()?
> 
> According to
> 
> http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html#getenv(java.lang.String)
> 
> getenv() is deprecated.  However, in later editions (Java5 and later, to 
> be precise), that deprecation seems to be lifted...

Yea, funny thing about that. In 1.3 getenv() worked. In 1.4 they not only marked it deprecated, they changed the method to always throw a RuntimeException. Java developers were outraged, so in 1.5 (aka Java 5) they added it back in as a supported method.

JGit only runs on Java 5 and later. So we're safe, we don't have to worry about this #@(!@(! method and the 1.4 mistake.

Hell, Java 6 added an executable flag to java.io.File. This is a rather funny concept on Windows where executablity is based on file name and not a "mode bit", but its in the Java 6 S2SE API. At least even on Windows getenv makes sense and provides data.

-- 
Shawn.
Previous: Shawn O. PearceNext: Robin Rosenberg
Message 6 of 10 in “Compute the author/commiter name and email from the git configuration”
  1. Compute the author/commiter name and email from the git configurationYann Simon, Feb 3, 2009
  2. Shawn O. PearceFeb 3, 2009
  3. Johannes SchindelinFeb 3, 2009
  4. Robin RosenbergFeb 4, 2009
  5. Shawn O. PearceFeb 4, 2009
  6. Shawn O. PearceFeb 4, 2009
  7. Robin RosenbergFeb 4, 2009
  8. Yann SimonFeb 4, 2009
  9. Yann SimonFeb 4, 2009
  10. Yann SimonFeb 4, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.