-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
The current implementation of RepoSense assigns lines last modified by a commit in the IgnoreCommitList to an unknown author. This means that when a commit involving a bulk change occurs (ex: a formatting change) and that commit is added to the ignore commit list, the ```authorship.json``` file generated by RepoSense will not contain much meaningful information as most of the lines are assigned to an unknown author. Let's add a --find-previous-authors flag or -F to tell RepoSense to use Git blame's --ignore-revs-file argument and generate a .git-blame-ignore-revs file in the repositories analyzed to allow RepoSense users to have a more meaningful authorship report from RepoSense's analysis in the event that a bulk change occurs in the repositories analyzed.
- Loading branch information
Showing
73 changed files
with
767 additions
and
100 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,5 +19,4 @@ package-lock.json | |
reposense-report/ | ||
|
||
docs/_site/ | ||
|
||
**/.DS_Store |
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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
Repository's Location,Branch,File formats,Ignore Glob List,Ignore standalone config,Ignore Commits List,Ignore Authors List,Shallow Cloning | ||
https://github.com/reposense/testrepo-Alpha.git,master,,,,2fb6b9b2dd9fa40bf0f9815da2cb0ae8731436c7;c5a6dc774e22099cd9ddeb0faff1e75f9cf4f151;cd7f610e0becbdf331d5231887d8010a689f87c7;768015345e70f06add2a8b7d1f901dc07bf70582,, | ||
https://github.com/reposense/testrepo-Beta.git,master,fxml,docs**,yes,,, | ||
https://github.com/reposense/testrepo-Beta.git,add-config-json,fxml,docs**,yes,,, | ||
https://github.com/reposense/testrepo-Delta.git,master,override:java;md,,,,, | ||
https://github.com/reposense/testrepo-Delta.git,nonExistentBranch,,,,,, | ||
https://github.com/reposense/testrepo-Delta.git,add-binary-file,,,,,, | ||
https://github.com/reposense/RepoSense.git,master,,,,,, | ||
https://github.com/reposense/testrepo-Empty.git,master,,,,,, | ||
ftp://github.com/reposense/RepoSense.git,master,,,,,, | ||
Repository's Location,Branch,File formats,Ignore Glob List,Ignore standalone config,Ignore Commits List,Ignore Authors List,Shallow Cloning,Find Previous Authors | ||
https://github.com/reposense/testrepo-Alpha.git,master,,,,2fb6b9b2dd9fa40bf0f9815da2cb0ae8731436c7;c5a6dc774e22099cd9ddeb0faff1e75f9cf4f151;cd7f610e0becbdf331d5231887d8010a689f87c7;768015345e70f06add2a8b7d1f901dc07bf70582,,, | ||
https://github.com/reposense/testrepo-Beta.git,master,fxml,docs**,yes,,,, | ||
https://github.com/reposense/testrepo-Beta.git,add-config-json,fxml,docs**,yes,,,, | ||
https://github.com/reposense/testrepo-Delta.git,master,override:java;md,,,,,, | ||
https://github.com/reposense/testrepo-Delta.git,nonExistentBranch,,,,,,, | ||
https://github.com/reposense/testrepo-Delta.git,add-binary-file,,,,,,, | ||
https://github.com/reposense/RepoSense.git,master,,,,,,, | ||
https://github.com/reposense/testrepo-Empty.git,master,,,,,,, | ||
ftp://github.com/reposense/RepoSense.git,master,,,,,,, |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Repository's Location,Branch,File formats,Ignore Glob List,Ignore standalone config,Ignore Commits List,Ignore Authors List,Shallow Cloning | ||
https://github.com/reposense/testrepo-Alpha.git,master,,,,2fb6b9b2dd9fa40bf0f9815da2cb0ae8731436c7;c5a6dc774e22099cd9ddeb0faff1e75f9cf4f151;cd7f610e0becbdf331d5231887d8010a689f87c7;768015345e70f06add2a8b7d1f901dc07bf70582,, | ||
https://github.com/reposense/testrepo-Beta.git,master,java;adocs,docs**,yes,,, | ||
https://github.com/reposense/testrepo-Delta.git,master,html;css,,,,Ahmad Syafiq;Jordan Chong, | ||
https://github.com/reposense/RepoSense.git,master,,,,,, | ||
Repository's Location,Branch,File formats,Ignore Glob List,Ignore standalone config,Ignore Commits List,Ignore Authors List,Shallow Cloning,Find Previous Authors | ||
https://github.com/reposense/testrepo-Alpha.git,master,,,,2fb6b9b2dd9fa40bf0f9815da2cb0ae8731436c7;c5a6dc774e22099cd9ddeb0faff1e75f9cf4f151;cd7f610e0becbdf331d5231887d8010a689f87c7;768015345e70f06add2a8b7d1f901dc07bf70582,,, | ||
https://github.com/reposense/testrepo-Beta.git,master,java;adocs,docs**,yes,,,, | ||
https://github.com/reposense/testrepo-Delta.git,master,html;css,,,,Ahmad Syafiq;Jordan Chong,, | ||
https://github.com/reposense/RepoSense.git,master,,,,,,, |
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
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,38 @@ | ||
package reposense.git; | ||
|
||
import static reposense.system.CommandRunner.runCommand; | ||
|
||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
import java.util.regex.Pattern; | ||
|
||
/** | ||
* Contains git version related functionalities. | ||
* Git version is responsible for finding out the version of git the user of RepoSense is running. | ||
*/ | ||
public class GitVersion { | ||
public static final String FINDING_PREVIOUS_AUTHORS_INVALID_VERSION_WARNING_MESSAGE = | ||
"--find-previous-authors/-F requires git version 2.23 and above. Feature will be disabled for this run"; | ||
|
||
/** Regex for matching Git version 2.23 and above */ | ||
public static final Pattern FINDING_PREVIOUS_AUTHORS_VALID_GIT_VERSION_PATTERN = | ||
Pattern.compile("(((2\\d*\\.(2[3-9]\\d*|[3-9]\\d+|\\d{3,}))|((([3-9]\\d*)|(1\\d+))\\.\\d+))\\.\\d*)"); | ||
|
||
/** | ||
* Get current git version of RepoSense user | ||
*/ | ||
public static String getGitVersion() { | ||
Path rootPath = Paths.get("/"); | ||
String versionCommand = "git --version"; | ||
|
||
return runCommand(rootPath, versionCommand); | ||
} | ||
|
||
/** | ||
* Returns a boolean indicating whether the current user has a version valid for running | ||
* Find Previous Authors functionality in RepoSense. | ||
*/ | ||
public static boolean isGitVersionSufficientForFindingPreviousAuthors() { | ||
return FINDING_PREVIOUS_AUTHORS_VALID_GIT_VERSION_PATTERN.matcher(getGitVersion()).find(); | ||
} | ||
} |
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
Oops, something went wrong.