Skip to content

Commit 0f8b375

Browse files
nielsbasjesmichael-o
authored andcommitted
[SCM-976] GitExe changelog does not work in if the user has defined a custom format
This closes #134
1 parent a6f075c commit 0f8b375

File tree

2 files changed

+13
-12
lines changed
  • maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src

2 files changed

+13
-12
lines changed

maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/changelog/GitChangeLogCommand.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ static Commandline createCommandLine( GitScmProviderRepository repository, File
208208
dateFormat.setTimeZone( TimeZone.getTimeZone( "GMT" ) );
209209

210210
Commandline cl = GitCommandLineUtils.getBaseGitCommandLine( workingDirectory, "whatchanged" );
211+
cl.createArg().setValue( "--format=medium" );
211212

212213
if ( startDate != null || endDate != null )
213214
{

maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/changelog/GitChangeLogCommandTest.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ public void testCommandLineNoDates()
5151
throws Exception
5252
{
5353
testCommandLine( "scm:git:http://foo.com/git", null, (Date) null, (Date) null, 40,
54-
"git whatchanged --date=iso --max-count=40 -- ." );
54+
"git whatchanged --format=medium --date=iso --max-count=40 -- ." );
5555
}
5656

5757
public void testCommandLineNoDatesLimitedCount()
5858
throws Exception
5959
{
6060
testCommandLine( "scm:git:http://foo.com/git", null, (Date) null, (Date) null,
61-
"git whatchanged --date=iso -- ." );
61+
"git whatchanged --format=medium --date=iso -- ." );
6262
}
6363

6464
public void testCommandLineWithDates()
@@ -68,7 +68,7 @@ public void testCommandLineWithDates()
6868
Date endDate = getDate( 2007, Calendar.OCTOBER, 10, GMT_TIME_ZONE );
6969

7070
testCommandLine( "scm:git:http://foo.com/git", null, startDate, endDate,
71-
"git whatchanged \"--since=2003-09-10 00:00:00 +0000\" \"--until=2007-10-10 00:00:00 +0000\" --date=iso -- ." );
71+
"git whatchanged --format=medium \"--since=2003-09-10 00:00:00 +0000\" \"--until=2007-10-10 00:00:00 +0000\" --date=iso -- ." );
7272
}
7373

7474
public void testCommandLineStartDateOnly()
@@ -77,7 +77,7 @@ public void testCommandLineStartDateOnly()
7777
Date startDate = getDate( 2003, Calendar.SEPTEMBER, 10, 1, 1, 1, GMT_TIME_ZONE );
7878

7979
testCommandLine( "scm:git:http://foo.com/git", null, startDate, null,
80-
"git whatchanged \"--since=2003-09-10 01:01:01 +0000\" --date=iso -- ." );
80+
"git whatchanged --format=medium \"--since=2003-09-10 01:01:01 +0000\" --date=iso -- ." );
8181
}
8282

8383
public void testCommandLineDateFormat()
@@ -87,7 +87,7 @@ public void testCommandLineDateFormat()
8787
Date endDate = getDate( 2005, Calendar.NOVEMBER, 13, 23, 23, 23, GMT_TIME_ZONE );
8888

8989
testCommandLine( "scm:git:http://foo.com/git", null, startDate, endDate,
90-
"git whatchanged \"--since=2003-09-10 01:01:01 +0000\" \"--until=2005-11-13 23:23:23 +0000\" --date=iso -- ." );
90+
"git whatchanged --format=medium \"--since=2003-09-10 01:01:01 +0000\" \"--until=2005-11-13 23:23:23 +0000\" --date=iso -- ." );
9191
}
9292

9393
public void testCommandLineDateVersionRanges()
@@ -97,7 +97,7 @@ public void testCommandLineDateVersionRanges()
9797
Date endDate = getDate( 2005, Calendar.NOVEMBER, 13, 23, 23, 23, GMT_TIME_ZONE );
9898

9999
testCommandLine( "scm:git:http://foo.com/git", null, startDate, endDate, new ScmRevision( "1" ), new ScmRevision( "10" ),
100-
"git whatchanged \"--since=2003-09-10 01:01:01 +0000\" \"--until=2005-11-13 23:23:23 +0000\" --date=iso 1..10 -- ." );
100+
"git whatchanged --format=medium \"--since=2003-09-10 01:01:01 +0000\" \"--until=2005-11-13 23:23:23 +0000\" --date=iso 1..10 -- ." );
101101
}
102102

103103
public void testCommandLineEndDateOnly()
@@ -107,43 +107,43 @@ public void testCommandLineEndDateOnly()
107107

108108
// Only specifying end date should print no dates at all
109109
testCommandLine( "scm:git:http://foo.com/git", null, null, endDate,
110-
"git whatchanged \"--until=2003-11-10 00:00:00 +0000\" --date=iso -- ." );
110+
"git whatchanged --format=medium \"--until=2003-11-10 00:00:00 +0000\" --date=iso -- ." );
111111
}
112112

113113
public void testCommandLineWithBranchNoDates()
114114
throws Exception
115115
{
116116
testCommandLine( "scm:git:http://foo.com/git", new ScmBranch( "my-test-branch" ), (Date) null, (Date) null,
117-
"git whatchanged --date=iso my-test-branch -- ." );
117+
"git whatchanged --format=medium --date=iso my-test-branch -- ." );
118118
}
119119

120120

121121
public void testCommandLineWithStartVersion()
122122
throws Exception
123123
{
124124
testCommandLine( "scm:git:http://foo.com/git", null, new ScmRevision( "1" ), null,
125-
"git whatchanged --date=iso 1.. -- ." );
125+
"git whatchanged --format=medium --date=iso 1.. -- ." );
126126
}
127127

128128
public void testCommandLineWithStartVersionAndEndVersion()
129129
throws Exception
130130
{
131131
testCommandLine( "scm:git:http://foo.com/git", null, new ScmRevision( "1" ), new ScmRevision( "10" ),
132-
"git whatchanged --date=iso 1..10 -- ." );
132+
"git whatchanged --format=medium --date=iso 1..10 -- ." );
133133
}
134134

135135
public void testCommandLineWithStartVersionAndEndVersionEquals()
136136
throws Exception
137137
{
138138
testCommandLine( "scm:git:http://foo.com/git", null, new ScmRevision( "1" ), new ScmRevision( "1" ),
139-
"git whatchanged --date=iso 1..1 -- ." );
139+
"git whatchanged --format=medium --date=iso 1..1 -- ." );
140140
}
141141

142142
public void testCommandLineWithStartVersionAndEndVersionAndBranch()
143143
throws Exception
144144
{
145145
testCommandLine( "scm:git:http://foo.com/git", new ScmBranch( "my-test-branch" ), new ScmRevision( "1" ), new ScmRevision( "10" ),
146-
"git whatchanged --date=iso 1..10 my-test-branch -- ." );
146+
"git whatchanged --format=medium --date=iso 1..10 my-test-branch -- ." );
147147
}
148148

149149
// ----------------------------------------------------------------------

0 commit comments

Comments
 (0)