title: How can I get the repository name or URL of a GitChangeSet object?
body: <p>I have a <a href="http://javadoc.jenkins.io/git/hudson/plugins/git/GitChangeSet.html" rel="nofollow noreferrer"><code>GitChangeSet</code></a> object (that ultimately came from a build).  I would like to find the repository name or URL associated with that commit.  However, none of the properties of the object seem to hint at where this commit ultimately came from.  E.g.:</p>
  
  <pre><code>affectedFiles=[hudson.plugins.git.GitChangeSet$Path@2a7ac0cb, hudson.plugins.git.GitChangeSet$Path@1d9fb12a, hudson.plugins.git.GitChangeSet$Path@3b47e461, hudson.plugins.git.GitChangeSet$Path@35be1e86]
  comment=CF-703 - remove testing-only hostsfile entry that caused "hostname -f"
  to return "localhost"
  
  date=2017-12-19 16:25:17 -0700
  id=cfc01dfbf1015496074c2c1e6c9663cfb0f49751
  commitId=cfc01dfbf1015496074c2c1e6c9663cfb0f49751
  branch=null
  msgEscaped=CF-703 - remove testing-only hostsfile entry that caused &amp;quot;hostname -f&amp;quot;
  timestamp=1513725917000
  authorName=hendrenj
  parentCommit=bf4b919e74c635c61c4761134d6b53445829593d
  msg=CF-703 - remove testing-only hostsfile entry that caused "hostname -f"
  class=class hudson.plugins.git.GitChangeSet
  msgAnnotated=CF-703 - remove testing-only hostsfile entry that caused &amp;quot;hostname -f&amp;quot;
  commentAnnotated=CF-703 - remove testing-only hostsfile entry that caused &amp;quot;hostname -f&amp;quot;&lt;br&gt;to return &amp;quot;localhost&amp;quot;&lt;br&gt;
  revision=cfc01dfbf1015496074c2c1e6c9663cfb0f49751
  paths=[hudson.plugins.git.GitChangeSet$Path@2a7ac0cb, hudson.plugins.git.GitChangeSet$Path@1d9fb12a, hudson.plugins.git.GitChangeSet$Path@3b47e461, hudson.plugins.git.GitChangeSet$Path@35be1e86]
  createAccountBasedOnEmail=false
  affectedPaths=[recipes/default_vhost.rb, metadata.rb, test/integration/shared/serverspec/default_vhost/default_vhost.rb, Policyfile.lock.json]
  authorEmail=*******@*******.***
  parent=hudson.plugins.git.GitChangeSetList@2eb9acad
  author=Jay Hendren
  </code></pre>
  
  <p>I got this commit object by iterating over <code>build.changeSets</code> (which I believe comes from the class <a href="http://javadoc.jenkins-ci.org/hudson/model/AbstractBuild.html" rel="nofollow noreferrer"><code>hudson.model.AbstractBuild</code></a>).  I do know that this particular commit came from a global Shared Library repository, not the main repository associated with this build, but I don't see any obvious way to extract that information programmatically.  <strong>How can I programmatically determine which repository the <code>GitChangeSet</code> objects (or other objects in <code>hudson.model.AbstractBuild.changeSets</code> in general)  came from?</strong></p>
  
  <hr>
  
  <p>For context, I'm developing an e-mail report for failed builds that, among other things, collects a list of commits associated with the failed build.  Since I have complex upstream/downstream relationships between my jobs, a commit in one repository may trigger a series of builds as successful builds trigger downstream jobs that depend on the upstream ones.  Additionally, there are other repositories associated with my builds, in particular a global Shared Library repository.  I would like my report to mention what commits are ultimately responsible for the series of builds resulting in the current one.  Finding these upstream commits has not been too painful so far (thanks to <code>UpstreamJobCause</code>), but I've become hung up on determining where those commits ultimately came from.  I would appreciate any suggestions on alternative approaches to this problem in the comments if you don't know of an answer to my question as stated.</p>