Skip to content

Commit

Permalink
Merge pull request #5 from hfagerlund/develop
Browse files Browse the repository at this point in the history
Bugfix/issue 1: Trac comment(s) linebreaks
  • Loading branch information
hfagerlund committed Dec 30, 2015
2 parents 121c8ac + 1f23676 commit 2f7e366
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ and (optionally):
```
$ git status
```
Also creates a **changelog.txt** file (in your project's root directory), and (optionally) adds a comment in the Trac ticket for each commit.
Also creates a **changelog.log** file (in your project's root directory), and (optionally) adds a comment in the Trac ticket for each commit.

## tl;dr
All of the above is accomplished by running just one command:
Expand Down
12 changes: 8 additions & 4 deletions git-add-msg
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# * (Trac users) run using -r option to automatically add comments, with links to changesets in specified repository, in Trac tickets.
#
# author: Heini Fagerlund
# version: 0.1.1
# version: 0.1.3
# license: MIT
#
# Copyright (c) 2015 Heini Fagerlund
Expand Down Expand Up @@ -85,23 +85,27 @@ while :
do
printf "Enter your commit message (without quote marks; press ctrl-d when done):\n"
mymultimsg=$(cat)

multimsg="${mymultimsg}"
if [ ! -z "$mymultimsg" -a "$mymultimsg" != " " ]; then
printf "git committing...\n"
git add .
git commit -am "#$ticketnum: $mymultimsg" | xclip
git commit -F- <<MSG
$multimsg
MSG
git log --decorate -1 | xclip
changeset=$( xclip -o )

changeset=${changeset%\]*}
changeset=${changeset: -7}
xclip -o >> ./changelog.txt ##OPTIONAL: separate log file
xclip -o >> ./changelog.log ##OPTIONAL: separate log file
xclip -o

mymultimsg=${mymultimsg//&/&amp;}
mymultimsg=${mymultimsg//$"'"/}
mymultimsg=${mymultimsg//>/&gt;}
mymultimsg=${mymultimsg//</&lt;}
mymultimsg=${mymultimsg//$'"'/&quot;}
mymultimsg=${mymultimsg//$'\n'/&#13;}

if mkdir bin &> /dev/null; then
tee "./bin/body_template.xml" > /dev/null <<MYXML
Expand Down

0 comments on commit 2f7e366

Please sign in to comment.