Merge lp:~robru/bileto/fix-authors into lp:bileto

Proposed by Robert Bruce Park on 2016-08-23
Status: Merged
Merged at revision: 693
Proposed branch: lp:~robru/bileto/fix-authors
Merge into: lp:bileto
Diff against target: 24 lines (+6/-2)
1 file modified
scripts/vcs.sh (+6/-2)
To merge this branch: bzr merge lp:~robru/bileto/fix-authors
Reviewer Review Type Date Requested Status
CU2D maintainers 2016-08-23 Pending
Review via email: mp+303712@code.launchpad.net

Commit Message

Fix specifying multiple authors on a merge commit.

To post a comment you must log in.
lp:~robru/bileto/fix-authors updated on 2016-08-23
700. By Robert Bruce Park on 2016-08-23

Drop failed experiment.

701. By Robert Bruce Park on 2016-08-23

Protect against commit messages being run through eval.

702. By Robert Bruce Park on 2016-08-23

Escape author names.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'scripts/vcs.sh'
2--- scripts/vcs.sh 2016-08-17 21:02:42 +0000
3+++ scripts/vcs.sh 2016-08-23 17:24:18 +0000
4@@ -303,14 +303,18 @@
5 stdout bzr missing --theirs "$CACHE_SOURCE" >"$missing"
6 for author in $(sed -n 's/^committer: //p' <"$missing" | sort | uniq); do
7 output="$author, $output"
8- authors="$authors--author=$(echo $author | sed 's/ /\ /g') "
9+ # Author name must be escaped to prevent dangerous eval abuse.
10+ authors="$authors--author=$(echo "$author" | perl -lpe 's/(\W)/\\$1/gi') "
11 done
12 loudly bzr merge "$CACHE_SOURCE" || die "Failed to merge $BRANCH"
13 if loudly debcommit; then
14 echo '--DEBCOMMIT--'
15 else
16 [ -n "$MESSAGE" ] || die "Failed to commit $BRANCH. You must supply either a Commit Message on your MP, or a custom debian/changelog entry."
17- loudly bzr commit --unchanged $authors --message "$MESSAGE$BUGS$APPROVERS" || die "Failed to commit $BRANCH."
18+ msgfile="$WORKPARENT/$$-commit.message"
19+ echo "$MESSAGE$BUGS$APPROVERS" > "$msgfile"
20+ eval "bzr commit --unchanged $authors --file=$msgfile" 1>&2 || die "Failed to commit $BRANCH."
21+ loudly bzr log --limit 1 || die "Failed to display bzr log from $BRANCH."
22 echo "$output"
23 fi
24 rm --recursive --force "$CACHE_SOURCE"

Subscribers

People subscribed via source and target branches