Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

What is this add-on for?

Submodule Changes for Bitbucket helps visualize modified lines of code in commits and pull requests for repositories with submodules.

While working with Git submodules, there's a common problem with showing changes that are made to the submodule in the Diff tab. It displays two commit hashes instead of actually modified files and LOC. It's especially inconvenient when it comes to reviewing pull requests.

Submodule Changes for Bitbucket app helps watch changes committed to a submodule in a standard Bitbucket Diff view as if they're committed to the super-repository. It also gives an ability to watch Blame leave comments for more convenient pull requests review. 

Submodule Changes for Bitbucket also gives an ability to watch Blame, leave comments on the entire pull request, a particular file, or on specific lines of code in a file for more convenient pull requests review. 

How to install and configure the app?

To install Submodule Changes for Bitbucket, log into your Bitbucket Server as Administrator and install Submodule Changes for Bitbucket directly from Atlassian Marketplace or by file upload. 

The app doesn't require any configuration. Once installed, the changes apply to the Diff tab for commits and pull requests with updates to a submodule. 

How to turn off the app for a certain submodule?

In some cases, the number of changes in a pull request with a submodule can exceed the page.max.changes limit. For instance, when a dependency on some large project is used as a submodule. That resulted in an incomplete displaying of changes in the pull request diff view.

To disable the Submodule Changes for Bitbucket app for a specific submodule in a repository, you need to add a special property in the .gitmodules file using the following Git command:

Code Block
git config --file .gitmodules submodule.<name>.ignoreChanges true

In this command, <name> is the submodule name specified in the [submodule "<name>"] section of the .gitmodules file. The changes will be applied after you commit and push them. 

Ex.: if you have a submodule named "library", the .gitmodules file will be the following:

Code Block
[submodule "library"]
path = library
url = https://bitbucket.company.com/scm/sm/library.git

In this case, your command that will turn off the app for this submodule will be:

Code Block
git config --file .gitmodules submodule.library.ignoreChanges true

As a result, the .gitmodules file will change like this:

Code Block
[submodule "library"]
path = library
url = https://bitbucket.company.com/scm/sm/library.git
ignoreChanges = true