{"thread":{"id":"17585","subject":"[PATCH JGIT] Compute the author/commiter name and email from the git configuration","startedAt":"2009-02-05T10:44:03Z","lastAt":"2009-02-05T15:38:52Z","messageCount":2,"participants":["Yann Simon","Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"103319","messageId":"498AC2F3.1010802@gmail.com","threadId":"17585","inReplyTo":null,"subject":"[PATCH JGIT] Compute the author/commiter name and email from the git configuration","fromName":"Yann Simon","fromEmail":"yann.simon.fr@gmail.com","sentAt":"2009-02-05T10:44:03Z","receivedAt":"2009-02-05T10:44:03Z","isPatch":true,"sender":{"key":"yann.simon.fr@gmail.com","avatar":"https://gravatar.com/avatar/2d926895d27ac988c5c8e591887e5a6a4c7036390403c74fce92519119b887a0?d=mp&s=160"},"body":"The author/commiter name and email are retrieved from the system configuration\nand the local and global git configurations.\n\nWhen the name is not available, propose one default by using the system user name.\n\nWhen the email is not available, propose one default by concatenating the\nuser name and the host name.\n\nThe author name and email are used as default value in the author field\nwhile committing with the GUI.\n\nFix issue 47 (field Author don't fill)\n\nSigned-off-by: Yann Simon <yann.simon.fr@gmail.com>\n---\nReplace the last email.\n\nThis is the 3rd version of the patch.\nI applied the received comments.\nChanges between v2 and v3 of the patch:\n- move the fakeSystemReader into RepositoryTestCase and fill it with default values.\n- hange commiter -> committer.\n- getHostName() never returns null. I used \"localhost\" when the host name is not available.\n- the user name is set to a default one is no other information is available.\n- change the way to form a default email using only the system property \"user.name\".\n- add a copyright header to SystemReader. I did not know if I had to change the copyright to include my name.\nI personally do not care about that.\n- change SystemReader.getEnvironmentVariable to SystemReader.getenv to emulate System class.\n\n .../egit/ui/internal/actions/CommitAction.java     |   17 +++\n .../org/spearce/jgit/lib/RepositoryConfigTest.java |   63 ++++++++++\n .../org/spearce/jgit/lib/RepositoryTestCase.java   |   32 +++++\n .../src/org/spearce/jgit/lib/Constants.java        |   18 +++\n .../src/org/spearce/jgit/lib/RepositoryConfig.java |  120 ++++++++++++++++++++\n .../src/org/spearce/jgit/util/SystemReader.java    |   62 ++++++++++\n 6 files changed, 312 insertions(+), 0 deletions(-)\n create mode 100644 org.spearce.jgit/src/org/spearce/jgit/util/SystemReader.java\n\ndiff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/CommitAction.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/CommitAction.java\nindex 17232d6..456745c 100644\n--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/CommitAction.java\n+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/CommitAction.java\n@@ -41,6 +41,7 @@\n import org.spearce.jgit.lib.PersonIdent;\n import org.spearce.jgit.lib.RefUpdate;\n import org.spearce.jgit.lib.Repository;\n+import org.spearce.jgit.lib.RepositoryConfig;\n import org.spearce.jgit.lib.Tree;\n import org.spearce.jgit.lib.TreeEntry;\n import org.spearce.jgit.lib.GitIndex.Entry;\n@@ -70,8 +71,10 @@ public void run(IAction act) {\n \t\t}\n \n \t\tRepository[] repos = getRepositoriesFor(getProjectsForSelectedResources());\n+\t\tRepository repository = null;\n \t\tamendAllowed = repos.length == 1;\n \t\tfor (Repository repo : repos) {\n+\t\t\trepository = repo;\n \t\t\tif (!repo.getRepositoryState().canCommit()) {\n \t\t\t\tMessageDialog.openError(getTargetPart().getSite().getShell(),\n \t\t\t\t\t\"Cannot commit now\", \"Repository state:\"\n@@ -95,12 +98,26 @@ public void run(IAction act) {\n \t\t\t}\n \t\t}\n \n+\t\tassert repository != null;\n+\t\tRepositoryConfig repositoryConfig = repository.getConfig();\n+\t\tString author = null;\n+\t\tString username = repositoryConfig.getAuthorName();\n+\t\tif (username != null && username.length() != 0) {\n+\t\t\tauthor = username;\n+\t\t\tString email = repositoryConfig.getAuthorEmail();\n+\t\t\tif (email != null && email.length() != 0) {\n+\t\t\t\tauthor = author + \" <\" + email + \">\";\n+\t\t\t}\n+\t\t}\n+\n \t\tloadPreviousCommit();\n \n \t\tCommitDialog commitDialog = new CommitDialog(getTargetPart().getSite().getShell());\n \t\tcommitDialog.setAmending(amending);\n \t\tcommitDialog.setAmendAllowed(amendAllowed);\n \t\tcommitDialog.setFileList(files);\n+\t\tcommitDialog.setAuthor(author);\n+\n \t\tif (previousCommit != null)\n \t\t\tcommitDialog.setPreviousCommitMessage(previousCommit.getMessage());\n \ndiff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryConfigTest.java b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryConfigTest.java\nindex 34ce04a..5c14e89 100644\n--- a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryConfigTest.java\n+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryConfigTest.java\n@@ -42,6 +42,8 @@\n \n import java.io.File;\n import java.io.IOException;\n+import java.net.InetAddress;\n+import java.net.UnknownHostException;\n import java.util.Arrays;\n import java.util.LinkedList;\n \n@@ -116,4 +118,65 @@ public void test006_readCaseInsensitive() throws IOException {\n \t\tassertEquals(true, repositoryConfig.getBoolean(\"foo\", null, \"bar\", false));\n \t\tassertEquals(\"\", repositoryConfig.getString(\"foo\", null, \"bar\"));\n \t}\n+\n+\tpublic void test007_readUserInfos() throws IOException {\n+\t\tString hostname;\n+\t\ttry {\n+\t\t\tInetAddress localMachine = InetAddress.getLocalHost();\n+\t\t\thostname = localMachine.getCanonicalHostName();\n+\t\t} catch (UnknownHostException e) {\n+\t\t\thostname = \"localhost\";\n+\t\t}\n+\n+\t\tfinal File globalConfig = writeTrashFile(\"global.config\", \"\");\n+\t\tfinal File localConfig = writeTrashFile(\"local.config\", \"\");\n+\t\tSystem.clearProperty(Constants.OS_USER_NAME_KEY);\n+\n+\t\tRepositoryConfig globalRepositoryConfig = new RepositoryConfig(null, globalConfig);\n+\t\tRepositoryConfig localRepositoryConfig = new RepositoryConfig(globalRepositoryConfig, localConfig);\n+\t\tfakeSystemReader.values.clear();\n+\n+\t\tString authorName;\n+\t\tString authorEmail;\n+\n+\t\t// no values defined nowhere\n+\t\tauthorName = localRepositoryConfig.getAuthorName();\n+\t\tauthorEmail = localRepositoryConfig.getAuthorEmail();\n+\t\tassertEquals(Constants.UNKNOWN_USER_DEFAULT, authorName);\n+\t\tassertEquals(Constants.UNKNOWN_USER_DEFAULT + \"@\" + hostname, authorEmail);\n+\n+\t\t// the system user name is defined\n+\t\tfakeSystemReader.values.put(Constants.OS_USER_NAME_KEY, \"os user name\");\n+\t\tauthorName = localRepositoryConfig.getAuthorName();\n+\t\tassertEquals(\"os user name\", authorName);\n+\n+\t\tif (hostname != null && hostname.length() != 0) {\n+\t\t\tauthorEmail = localRepositoryConfig.getAuthorEmail();\n+\t\t\tassertEquals(\"os user name@\" + hostname, authorEmail);\n+\t\t}\n+\n+\t\t// the git environment variables are defined\n+\t\tfakeSystemReader.values.put(Constants.GIT_AUTHOR_NAME_KEY, \"git author name\");\n+\t\tfakeSystemReader.values.put(Constants.GIT_AUTHOR_EMAIL_KEY, \"author@email\");\n+\t\tauthorName = localRepositoryConfig.getAuthorName();\n+\t\tauthorEmail = localRepositoryConfig.getAuthorEmail();\n+\t\tassertEquals(\"git author name\", authorName);\n+\t\tassertEquals(\"author@email\", authorEmail);\n+\n+\t\t// the values are defined in the global configuration\n+\t\tglobalRepositoryConfig.setString(\"user\", null, \"name\", \"global username\");\n+\t\tglobalRepositoryConfig.setString(\"user\", null, \"email\", \"author@globalemail\");\n+\t\tauthorName = localRepositoryConfig.getAuthorName();\n+\t\tauthorEmail = localRepositoryConfig.getAuthorEmail();\n+\t\tassertEquals(\"global username\", authorName);\n+\t\tassertEquals(\"author@globalemail\", authorEmail);\n+\n+\t\t// the values are defined in the local configuration\n+\t\tlocalRepositoryConfig.setString(\"user\", null, \"name\", \"local username\");\n+\t\tlocalRepositoryConfig.setString(\"user\", null, \"email\", \"author@localemail\");\n+\t\tauthorName = localRepositoryConfig.getAuthorName();\n+\t\tauthorEmail = localRepositoryConfig.getAuthorEmail();\n+\t\tassertEquals(\"local username\", authorName);\n+\t\tassertEquals(\"author@localemail\", authorEmail);\n+\t}\n }\ndiff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryTestCase.java b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryTestCase.java\nindex 20348f1..4e56b38 100644\n--- a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryTestCase.java\n+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryTestCase.java\n@@ -46,11 +46,14 @@\n import java.io.OutputStreamWriter;\n import java.io.Reader;\n import java.util.ArrayList;\n+import java.util.HashMap;\n import java.util.List;\n+import java.util.Map;\n \n import junit.framework.TestCase;\n \n import org.spearce.jgit.util.JGitTestUtil;\n+import org.spearce.jgit.util.SystemReader;\n \n /**\n  * Base class for most JGit unit tests.\n@@ -84,6 +87,28 @@\n \n \tprotected boolean packedGitMMAP;\n \n+\tprotected static class FakeSystemReader implements SystemReader {\n+\t\tMap<String, String> values = new HashMap<String, String>();\n+\t\tpublic String getenv(String variable) {\n+\t\t\treturn values.get(variable);\n+\t\t}\n+\t\tpublic String getProperty(String key) {\n+\t\t\treturn values.get(key);\n+\t\t}\n+\t}\n+\n+\t/**\n+\t * Simulates the reading of system variables and properties.\n+\t * Unit test can control the returned values by manipulating\n+\t * {@link FakeSystemReader#values}.\n+\t */\n+\tprotected static FakeSystemReader fakeSystemReader;\n+\n+\tstatic {\n+\t\tfakeSystemReader = new FakeSystemReader();\n+\t\tRepositoryConfig.setSystemReader(fakeSystemReader);\n+\t}\n+\n \t/**\n \t * Configure JGit before setting up test repositories.\n \t */\n@@ -250,6 +275,13 @@ copyFile(JGitTestUtil.getTestResourceFile(packs[k] + \".idx\"), new File(packDir,\n \t\tcopyFile(JGitTestUtil.getTestResourceFile(\"packed-refs\"), new File(trash_git,\"packed-refs\"));\n \n \t\tdb.scanForPacks();\n+\n+\t\tfakeSystemReader.values.clear();\n+\t\tfakeSystemReader.values.put(Constants.OS_USER_NAME_KEY, Constants.OS_USER_NAME_KEY);\n+\t\tfakeSystemReader.values.put(Constants.GIT_AUTHOR_NAME_KEY, Constants.GIT_AUTHOR_NAME_KEY);\n+\t\tfakeSystemReader.values.put(Constants.GIT_AUTHOR_EMAIL_KEY, Constants.GIT_AUTHOR_EMAIL_KEY);\n+\t\tfakeSystemReader.values.put(Constants.GIT_COMMITTER_NAME_KEY, Constants.GIT_COMMITTER_NAME_KEY);\n+\t\tfakeSystemReader.values.put(Constants.GIT_COMMITTER_EMAIL_KEY, Constants.GIT_COMMITTER_EMAIL_KEY);\n \t}\n \n \tprotected void tearDown() throws Exception {\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/Constants.java b/org.spearce.jgit/src/org/spearce/jgit/lib/Constants.java\nindex 8f093d6..b0a5b22 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/lib/Constants.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/Constants.java\n@@ -228,6 +228,24 @@\n \t/** Packed refs file */\n \tpublic static final String PACKED_REFS = \"packed-refs\";\n \n+\t/** The environment variable that contains the system user name */\n+\tpublic static final String OS_USER_NAME_KEY = \"user.name\";\n+\n+\t/** The environment variable that contains the author's name */\n+\tpublic static final String GIT_AUTHOR_NAME_KEY = \"GIT_AUTHOR_NAME\";\n+\n+\t/** The environment variable that contains the author's email */\n+\tpublic static final String GIT_AUTHOR_EMAIL_KEY = \"GIT_AUTHOR_EMAIL\";\n+\n+\t/** The environment variable that contains the commiter's name */\n+\tpublic static final String GIT_COMMITTER_NAME_KEY = \"GIT_COMMITTER_NAME\";\n+\n+\t/** The environment variable that contains the commiter's email */\n+\tpublic static final String GIT_COMMITTER_EMAIL_KEY = \"GIT_COMMITTER_EMAIL\";\n+\n+\t/** Default value for the user name if no other information is available */\n+\tpublic static final String UNKNOWN_USER_DEFAULT = \"unknown-user\";\n+\n \t/**\n \t * Create a new digest function for objects.\n \t * \ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java b/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java\nindex 7df90cd..821d8be 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java\n@@ -50,6 +50,8 @@\n import java.io.InputStreamReader;\n import java.io.OutputStreamWriter;\n import java.io.PrintWriter;\n+import java.net.InetAddress;\n+import java.net.UnknownHostException;\n import java.util.ArrayList;\n import java.util.Collections;\n import java.util.HashMap;\n@@ -60,6 +62,7 @@\n import java.util.Set;\n \n import org.spearce.jgit.util.FS;\n+import org.spearce.jgit.util.SystemReader;\n \n /**\n  * An object representing the Git config file.\n@@ -98,8 +101,20 @@ public static RepositoryConfig openUserConfig() {\n \n \tprivate Map<String, Object> byName;\n \n+\tprivate static String hostname;\n+\n \tprivate static final String MAGIC_EMPTY_VALUE = \"%%magic%%empty%%\";\n \n+\t// default system reader gets the value from the system\n+\tprivate static SystemReader systemReader = new SystemReader() {\n+\t\tpublic String getenv(String variable) {\n+\t\t\treturn System.getenv(variable);\n+\t\t}\n+\t\tpublic String getProperty(String key) {\n+\t\t\treturn System.getProperty(key);\n+\t\t}\n+\t};\n+\n \tRepositoryConfig(final Repository repo) {\n \t\tthis(openUserConfig(), FS.resolve(repo.getDirectory(), \"config\"));\n \t}\n@@ -308,6 +323,83 @@ public String getString(final String section, String subsection, final String na\n \t\treturn result;\n \t}\n \n+\t/**\n+\t * @return the author name as defined in the git variables\n+\t *         and configurations. If no name could be found, try\n+\t *         to use the system user name instead.\n+\t */\n+\tpublic String getAuthorName() {\n+\t\treturn getUsernameInternal(Constants.GIT_AUTHOR_NAME_KEY);\n+\t}\n+\n+\t/**\n+\t * @return the committer name as defined in the git variables\n+\t *         and configurations. If no name could be found, try\n+\t *         to use the system user name instead.\n+\t */\n+\tpublic String getCommitterName() {\n+\t\treturn getUsernameInternal(Constants.GIT_COMMITTER_NAME_KEY);\n+\t}\n+\n+\tprivate String getUsernameInternal(String gitVariableKey) {\n+\t\t// try to get the user name from the local and global configurations.\n+\t\tString username = getString(\"user\", null, \"name\");\n+\n+\t\tif (username == null) {\n+\t\t\t// try to get the user name for the system property GIT_XXX_NAME\n+\t\t\tusername = systemReader.getenv(gitVariableKey);\n+\t\t}\n+\t\tif (username == null) {\n+\t\t\t// get the system user name\n+\t\t\tusername = systemReader.getProperty(Constants.OS_USER_NAME_KEY);\n+\t\t}\n+\t\tif (username == null) {\n+\t\t\tusername = Constants.UNKNOWN_USER_DEFAULT;\n+\t\t}\n+\t\treturn username;\n+\t}\n+\n+\t/**\n+\t * @return the author email as defined in git variables and\n+\t *         configurations. If no email could be found, try to\n+\t *         propose one default with the user name and the\n+\t *         host name.\n+\t */\n+\tpublic String getAuthorEmail() {\n+\t\treturn getUserEmailInternal(Constants.GIT_AUTHOR_EMAIL_KEY);\n+\t}\n+\n+\t/**\n+\t * @return the committer email as defined in git variables and\n+\t *         configurations. If no email could be found, try to\n+\t *         propose one default with the user name and the\n+\t *         host name.\n+\t */\n+\tpublic String getCommitterEmail() {\n+\t\treturn getUserEmailInternal(Constants.GIT_COMMITTER_EMAIL_KEY);\n+\t}\n+\n+\tprivate String getUserEmailInternal(String gitVariableKey) {\n+\t\t// try to get the email from the local and global configurations.\n+\t\tString email = getString(\"user\", null, \"email\");\n+\n+\t\tif (email == null) {\n+\t\t\t// try to get the email for the system property GIT_XXX_EMAIL\n+\t\t\temail = systemReader.getenv(gitVariableKey);\n+\t\t}\n+\n+\t\tif (email == null) {\n+\t\t\t// try to construct an email\n+\t\t\tString username = systemReader.getProperty(Constants.OS_USER_NAME_KEY);\n+\t\t\tif (username == null){\n+\t\t\t\tusername = Constants.UNKNOWN_USER_DEFAULT;\n+\t\t\t}\n+\t\t\temail = username + \"@\" + getHostname();\n+\t\t}\n+\n+\t\treturn email;\n+\t}\n+\n \tprivate String getRawString(final String section, final String subsection,\n \t\t\tfinal String name) {\n \t\tfinal Object o = getRawEntry(section, subsection, name);\n@@ -957,4 +1049,32 @@ private static boolean eq(final String a, final String b) {\n \t\t\treturn a.equalsIgnoreCase(b);\n \t\t}\n \t}\n+\n+\t/**\n+\t * Gets the hostname of the local host.\n+\t * If no hostname can be found, the hostname is set to the default value \"localhost\".\n+\t * @return the canonical hostname\n+\t */\n+\tprivate static String getHostname() {\n+\t\tif (hostname == null) {\n+\t\t\ttry {\n+\t\t\t\tInetAddress localMachine = InetAddress.getLocalHost();\n+\t\t\t\thostname = localMachine.getCanonicalHostName();\n+\t\t\t} catch (UnknownHostException e) {\n+\t\t\t\t// we do nothing\n+\t\t\t\thostname = \"localhost\";\n+\t\t\t}\n+\t\t\tassert hostname != null;\n+\t\t}\n+\t\treturn hostname;\n+\t}\n+\n+\t/**\n+\t * Overrides the default system reader by a custom one.\n+\t * @param newSystemReader new system reader\n+\t */\n+\tpublic static void setSystemReader(SystemReader newSystemReader) {\n+\t\tsystemReader = newSystemReader;\n+\t}\n+\n }\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/util/SystemReader.java b/org.spearce.jgit/src/org/spearce/jgit/util/SystemReader.java\nnew file mode 100644\nindex 0000000..4a9715f\n--- /dev/null\n+++ b/org.spearce.jgit/src/org/spearce/jgit/util/SystemReader.java\n@@ -0,0 +1,62 @@\n+/*\n+ * Copyright (C) 2009, Robin Rosenberg <robin.rosenberg@dewire.com>\n+ * Copyright (C) 2009, Shawn O. Pearce <spearce@spearce.org>\n+ *\n+ * All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or\n+ * without modification, are permitted provided that the following\n+ * conditions are met:\n+ *\n+ * - Redistributions of source code must retain the above copyright\n+ *   notice, this list of conditions and the following disclaimer.\n+ *\n+ * - Redistributions in binary form must reproduce the above\n+ *   copyright notice, this list of conditions and the following\n+ *   disclaimer in the documentation and/or other materials provided\n+ *   with the distribution.\n+ *\n+ * - Neither the name of the Git Development Community nor the\n+ *   names of its contributors may be used to endorse or promote\n+ *   products derived from this software without specific prior\n+ *   written permission.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n+ * CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+package org.spearce.jgit.util;\n+\n+/**\n+ * Interface to read values from the system.\n+ * <p>\n+ * When writing unit tests, extending this interface with a custom class\n+ * permits to simulate an access to a system variable or property.\n+ * </p>\n+ */\n+public interface SystemReader {\n+\n+\t/**\n+\t * @param variable system variable to read\n+\t * @return value of the system variable\n+\t */\n+\tString getenv(String variable);\n+\n+\t/**\n+\t * @param key of the system property to read\n+\t * @return value of the system property\n+\t */\n+\tString getProperty(String key);\n+\n+}\n-- \n1.6.0.4\n"},{"id":"103342","messageId":"20090205153852.GF26880@spearce.org","threadId":"17585","inReplyTo":"498AC2F3.1010802@gmail.com","subject":"Re: [PATCH JGIT] Compute the author/commiter name and email from the git configuration","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-02-05T15:38:52Z","receivedAt":"2009-02-05T15:38:52Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Yann Simon <yann.simon.fr@gmail.com> wrote:\n> The author/commiter name and email are retrieved from the system configuration\n> and the local and global git configurations.\n> \n> When the name is not available, propose one default by using the system user name.\n> \n> When the email is not available, propose one default by concatenating the\n> user name and the host name.\n> \n> The author name and email are used as default value in the author field\n> while committing with the GUI.\n> \n> Fix issue 47 (field Author don't fill)\n> \n> Signed-off-by: Yann Simon <yann.simon.fr@gmail.com>\n\nApplied, thanks.\n\n-- \nShawn.\n"}]}