forked from Praqma/pretested-integration-plugin
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JENKINS-28640: Quotation marks in commit msg:
Only related to the accumulated strategy. Temporary fix for the bug with quotation marks in the commit message leading to merge failure because of not properly escaped and formatted command line arguments. Fix is temporary replacing " (quotation marks) with ' (plings). The squashed strategy is not affected, as the git command automatically generated the commit message, where as the plugin creates a look-a-like squash message, slightly modified, is using accumulated strategy. Other improvements: - fixed hard-coded dependency on the maven-hpi-plugin in the pom file, new version works now - cleaned few tests from wrong comments, and not clearly formatted error messages if the tests failed - renamed test suite for commit message prolems related to quotation marks to special chars test suite - shared a useful method from one test suite through test utils class that can pretty print console output from the job to use for verification in the tests.
- Loading branch information
Bue Petersen
committed
Jul 7, 2015
1 parent
cbd24a9
commit a48f690
Showing
16 changed files
with
666 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
274 changes: 167 additions & 107 deletions
274
...m/git/CommitMessagesWithDoubleQuotes.java → ...m/git/CommitMessagesWithSpecialChars.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Test repository with commits for issue JENKINS-28640 | ||
|
||
Problem is double quotes in commit messages, are wrongly escaped in commands. | ||
|
||
Issue [JENKINS-28640 Quotationmarks in commit message leads to merge failure](https://issues.jenkins-ci.org/browse/JENKINS-28640) report a possible bug, if using double quotes in a commit message. | ||
|
||
An earlier issue, namely the [JENKINS-27662](https://issues.jenkins-ci.org/browse/JENKINS-27662) didn't find such problems. It can be related to either our test environment or the way we created the commit messges in those test repositories used in the functional tests. | ||
|
||
|
||
This repository was created by one of the users of the plugin, a customer of Praqma, and supplies a test example that can reproduce the problem. | ||
|
||
There is no script for reproducing the repository, it was created under Windows. | ||
|
||
The repository have been converted to a bare git repository, to use it with the tests. |
Binary file not shown.
9 changes: 9 additions & 0 deletions
9
src/test/resources/commitMessagesWithDoubleQuotesSingleQuotesMade.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Commit message with double quotes made with single quotes | ||
|
||
|
||
Issue [JENKINS-28640 Quotationmarks in commit message leads to merge failure](https://issues.jenkins-ci.org/browse/JENKINS-28640) report a possible bug, if using double quotes in a commit message. | ||
|
||
An earlier issue, namely the [JENKINS-27662](https://issues.jenkins-ci.org/browse/JENKINS-27662) didn't find such problems. It can be related to either our test environment or the way we created the commit messges in those test repositories used in the functional tests. | ||
|
||
|
||
A new set of test repositories have been created, but on different Windows environments for more variations. |
21 changes: 21 additions & 0 deletions
21
src/test/resources/commitMessagesWithDoubleQuotesSingleQuotesMade_linux-repo_description.log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Repository view and commits | ||
|
||
Git version: | ||
git version 1.9.1 | ||
|
||
After initial commit on master: | ||
------------------------------- | ||
* [31m97e8cea[m -[33m (HEAD, master)[m Initial commit - added README [32m(0 seconds ago) [1;34m<Praqma Support>[m | ||
|
||
After the two commit on dev branch: | ||
----------------------------------- | ||
* [31m7921dd6[m -[33m (HEAD, origin/dev/JENKINS-27662_doublequotes, dev/JENKINS-27662_doublequotes)[m This is a commit message with double quotes, and =, eg. "test quotes". [32m(0 seconds ago) [1;34m<Praqma Support>[m | ||
* [31m7d5b38a[m -[33m[m Added test commit log file [32m(0 seconds ago) [1;34m<Praqma Support>[m | ||
* [31m97e8cea[m -[33m (origin/master, master)[m Initial commit - added README [32m(0 seconds ago) [1;34m<Praqma Support>[m | ||
|
||
Final repository, view dev branch after push to ready-branch: | ||
------------------------------------------------------------------------------ | ||
* [31m7921dd6[m -[33m (HEAD, origin/ready/JENKINS-27662_doublequotes, origin/dev/JENKINS-27662_doublequotes, dev/JENKINS-27662_doublequotes)[m This is a commit message with double quotes, and =, eg. "test quotes". [32m(0 seconds ago) [1;34m<Praqma Support>[m | ||
* [31m7d5b38a[m -[33m[m Added test commit log file [32m(0 seconds ago) [1;34m<Praqma Support>[m | ||
* [31m97e8cea[m -[33m (origin/master, master)[m Initial commit - added README [32m(0 seconds ago) [1;34m<Praqma Support>[m | ||
|
84 changes: 84 additions & 0 deletions
84
src/test/resources/commitMessagesWithDoubleQuotesSingleQuotesMade_linux.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
#!/bin/bash | ||
|
||
# setting names and stuff | ||
if [ -z "$1" ]; then | ||
VERSION="" | ||
else | ||
VERSION="_$1" | ||
fi | ||
NAME=commitMessagesWithDoubleQuotesSingleQuotesMade_linux | ||
REPO_NAME=$NAME$VERSION # used for manual testing of script and re-runs | ||
WORK_DIR=`pwd` | ||
|
||
LOG=$WORK_DIR/$REPO_NAME-repo_description.log | ||
echo "# Repository view and commits" >> $LOG | ||
echo "" >> $LOG | ||
echo "Git version:" >> $LOG | ||
git --version >> $LOG | ||
echo "" >> $LOG | ||
|
||
|
||
mkdir -v $REPO_NAME.git | ||
cd $REPO_NAME.git | ||
git init --bare | ||
|
||
cd $WORK_DIR | ||
git clone $REPO_NAME.git | ||
cd $REPO_NAME | ||
git config user.name "Praqma Support" | ||
git config user.email "support@praqma.net" | ||
|
||
touch README.md | ||
echo "# README of repository $REPO_NAME" >> README.md | ||
echo "" >> README.md | ||
echo "This is a test repository for functional tests." >> README.md | ||
git add README.md | ||
git commit -m "Initial commit - added README" | ||
|
||
|
||
echo "After initial commit on master:" >> $LOG | ||
echo "-------------------------------" >> $LOG | ||
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative >> $LOG | ||
echo "" >> $LOG | ||
echo "" >> $LOG | ||
|
||
git push origin master | ||
|
||
# custom parts | ||
BN=JENKINS-27662_doublequotes | ||
git checkout -b dev/$BN | ||
touch testCommit.log | ||
echo "# Test commit log" >> testCommit.log | ||
echo "" >> testCommit.log | ||
echo "Used for adding lines to commit something during tests.\n" >> testCommit.log | ||
git add testCommit.log | ||
git commit -m "Added test commit log file" | ||
|
||
# Problematic commit message with double quotes | ||
|
||
echo "Added a new line to this file, to commit something. Commit message will have double quotes" >> testCommit.log | ||
git add testCommit.log | ||
git commit -m 'This is a commit message with double quotes, and =, eg. "test quotes".' | ||
git push origin dev/$BN | ||
|
||
echo "After the two commit on dev branch:" >> $LOG | ||
echo "-----------------------------------" >> $LOG | ||
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative >> $LOG | ||
echo "" >> $LOG | ||
echo "" >> $LOG | ||
|
||
# also push to ready branch, so integration can start during the test | ||
git push origin dev/$BN:ready/$BN | ||
|
||
echo "Final repository, view dev branch after push to ready-branch:" >> $LOG | ||
echo "------------------------------------------------------------------------------" >> $LOG | ||
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative >> $LOG | ||
echo "" >> $LOG | ||
echo "" >> $LOG | ||
|
||
# Post process | ||
|
||
cd $WORK_DIR | ||
zip -r $NAME$VERSION.zip $REPO_NAME.git | ||
rm -rf $REPO_NAME.git $REPO_NAME | ||
|
Binary file added
BIN
+20.8 KB
src/test/resources/commitMessagesWithDoubleQuotesSingleQuotesMade_linux.zip
Binary file not shown.
Oops, something went wrong.