We use Jenkins as our CI-engine, which knows how to monitor a git repository. For some reason I usually see
Started by user anonymous
Building in workspace /var/lib/jenkins/jobs/X/workspace
Checkout:workspace / /var/lib/jenkins/jobs/X/workspace - hudson.remoting.LocalChannel@844d88
Using strategy: Default
Last Built Revision: Revision 8422864a9745535d808435bd33ece764fd250358 (origin/HEAD, origin/master)
Fetching changes from 1 remote Git repository
Fetching upstream changes from gitosis@...
Seen branch in repository origin/HEAD
Seen branch in repository origin/master
Commencing build of Revision c1e71af117df3cd63da972f361ad260af6f16bf5 (origin/HEAD, origin/master)
Checking out Revision c1e71af117df3cd63da972f361ad260af6f16bf5 (origin/HEAD, origin/master)
Warning : There are multiple branch changesets here
Parsing POMs
Modules changed, recalculating dependency graph
My question is, what does the "Warning : There are multiple branch changesets here" line actually_mean_?
Git offers a feature referred to as a worktree, and what it does is allow you to have multiple branches running at the same time. It does this by creating a new directory for you with a copy of your git repository that is synced between the two directories where they are stored.
Indivisible simply means that a changeset is one single value in the stack of changes that are being made on a codebase. For example, if you look at a commit, you can check what individual files were modified, what was the previous state of the codebase and after, which would make it adhere to what a changeset is.
If you use git branches a lot, you'll often push each branch after each commit. Instead of pushing every single branch you can do git push --all origin . This will push all commits of all branches to origin.
I'm no Jenkins expert but I found this issue that would seem to explain the warning:
https://issues.jenkins-ci.org/browse/JENKINS-6856
It seems Jenkins builds in detached head state and that happens when it checkouts a remote branch (origin/master in this case) and I'm guessing that the warning is due to HEAD not pointing to a local branch. So Jenkins has created an anonymous branch in effect.
EDIT: Did a code search on Github and found the methods in the GitSCM plugin for Jenkins that generate this warning. See here
If a revision (which you can see in another Jenkins plugin called git-client-plugin), has more than one branch pointing to it then the GitSCM plugin warns that there are multiple branches. The revision is the git commit that is being built and it is fully possible in git to have multiple branches pointing to the same commit.
The comment for the Revision class explains it:
A Revision is a SHA1 in the object tree, and the collection of branches that share this ID. Unlike other SCMs, git can have >1 branches point at the same commit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With