Hi, I was just checking the commands generated by git changelog and I noticed that it does not respect the path, whereas it is very easy to integrate it, mentioning a simple '.' at the end of the 'git whatchanged' command does the trick and thats what the attached patch does.
I would be grateful if this would be integrated with the current version as this change has a grave positive effect on maven site's changelog report. Thank you, -- Imran M Yousuf Entrepreneur & Software Engineer Smart IT Engineering Dhaka, Bangladesh Email: im...@smartitengineering.com Blog: http://imyousuf-tech.blogs.smartitengineering.com/ Mobile: +880-1711402557
# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: /home/imyousuf/projects/maven-scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: src/main/java/org/apache/maven/scm/provider/git/gitexe/command/changelog/GitChangeLogCommand.java --- src/main/java/org/apache/maven/scm/provider/git/gitexe/command/changelog/GitChangeLogCommand.java Base (BASE) +++ src/main/java/org/apache/maven/scm/provider/git/gitexe/command/changelog/GitChangeLogCommand.java Locally Modified (Based On LOCAL) @@ -155,6 +155,9 @@ cl.createArg().setValue( branch.getName() ); } + // It should consider to provide log for the current path only + cl.createArg().setValue("."); + return cl; } } Index: src/test/java/org/apache/maven/scm/provider/git/gitexe/command/changelog/GitChangeLogCommandTest.java --- src/test/java/org/apache/maven/scm/provider/git/gitexe/command/changelog/GitChangeLogCommandTest.java Base (BASE) +++ src/test/java/org/apache/maven/scm/provider/git/gitexe/command/changelog/GitChangeLogCommandTest.java Locally Modified (Based On LOCAL) @@ -42,7 +42,7 @@ throws Exception { testCommandLine( "scm:git:http://foo.com/git", null, (Date) null, (Date) null, - "git whatchanged --date=iso" ); + "git whatchanged --date=iso ." ); } public void testCommandLineWithDates() @@ -52,7 +52,7 @@ Date endDate = getDate( 2007, Calendar.OCTOBER, 10, GMT_TIME_ZONE ); testCommandLine( "scm:git:http://foo.com/git", null, startDate, endDate, - "git whatchanged \"--since=2003-09-10 00:00:00 +0000\" \"--until=2007-10-10 00:00:00 +0000\" --date=iso" ); + "git whatchanged \"--since=2003-09-10 00:00:00 +0000\" \"--until=2007-10-10 00:00:00 +0000\" --date=iso ." ); } public void testCommandLineStartDateOnly() @@ -61,7 +61,7 @@ Date startDate = getDate( 2003, Calendar.SEPTEMBER, 10, 1, 1, 1, GMT_TIME_ZONE ); testCommandLine( "scm:git:http://foo.com/git", null, startDate, null, - "git whatchanged \"--since=2003-09-10 01:01:01 +0000\" --date=iso" ); + "git whatchanged \"--since=2003-09-10 01:01:01 +0000\" --date=iso ." ); } public void testCommandLineDateFormat() @@ -71,7 +71,7 @@ Date endDate = getDate( 2005, Calendar.NOVEMBER, 13, 23, 23, 23, GMT_TIME_ZONE ); testCommandLine( "scm:git:http://foo.com/git", null, startDate, endDate, - "git whatchanged \"--since=2003-09-10 01:01:01 +0000\" \"--until=2005-11-13 23:23:23 +0000\" --date=iso" ); + "git whatchanged \"--since=2003-09-10 01:01:01 +0000\" \"--until=2005-11-13 23:23:23 +0000\" --date=iso ." ); } public void testCommandLineDateVersionRanges() @@ -81,7 +81,7 @@ Date endDate = getDate( 2005, Calendar.NOVEMBER, 13, 23, 23, 23, GMT_TIME_ZONE ); testCommandLine( "scm:git:http://foo.com/git", null, startDate, endDate, new ScmRevision( "1" ), new ScmRevision( "10" ), - "git whatchanged \"--since=2003-09-10 01:01:01 +0000\" \"--until=2005-11-13 23:23:23 +0000\" --date=iso 1..10" ); + "git whatchanged \"--since=2003-09-10 01:01:01 +0000\" \"--until=2005-11-13 23:23:23 +0000\" --date=iso 1..10 ." ); } public void testCommandLineEndDateOnly() @@ -91,14 +91,14 @@ // Only specifying end date should print no dates at all testCommandLine( "scm:git:http://foo.com/git", null, null, endDate, - "git whatchanged \"--until=2003-11-10 00:00:00 +0000\" --date=iso" ); + "git whatchanged \"--until=2003-11-10 00:00:00 +0000\" --date=iso ." ); } public void testCommandLineWithBranchNoDates() throws Exception { testCommandLine( "scm:git:http://foo.com/git", new ScmBranch( "my-test-branch" ), (Date) null, (Date) null, - "git whatchanged --date=iso my-test-branch" ); + "git whatchanged --date=iso my-test-branch ." ); } @@ -106,28 +106,28 @@ throws Exception { testCommandLine( "scm:git:http://foo.com/git", null, new ScmRevision( "1" ), null, - "git whatchanged --date=iso 1.." ); + "git whatchanged --date=iso 1.. ." ); } public void testCommandLineWithStartVersionAndEndVersion() throws Exception { testCommandLine( "scm:git:http://foo.com/git", null, new ScmRevision( "1" ), new ScmRevision( "10" ), - "git whatchanged --date=iso 1..10" ); + "git whatchanged --date=iso 1..10 ." ); } public void testCommandLineWithStartVersionAndEndVersionEquals() throws Exception { testCommandLine( "scm:git:http://foo.com/git", null, new ScmRevision( "1" ), new ScmRevision( "1" ), - "git whatchanged --date=iso 1..1" ); + "git whatchanged --date=iso 1..1 ." ); } public void testCommandLineWithStartVersionAndEndVersionAndBranch() throws Exception { testCommandLine( "scm:git:http://foo.com/git", new ScmBranch( "my-test-branch" ), new ScmRevision( "1" ), new ScmRevision( "10" ), - "git whatchanged --date=iso 1..10 my-test-branch" ); + "git whatchanged --date=iso 1..10 my-test-branch ." ); } // ----------------------------------------------------------------------