Examples - PreCyz/GitDiffGenerator GitHub Wiki

On this page you can find some basic examples how to use Gipter.

For all examples toolkit parameters (toolkitUsername & toolkitPassword) has to be set.

Toolkit docs Case
The user is Yoda. Documents are located in 2 folders: Deliverables and DocumentLibrary. We want to generate item for date range now - 30 days and now. The history of documents is as follows:

Deliverable-doc:

Modified by Date Version
Yoda now - 40 days 1.0
Kit Fisto now - 35 days 2.0
Yoda now - 25 days 3.0
Yoda now - 15 days 4.0
Obi-Wan Kenobi now - 13 days 5.0
Obi-Wan Kenobi now - 12 days 6.0
Yoda now - 2 days 7.0
Ashoka Tano now - 1 days 9.0


DocumentLibrary-doc:

Modified by Date Version
Mace Windu now - 15 days 1.0
Kit Fisto now - 14 days 2.0
Ashoka Tano now - 6 days 3.0
Anakin Skywalker now - 5 days 4.0
Shak Ti now - 4 days 5.0
Obi-Wan Kenobi now - 3 days 6.0
Yoda now - 2 days 7.0

The item will contains following documents: Deliverable-doc-2.0, Deliverable-doc-4.0, Deliverable-doc-6.0, Deliverable-doc-7.0 - all document before change and Yoda's last change.
DocumentLibrary-doc-6.0, DocumentLibrary-doc-7.0 - document before Yoda's change and the last change made by Yoda. All these files will be zipped into one file and uploaded as one item.

Case 1
It may be that owner of the code forbids to share the code in anyway but you are allowed to put headers of the changes in the diff. In that case user should set parameter itemType to PROTECTED. For GIT the PROTECTED protection will contain entries as follows:

a42212890 Cleaning code.
5cfc248ad Fixing that balck hole.

No code! Just:

  • who - optional,
  • when - optional,
  • commit hash - mandatory,
  • branch name - optional,
  • commit message - mandatory.

Case 2
It also may be that owner of the code forbids to share any kind of information about the code and changes, even headers. If so then user should upload to SharePoint file with the statement. Application can do it for user if only itemType parameter is set as STATEMENT.

Toolkit

To setup toolkit details only two parameters has to be set: toolkitUsername and toolkitPassword. If parameters are not set the application will generate diff file and report an error. Popup window will be displayed and in the logs there will be relevant entry. If parameters are set then new item in the toolkit will be created. New item will contain attachment, which is generated file with diffs from repositories. Below are details of that item:
Title: diff file name
Submission date: endDate + LocalTime.now()
Classification: Changeset (repository change report)
Body: vcsName diff file or STATEMENT diff

Sample of setups

Example 1
If you want to create diff for Smeagol Golum and Project1 from last 7 days then create following setup in your applicationProperties.json:

"runConfigs": [
    {
      "author": "Smeagol Gollum",
      "itemPath": "c:\\Path\\to\\git\\diff\\item",
      "projectPath": "c:\\Git\\Project1",
      "configurationName": "configName",
    }
  ]

Remember: Java + Windows == double backslash in the paths! There is no need for double backslashes in Linux. In linux it could be like this projectPath=/home/Gollum/Git/Project1

Example 2
If you want to create diff for Project1 and Project2 from last 12 days and for author Anakin Skywalker, create following setup in your applicationProperties.json:

"runConfigs": [
    {
      "author": "Anakin Skywalker",
      "itemPath": "c:\\Path\\to\\git\\diff\\item",
      "projectPath": "c:\\Git\\Project1,c:\\Git\\Project2",
      "periodInDays": 12,
      "configurationName": "configName",
    }
  ]

Example 3
If you want to create diff for Project1, Project2 and Project3 from 1st of June 2018 to 30th of June 2018 for authors Ezra Bridger and Kanan Jarrus, create following setup in your applicationProperties.json:

"runConfigs": [
    {
      "author": "Ezra Bridger,Kanan Jarrus",
      "itemPath": "c:\\Path\\to\\git\\diff\\item",
      "projectPath": "c:\\Git\\Project1,c:\\Svn\\Project2,c:\\hg\\Project3",
      "startDate": "2018-06-01",
      "endDate":"2018-06-30",
      "configurationName": "configName",
      "itemFileNamePrefix":"june"
    }
  ]

Explanation: set itemFileNamePrefix=june in order to have file name starts with june.

Example 4
If you want to create diff for Git-Project with author Shak Ti, Svn-Project with author Starkiller and Hg-Project with author Juno from 1st of June 2018 to 30th of June 2018 for authors Ezra Bridger and Kanan Jarrus, create following setup in your applicationProperties.json:

"runConfigs": [
    {
      "gitAuthor":"Shak Ti",
      "svnAuthor":"Starkiller",
      "mercurialAuthor":"Juno",
      "itemPath": "c:\\Path\\to\\git\\diff\\item",
      "projectPath": "c:\\Git-Project,c:\\Svn-Project,c:\\Hg-Project",
      "startDate": "2018-06-01",
      "endDate":"2018-06-30",
      "configurationName": "configName",
      "itemFileNamePrefix":"june"
    }
  ]

Example 5
If you want to create SVN diff for author Kit Fisto and Project1 which is protected by the owner, but you are allowed to use headers of the changes, create following setup in your applicationProperties.json:

"runConfigs": [
    {
      "svnAuthor":"Kit Fisto",
      "itemPath": "/home/Vader/Path/to/diff/item",
      "projectPath": "/home/Vader/SVN/Project1",
      "configurationName": "configName",
      "itemType":"PROTECTED"
    }
  ]

Explanation: Java + Linux == simple paths with slashes!
Example 6
If you want to create SVN diff for Project1 that is fully protected by the owner, then create following setup in your applicationProperties.json:

"runConfigs": [
    {
      "itemPath": "/home/Vader/Path/to/statement/my-statement.docx",
      "projectPath": "/home/Vader/SVN/Project1",
      "configurationName": "configName",
      "itemType":"STATEMENT"
    }
  ]
⚠️ **GitHub.com Fallback** ⚠️