git/hooks: only use first line as project description
Hi all, This is something I've seen for ages and thought should be fixed (either by this patch and/or another which supports multi-line description files properly). I have an alternate version of this patch which side-steps the issue by adding the X-Project header last, so if it's multiple lines it won't screw up other headers. I think this is the proper fix though. If multi-line description files are really something which are desired, then a commit on top of this change could add support for reading the remaining lines from the description file and add them to the message body. roles/git/hooks/files/git.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
This commit is contained in:
parent
25d9274b52
commit
4a3ef1013c
1 changed files with 2 additions and 1 deletions
|
@ -202,7 +202,8 @@ def get_project_description():
|
|||
description = os.path.join(git_dir, 'description')
|
||||
if os.path.exists(description):
|
||||
try:
|
||||
projectdesc = open(description).read().strip()
|
||||
with open(description, 'r') as f:
|
||||
projectdesc = f.readline().strip()
|
||||
except:
|
||||
pass
|
||||
if projectdesc.startswith('Unnamed repository;'):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue