{"thread":{"id":"43328","subject":"[PATCH 0/3] Re: Author name and e-mail address in .stgitrc","startedAt":"2006-11-11T11:35:53Z","lastAt":"2006-12-05T09:17:15Z","messageCount":17,"participants":["Karl Hasselström","Catalin Marinas","Robin Rosenberg"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"298589","messageId":"20061111113553.GA11224@diana.vm.bytemark.co.uk","threadId":"43328","inReplyTo":null,"subject":"Double From:s in StGIT's patch email template","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2006-11-11T11:35:53Z","receivedAt":"2006-11-11T11:35:53Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"StGIT's default patch email template has both \"From: %(maintainer)s\"\nin the e-mail header, and \"From: %(authname)s <%(authemail)s>\" in the\ne-mail body. Why?\n\n-- \nKarl Hasselström, kha@treskal.com\n"},{"id":"295541","messageId":"20061111141530.GF11224@diana.vm.bytemark.co.uk","threadId":"43328","inReplyTo":"20061111113553.GA11224@diana.vm.bytemark.co.uk","subject":"Author name and e-mail address in .stgitrc","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2006-11-11T14:15:30Z","receivedAt":"2006-11-11T14:15:30Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"Is there any particular reason to have the author and committer names\nin ~/.stgitrc? Simply taking them from the same place git does would\nprobably be a usability enhancement (unless they're specified on the\ncommand line, of course).\n\n-- \nKarl Hasselström, kha@treskal.com\n"},{"id":"295064","messageId":"200611111531.16304.robin.rosenberg.lists@dewire.com","threadId":"43328","inReplyTo":"20061111141530.GF11224@diana.vm.bytemark.co.uk","subject":"Re: Author name and e-mail address in .stgitrc","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2006-11-11T14:31:15Z","receivedAt":"2006-11-11T14:31:15Z","isPatch":false,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"lördag 11 november 2006 15:15 skrev Karl Hasselström:\n> Is there any particular reason to have the author and committer names\n> in ~/.stgitrc? Simply taking them from the same place git does would\n> probably be a usability enhancement (unless they're specified on the\n> command line, of course).\n\nAFAIK StGit already does that, at least if you (like me) do not have \na .stgitrc.\n\n"},{"id":"295627","messageId":"20061111144057.GG11224@diana.vm.bytemark.co.uk","threadId":"43328","inReplyTo":"20061111113553.GA11224@diana.vm.bytemark.co.uk","subject":"Re: Double From:s in StGIT's patch email template","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2006-11-11T14:40:57Z","receivedAt":"2006-11-11T14:40:57Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2006-11-11 12:35:53 +0100, Karl Hasselström wrote:\n\n> StGIT's default patch email template has both \"From: %(maintainer)s\"\n> in the e-mail header, and \"From: %(authname)s <%(authemail)s>\" in\n> the e-mail body. Why?\n\nAh, I just figured it out. \"maintainer\" is the person sending the\nmail, and \"author\" is the person who wrote the patch. In general, they\nare not the same.\n\nHmm. It would be nice to omit the second From: in case they really are\nthe same.\n\n-- \nKarl Hasselström, kha@treskal.com\n"},{"id":"295000","messageId":"20061111145708.GH11224@diana.vm.bytemark.co.uk","threadId":"43328","inReplyTo":"200611111531.16304.robin.rosenberg.lists@dewire.com","subject":"Re: Author name and e-mail address in .stgitrc","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2006-11-11T14:57:08Z","receivedAt":"2006-11-11T14:57:08Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2006-11-11 15:31:15 +0100, Robin Rosenberg wrote:\n\n> lördag 11 november 2006 15:15 skrev Karl Hasselström:\n>\n> > Is there any particular reason to have the author and committer\n> > names in ~/.stgitrc? Simply taking them from the same place git\n> > does would probably be a usability enhancement (unless they're\n> > specified on the command line, of course).\n>\n> AFAIK StGit already does that, at least if you (like me) do not have\n> a .stgitrc.\n\nBut I haven't gotten the impression that specifying them in ~/.stgitrc\nis deprecated. The example stgitrc has a section with author name and\ncommitter name, for example.\n\n-- \nKarl Hasselström, kha@treskal.com\n"},{"id":"298759","messageId":"200611112126.32380.robin.rosenberg.lists@dewire.com","threadId":"43328","inReplyTo":"20061111145708.GH11224@diana.vm.bytemark.co.uk","subject":"Re: Author name and e-mail address in .stgitrc","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2006-11-11T20:26:31Z","receivedAt":"2006-11-11T20:26:31Z","isPatch":false,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"lördag 11 november 2006 15:57 skrev Karl Hasselström:\n> On 2006-11-11 15:31:15 +0100, Robin Rosenberg wrote:\n> > lördag 11 november 2006 15:15 skrev Karl Hasselström:\n> > > Is there any particular reason to have the author and committer\n> > > names in ~/.stgitrc? Simply taking them from the same place git\n> > > does would probably be a usability enhancement (unless they're\n> > > specified on the command line, of course).\n> >\n> > AFAIK StGit already does that, at least if you (like me) do not have\n> > a .stgitrc.\n>\n> But I haven't gotten the impression that specifying them in ~/.stgitrc\n> is deprecated. The example stgitrc has a section with author name and\n> committer name, for example.\n\nThe only docs I know of that mentions stgitrc also states that it isn't \nrequired, so why use it unless you have to (or for some reason want to)? Just \nbecause there are many ways, doesn't mean all but one have to be deprecated.\n\n"},{"id":"294566","messageId":"20061111223017.GA20192@diana.vm.bytemark.co.uk","threadId":"43328","inReplyTo":"200611112126.32380.robin.rosenberg.lists@dewire.com","subject":"Re: Author name and e-mail address in .stgitrc","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2006-11-11T22:30:17Z","receivedAt":"2006-11-11T22:30:17Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2006-11-11 21:26:31 +0100, Robin Rosenberg wrote:\n\n> lördag 11 november 2006 15:57 skrev Karl Hasselström:\n>\n> > But I haven't gotten the impression that specifying them in\n> > ~/.stgitrc is deprecated. The example stgitrc has a section with\n> > author name and committer name, for example.\n>\n> The only docs I know of that mentions stgitrc also states that it\n> isn't required, so why use it unless you have to (or for some reason\n> want to)? Just because there are many ways, doesn't mean all but one\n> have to be deprecated.\n\nNo, but having a config option for something that git already provides\nseveral ways to specify can't possibly be a good idea, especially\nusability-wise. The only use I can think of is if you _want_ to have\ndifferent identities for git and stgit in the same repository, and\nthat's just mad.\n\nI'm preparing a patch to fix this. Stay tuned. :-)\n\n-- \nKarl Hasselström, kha@treskal.com\n"},{"id":"298341","messageId":"b0943d9e0611111502q2f68be67l1a2441d84923a732@mail.gmail.com","threadId":"43328","inReplyTo":"20061111141530.GF11224@diana.vm.bytemark.co.uk","subject":"Re: Author name and e-mail address in .stgitrc","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2006-11-11T23:02:04Z","receivedAt":"2006-11-11T23:02:04Z","isPatch":false,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 11/11/06, Karl Hasselström <kha@treskal.com> wrote:\n> Is there any particular reason to have the author and committer names\n> in ~/.stgitrc? Simply taking them from the same place git does would\n> probably be a usability enhancement (unless they're specified on the\n> command line, of course).\n\nAt the time I added these to .stgitrc, the only place git was taking\nthem from was the environment variables and I wanted to put them in a\nsingle place. I also didn't like the idea of having the committer\ne-mail address be some username@local-machine as I don't think the\nname of the machine where I create patches is relevant. I also define\nthe committer/author per repository in the .git/stgitrc file (i.e. I\nuse @arm.com for Linux patches and @gmail.com for StGIT).\n\nI use StGIT almost exclusively, even in \"maintainer\" mode and I would\nlike not to spread the configuration options over many files. It is on\nmy todo list to use the same configuration file as git (with a [stgit]\nsection) since it has a format that should be understood by the Python\nconfig module.\n\n-- \n"},{"id":"294375","messageId":"20061111232322.17760.26214.stgit@localhost","threadId":"43328","inReplyTo":"b0943d9e0611111502q2f68be67l1a2441d84923a732@mail.gmail.com","subject":"[PATCH 0/3] Re: Author name and e-mail address in .stgitrc","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2006-11-11T23:23:22Z","receivedAt":"2006-11-11T23:23:22Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2006-11-11 23:02:04 +0000, Catalin Marinas wrote:\n\n> On 11/11/06, Karl Hasselström <kha@treskal.com> wrote:\n>\n> > Is there any particular reason to have the author and committer\n> > names in ~/.stgitrc? Simply taking them from the same place git\n> > does would probably be a usability enhancement (unless they're\n> > specified on the command line, of course).\n> \n> At the time I added these to .stgitrc, the only place git was taking\n> them from was the environment variables and I wanted to put them in a\n> single place. I also didn't like the idea of having the committer\n> e-mail address be some username@local-machine as I don't think the\n> name of the machine where I create patches is relevant. I also define\n> the committer/author per repository in the .git/stgitrc file (i.e. I\n> use @arm.com for Linux patches and @gmail.com for StGIT).\n\nWell, this should all be sorted out now; git has both per-repository\nand per-user config files.\n\n> I use StGIT almost exclusively, even in \"maintainer\" mode and I\n> would like not to spread the configuration options over many files.\n> It is on my todo list to use the same configuration file as git\n> (with a [stgit] section) since it has a format that should be\n> understood by the Python config module.\n\nThe last patch in this series deprecates name and email config in\nstgitrc by not mentioning them in the example stgitrc, because\nteaching newbies to use yet another layer of identity configuration on\ntop of what git already provides is madness. Old-timers may continue\nusing stgitrc for that purpose for now (but as you say, integrating\nthe configuration with git is on the TODO list).\n\n-- \nKarl Hasselström, kha@treskal.com\n"},{"id":"295007","messageId":"20061111233046.17760.62871.stgit@localhost","threadId":"43328","inReplyTo":"20061111232322.17760.26214.stgit@localhost","subject":"[PATCH 1/3] Ask git for author and committer name","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2006-11-11T23:30:46Z","receivedAt":"2006-11-11T23:30:46Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"From: Karl Hasselström <kha@treskal.com>\n\nConsistently do the following to get hold of default user and\ncommitter:\n\n  1. Use the value specified on the command line, if any.\n\n  1. Otherwise, use the value from stgitrc, if available.\n\n  2. Otherwise, ask git for the value. git will produce the value from\n     on of its config files, from environment variables, or make it\n     up. It might be asking the spirits of the dead for all we care.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n---\n\n stgit/commands/mail.py |   19 ++------------\n stgit/git.py           |   63 ++++++++++++++++++++++++++++++++++++++++++++++++\n stgit/stack.py         |   32 ++++--------------------\n 3 files changed, 70 insertions(+), 44 deletions(-)\n\ndiff --git a/stgit/commands/mail.py b/stgit/commands/mail.py\nindex 154df9c..78abfa4 100644\n--- a/stgit/commands/mail.py\n+++ b/stgit/commands/mail.py\n@@ -127,17 +127,6 @@ options = [make_option('-a', '--all',\n                        action = 'store_true')]\n \n \n-def __get_maintainer():\n-    \"\"\"Return the 'authname <authemail>' string as read from the\n-    configuration file\n-    \"\"\"\n-    if config.has_option('stgit', 'authname') \\\n-           and config.has_option('stgit', 'authemail'):\n-        return '%s <%s>' % (config.get('stgit', 'authname'),\n-                            config.get('stgit', 'authemail'))\n-    else:\n-        return None\n-\n def __parse_addresses(addresses):\n     \"\"\"Return a two elements tuple: (from, [to])\n     \"\"\"\n@@ -301,9 +290,7 @@ def edit_message(msg):\n def __build_cover(tmpl, total_nr, msg_id, options):\n     \"\"\"Build the cover message (series description) to be sent via SMTP\n     \"\"\"\n-    maintainer = __get_maintainer()\n-    if not maintainer:\n-        maintainer = ''\n+    maintainer = git.user()\n \n     if options.version:\n         version_str = ' %s' % options.version\n@@ -370,9 +357,7 @@ def __build_message(tmpl, patch, patch_n\n     short_descr = descr_lines[0].rstrip()\n     long_descr = '\\n'.join(descr_lines[1:]).lstrip()\n \n-    maintainer = __get_maintainer()\n-    if not maintainer:\n-        maintainer = '%s <%s>' % (p.get_commname(), p.get_commemail())\n+    maintainer = git.user()\n \n     if options.version:\n         version_str = ' %s' % options.version\ndiff --git a/stgit/git.py b/stgit/git.py\nindex 8d88769..a6e1a63 100644\n--- a/stgit/git.py\n+++ b/stgit/git.py\n@@ -33,6 +33,35 @@ class GitException(Exception):\n #\n # Classes\n #\n+\n+class Person:\n+    \"\"\"An author, committer, etc.\"\"\"\n+    def __init__(self, name = None, email = None, date = None,\n+                 desc = None):\n+        if name or email or date:\n+            assert not desc\n+            self.name = name\n+            self.email = email\n+            self.date = date\n+        elif desc:\n+            assert not (name or email or date)\n+            def parse_desc(s):\n+                m = re.match(r'^(.+)<(.+)>(.*)$', s)\n+                assert m\n+                return [x.strip() or None for x in m.groups()]\n+            self.name, self.email, self.date = parse_desc(desc)\n+    def set_name(self, val):\n+        if val:\n+            self.name = val\n+    def set_email(self, val):\n+        if val:\n+            self.email = val\n+    def __str__(self):\n+        if self.name and self.email:\n+            return '%s <%s>' % (self.name, self.email)\n+        else:\n+            raise Exception, 'not enough identity data'\n+\n class Commit:\n     \"\"\"Handle the commit objects\n     \"\"\"\n@@ -402,6 +431,40 @@ def rm(files, force = False):\n         if files:\n             __run('git-update-index --force-remove --', files)\n \n+def var(key):\n+    \"\"\"Ask git-var for the value of a variable.\"\"\"\n+    return _output_one_line(['git-var', key])\n+\n+def repo_config(key):\n+    \"\"\"Ask git-repo-config for the value of a variable.\"\"\"\n+    return _output_one_line(['git-repo-config', key])\n+\n+__cached_git_persons = {}\n+def __git_person(p):\n+    if not p in __cached_git_persons:\n+        __cached_git_persons[p] = {\n+            'author': lambda: Person(desc = var('GIT_AUTHOR_IDENT')),\n+            'committer': lambda: Person(desc = var('GIT_COMMITTER_IDENT')),\n+            'user': lambda: Person(repo_config('user.name'),\n+                                   repo_config('user.email')),\n+            }[p]()\n+    return __cached_git_persons[p]\n+\n+__cached_stgit_persons = {}\n+def __stgit_person(p, name_key, email_key):\n+    if not p in __cached_stgit_persons:\n+        person = __git_person(p)\n+        if config.has_option('stgit', name_key):\n+            person.set_name(config.get('stgit', name_key))\n+        if config.has_option('stgit', email_key):\n+            person.set_email(config.get('stgit', email_key))\n+        __cached_stgit_persons[p] = person\n+    return __cached_stgit_persons[p]\n+\n+def author(): return __stgit_person('author', 'authname', 'authemail')\n+def committer(): return __stgit_person('committer', 'commname', 'commemail')\n+def user(): return __stgit_person('user', 'authname', 'authemail')\n+\n def update_cache(files = None, force = False):\n     \"\"\"Update the cache information for the given files\n     \"\"\"\ndiff --git a/stgit/stack.py b/stgit/stack.py\nindex a477e7d..fee1316 100644\n--- a/stgit/stack.py\n+++ b/stgit/stack.py\n@@ -238,53 +238,31 @@ class Patch:\n         return self.__get_field('authname')\n \n     def set_authname(self, name):\n-        if not name:\n-            if config.has_option('stgit', 'authname'):\n-                name = config.get('stgit', 'authname')\n-            elif 'GIT_AUTHOR_NAME' in os.environ:\n-                name = os.environ['GIT_AUTHOR_NAME']\n-        self.__set_field('authname', name)\n+        self.__set_field('authname', name or git.author().name)\n \n     def get_authemail(self):\n         return self.__get_field('authemail')\n \n     def set_authemail(self, address):\n-        if not address:\n-            if config.has_option('stgit', 'authemail'):\n-                address = config.get('stgit', 'authemail')\n-            elif 'GIT_AUTHOR_EMAIL' in os.environ:\n-                address = os.environ['GIT_AUTHOR_EMAIL']\n-        self.__set_field('authemail', address)\n+        self.__set_field('authemail', address or git.author().email)\n \n     def get_authdate(self):\n         return self.__get_field('authdate')\n \n     def set_authdate(self, date):\n-        if not date and 'GIT_AUTHOR_DATE' in os.environ:\n-            date = os.environ['GIT_AUTHOR_DATE']\n-        self.__set_field('authdate', date)\n+        self.__set_field('authdate', date or git.author().date)\n \n     def get_commname(self):\n         return self.__get_field('commname')\n \n     def set_commname(self, name):\n-        if not name:\n-            if config.has_option('stgit', 'commname'):\n-                name = config.get('stgit', 'commname')\n-            elif 'GIT_COMMITTER_NAME' in os.environ:\n-                name = os.environ['GIT_COMMITTER_NAME']\n-        self.__set_field('commname', name)\n+        self.__set_field('commname', name or git.committer().name)\n \n     def get_commemail(self):\n         return self.__get_field('commemail')\n \n     def set_commemail(self, address):\n-        if not address:\n-            if config.has_option('stgit', 'commemail'):\n-                address = config.get('stgit', 'commemail')\n-            elif 'GIT_COMMITTER_EMAIL' in os.environ:\n-                address = os.environ['GIT_COMMITTER_EMAIL']\n-        self.__set_field('commemail', address)\n+        self.__set_field('commemail', address or git.committer().email)\n \n     def get_log(self):\n"},{"id":"295414","messageId":"20061111233106.17760.23118.stgit@localhost","threadId":"43328","inReplyTo":"20061111232322.17760.26214.stgit@localhost","subject":"[PATCH 2/3] Don't mention deprecated template variables","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2006-11-11T23:31:06Z","receivedAt":"2006-11-11T23:31:06Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"From: Karl Hasselström <kha@treskal.com>\n\n%(endofheaders)s and %(date)s are deprecated and expand to the empty\nstring, so don't mention them in the help text.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n---\n\n stgit/commands/mail.py |   13 ++++---------\n 1 files changed, 4 insertions(+), 9 deletions(-)\n\ndiff --git a/stgit/commands/mail.py b/stgit/commands/mail.py\nindex 78abfa4..d4fc293 100644\n--- a/stgit/commands/mail.py\n+++ b/stgit/commands/mail.py\n@@ -52,19 +52,14 @@ SMTP authentication is also possible wit\n '--smtp-password' options, also available as configuration settings:\n 'smtpuser' and 'smtppassword'.\n \n-The template e-mail headers and body must be separated by\n-'%(endofheaders)s' variable, which is replaced by StGIT with\n-additional headers and a blank line. The patch e-mail template accepts\n-the following variables:\n+The patch e-mail template accepts the following variables:\n \n   %(patch)s        - patch name\n   %(maintainer)s   - 'authname <authemail>' as read from the config file\n   %(shortdescr)s   - the first line of the patch description\n   %(longdescr)s    - the rest of the patch description, after the first line\n-  %(endofheaders)s - delimiter between e-mail headers and body\n   %(diff)s         - unified diff of the patch\n   %(diffstat)s     - diff statistics\n-  %(date)s         - current date/time\n   %(version)s      - ' version' string passed on the command line (or empty)\n   %(prefix)s       - 'prefix ' string passed on the command line\n   %(patchnr)s      - patch number\n@@ -76,9 +71,9 @@ the following variables:\n   %(commname)s     - committer's name\n   %(commemail)s    - committer's e-mail\n \n-For the preamble e-mail template, only the %(maintainer)s, %(date)s,\n-%(endofheaders)s, %(version)s, %(patchnr)s, %(totalnr)s and %(number)s\n-variables are supported.\"\"\"\n+For the preamble e-mail template, only the %(maintainer)s,\n+%(version)s, %(patchnr)s, %(totalnr)s and %(number)s variables are\n+supported.\"\"\"\n \n options = [make_option('-a', '--all',\n"},{"id":"294476","messageId":"20061111233121.17760.27045.stgit@localhost","threadId":"43328","inReplyTo":"20061111232322.17760.26214.stgit@localhost","subject":"[PATCH 3/3] Deprecate author and committer details in stgitrc","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2006-11-11T23:31:21Z","receivedAt":"2006-11-11T23:31:21Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"From: Karl Hasselström <kha@treskal.com>\n\nThere are two distinct disadvantages to having author and committer\nnames in stgitrc:\n\n  * They override GIT_AUTHOR_NAME and friends, not the other way\n    around as one might imagine.\n\n  * They cause stgit and plain git to use different names (unless one\n    manages to keep them in sync manually), which can't possibly be a\n    good idea.\n\nThis patch removes the description of these variables in the example\nstgitrc, so that new users aren't tempted to use them. They will still\ncontinue to function, however.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n---\n\n examples/stgitrc |    5 -----\n stgit/git.py     |    3 +++\n 2 files changed, 3 insertions(+), 5 deletions(-)\n\ndiff --git a/examples/stgitrc b/examples/stgitrc\nindex 45a629b..9cd95e1 100644\n--- a/examples/stgitrc\n+++ b/examples/stgitrc\n@@ -3,11 +3,6 @@\n # the former.\n \n [stgit]\n-# Default author/committer details\n-#authname:  Your Name\n-#authemail: your.name@yourcompany.com\n-#commname:  Your Name\n-#commemail: your.name@yourcompany.com\n \n # Automatically Bcc the address below\n #autobcc: your.name@yourcompany.com\ndiff --git a/stgit/git.py b/stgit/git.py\nindex a6e1a63..f654cde 100644\n--- a/stgit/git.py\n+++ b/stgit/git.py\n@@ -452,6 +452,9 @@ def __git_person(p):\n \n __cached_stgit_persons = {}\n def __stgit_person(p, name_key, email_key):\n+    \"\"\"Calls __git_person to get the details for a person, but allows\n+    the deprecated author and committer variables in stgitrc override\n+    the result.\"\"\"\n     if not p in __cached_stgit_persons:\n         person = __git_person(p)\n"},{"id":"296683","messageId":"20061111233538.GC20192@diana.vm.bytemark.co.uk","threadId":"43328","inReplyTo":"20061111233046.17760.62871.stgit@localhost","subject":"Re: [PATCH 1/3] Ask git for author and committer name","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2006-11-11T23:35:38Z","receivedAt":"2006-11-11T23:35:38Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2006-11-12 00:30:46 +0100, Karl Hasselström wrote:\n\n>   1. Use the value specified on the command line, if any.\n>\n>   1. Otherwise, use the value from stgitrc, if available.\n>\n>   2. Otherwise, ask git for the value. git will produce the value\n>      from on of its config files, from environment variables, or\n>      make it up. It might be asking the spirits of the dead for all\n>      we care.\n\nOops. Feel free to renumber these points as you see fit. :-)\n\n-- \nKarl Hasselström, kha@treskal.com\n"},{"id":"294496","messageId":"20061112002030.GA21153@diana.vm.bytemark.co.uk","threadId":"43328","inReplyTo":"b0943d9e0611111502q2f68be67l1a2441d84923a732@mail.gmail.com","subject":"Re: Author name and e-mail address in .stgitrc","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2006-11-12T00:20:30Z","receivedAt":"2006-11-12T00:20:30Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2006-11-11 23:02:04 +0000, Catalin Marinas wrote:\n\n> I use StGIT almost exclusively, even in \"maintainer\" mode\n\nIt used to be the case that I did almost all my comitting with stgit\n(while still using other git tools, such as gitk, reset, bisect, fetch\netc.). But then I discovered the extremely handy git emacs modes, and\nstarted using them to commit stuff. Thus the need for \"stg\nassimilate\". :-)\n\n-- \nKarl Hasselström, kha@treskal.com\n"},{"id":"295020","messageId":"b0943d9e0612041424v42313a2r22d8fc8d1b18cb55@mail.gmail.com","threadId":"43328","inReplyTo":"20061111233046.17760.62871.stgit@localhost","subject":"Re: [PATCH 1/3] Ask git for author and committer name","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2006-12-04T22:24:52Z","receivedAt":"2006-12-04T22:24:52Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 11/11/06, Karl Hasselström <kha@treskal.com> wrote:\n> Consistently do the following to get hold of default user and\n> committer:\n>\n>   1. Use the value specified on the command line, if any.\n>\n>   1. Otherwise, use the value from stgitrc, if available.\n>\n>   2. Otherwise, ask git for the value. git will produce the value from\n>      on of its config files, from environment variables, or make it\n>      up. It might be asking the spirits of the dead for all we care.\n\nI haven't forgot about this patch. I switched StGIT to the gitconfig\nfiles and there won't be a need to invoke \"git repo-config\". I'll try\nto modify your patch.\n\n-- \n"},{"id":"296992","messageId":"20061205091017.GB25002@diana.vm.bytemark.co.uk","threadId":"43328","inReplyTo":"b0943d9e0612041424v42313a2r22d8fc8d1b18cb55@mail.gmail.com","subject":"Re: [PATCH 1/3] Ask git for author and committer name","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2006-12-05T09:10:17Z","receivedAt":"2006-12-05T09:10:17Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2006-12-04 22:24:52 +0000, Catalin Marinas wrote:\n\n> On 11/11/06, Karl Hasselström <kha@treskal.com> wrote:\n>\n> > Consistently do the following to get hold of default user and\n> > committer:\n> >\n> >   1. Use the value specified on the command line, if any.\n> >\n> >   1. Otherwise, use the value from stgitrc, if available.\n> >\n> >   2. Otherwise, ask git for the value. git will produce the value\n> >      from on of its config files, from environment variables, or\n> >      make it up. It might be asking the spirits of the dead for\n> >      all we care.\n>\n> I haven't forgot about this patch. I switched StGIT to the gitconfig\n> files and there won't be a need to invoke \"git repo-config\". I'll\n> try to modify your patch.\n\nAh, nice. But will you still honor the git author and committer\nenvironment variables that way?\n\n-- \nKarl Hasselström, kha@treskal.com\n"},{"id":"296706","messageId":"b0943d9e0612050117i3293f999m3ebf3278aacb8ce4@mail.gmail.com","threadId":"43328","inReplyTo":"20061205091017.GB25002@diana.vm.bytemark.co.uk","subject":"Re: [PATCH 1/3] Ask git for author and committer name","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2006-12-05T09:17:15Z","receivedAt":"2006-12-05T09:17:15Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 05/12/06, Karl Hasselström <kha@treskal.com> wrote:\n> On 2006-12-04 22:24:52 +0000, Catalin Marinas wrote:\n> > I haven't forgot about this patch. I switched StGIT to the gitconfig\n> > files and there won't be a need to invoke \"git repo-config\". I'll\n> > try to modify your patch.\n>\n> Ah, nice. But will you still honor the git author and committer\n> environment variables that way?\n\nYes. My understanding is that the environment variables would override\nthe config options. I would also keep the [stgit] user information for\nbackward compatibility (there are people who use StGIT exclusively and\ndon't want to dig into GIT configs).\n\n-- \n"}]}