From: Yann Dirson Date: Sun, 16 Apr 2006 10:52:46 +0000 (+0200) Subject: Look for templates in ~/.stgit/templates as well X-Git-Tag: v0.14.3~502 X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/commitdiff_plain/94d1886878f54807b7c2be9eec9410723c04f2f2 Look for templates in ~/.stgit/templates as well This can be quite useful to avoid adding one's sig again and again to ever covermail, and to use a patchmail template that insert Signed-off-by lines, for those of us who prefer this to adding them to commits. Also make sure to use os.path.join() instead of hardcoded slashes. Signed-off-by: Yann Dirson --- diff --git a/stgit/commands/export.py b/stgit/commands/export.py index e7de902..fbf5690 100644 --- a/stgit/commands/export.py +++ b/stgit/commands/export.py @@ -31,8 +31,9 @@ usage = """%prog [options] [] Export the applied patches into a given directory (defaults to 'patches') in a standard unified GNU diff format. A template file -(defaulting to '.git/patchexport.tmpl or -/usr/share/stgit/templates/patchexport.tmpl') can be used for the +(defaulting to '.git/patchexport.tmpl' or +'~/.stgit/templates/patchexport.tmpl' or +'/usr/share/stgit/templates/patchexport.tmpl') can be used for the patch format. The following variables are supported in the template file: @@ -145,8 +146,10 @@ def func(parser, options, args): patch_tmpl_list = [] patch_tmpl_list += [os.path.join(basedir.get(), 'patchexport.tmpl'), + os.path.join(os.path.expanduser('~'), '.stgit', 'templates', + 'patchexport.tmpl'), os.path.join(sys.prefix, - 'share/stgit/templates/patchexport.tmpl')] + 'share', 'stgit', 'templates', 'patchexport.tmpl')] tmpl = '' for patch_tmpl in patch_tmpl_list: if os.path.isfile(patch_tmpl): diff --git a/stgit/commands/mail.py b/stgit/commands/mail.py index 470cf65..5e01ea1 100644 --- a/stgit/commands/mail.py +++ b/stgit/commands/mail.py @@ -30,16 +30,18 @@ usage = """%prog [options] [ [