Commits on Aug 4, 2016
  1. Update dependencies

    maven-scm-provider-gitexe         1.9.5
    maven-scm-manager-plexus          1.9.5
    maven-scm-provider-svnjava        2.1.1
    org.jenkins-ci.plugins.subversion 2.5.7
    maven-scm update pulls in fix
    which improves Git handling of file paths with spaces in them.
    rodrigc committed Jul 6, 2016
Commits on Jan 29, 2016
Commits on Dec 29, 2015
  1. Merge pull request #33 from ghaabor/expose_reload_config_method

    Public method for UI-less reload in e. g. Groovy scripts
    rodrigc committed Dec 29, 2015
Commits on Dec 12, 2015
  1. Use powermock 1.6.4

    rodrigc committed Dec 12, 2015
  2. Make class abstract so it is not run by test runner

    Only subclasses of ScmSyncConfigurationPluginBaseTest should
    be run by the test runner.
    rodrigc committed Dec 12, 2015
  3. Use https URL to github

    rodrigc committed Dec 12, 2015
  4. Cleanup: remove a pointless override in a test class.

    In fact, this override without the @Test annotation effectively
    switched off this test for git. It's re-enabled now.
    tomaswolf committed with rodrigc Jul 7, 2015
  5. Cleanup: whitespace & formatting.

    No real code changes.
    Try to get a consistent indentation on all files touched in PR #31.
    Looks like these files used 4 spaces for indentation originally, but
    my Eclipse was set to use tabs.
    Fixed by IDE settings to use spaces instead of tabs and reformatted all
    Java files I touched. This also added some missing @Override
    annotations, and made some single-line if-statements use blocks -- I
    *never* use the short form.
    tomaswolf committed with rodrigc Jul 7, 2015
  6. Cleanup: minor fixes.

    * ScmSyncGitCheckInCommand: typo in a code path that is never taken
      in this plugin (it always calls checkIn with only a directory, no
    * Commit: check for user != null. Is that null check needed at all?
    * FixedGitStatusConsumer: use simpler & more efficient File.replace()
      instead of File.replaceAll(). File.separator is guaranteed to be the
      single character File.separatorChar per its contract.
    tomaswolf committed with rodrigc Jul 7, 2015
  7. Cleanup: make Path.contains() more precise.

    Same problem as in maven-scm's SCM-695: to check whether one
    path refers to a parent directory of another path, it behooves one
    well to handle file separators, otherwise a directory path "foo/bar"
    may be seen incorrectly as a parent to be stripped from the file path
    tomaswolf committed with rodrigc Jul 6, 2015
  8. Cleanup: attempt to fix race condition.

    The latestCommitFuture is global, but was not protected against
    concurrent modifications.
    Code changes:
    * Make sure that adding the commit to the queue and queueing the new
      job on the executor happen synchronized.
    * Eliminate the global latestCommitFuture altogether. It's good enough
      to wait for the current transactions' commit future.
    tomaswolf committed with rodrigc Jul 6, 2015
  9. [JENKINS-24686] Fix behavior for job names with blanks

    The basic problem here is SCM-772.[1] maven-scm cannot parse the output
    from git status if it contains quoted/escaped file names.
    There's at least two pull requests, one attached to SCM-772 and one at
    [2] aimed at fixing this; both are erroneous and don't look like they'd
    go in anytime soon. (The first one would at least replace \r by \f, and
    the second one only strips quotes but doesn't de-escape.)
    So we fix this by providing our own commands in our own gitexe
    provider and making sure that our implementation of these commands can
    deal with quoted/escaped filenames.
    Enabled the two test cases for job names with blanks.
    Also, since we're rewriting part of maven-scm here anyway, I've also
    included a minimal and proper fix for SCM-695.[3]
    [2] apache/maven-scm#26
    tomaswolf committed with rodrigc Jul 4, 2015
  10. Test: job name with blanks

    Add two more test cases for adding/deleting/renaming a job with blanks
    in the name. Ignored because of maven-scm bug SCM-772.[1]
    tomaswolf committed with rodrigc Jul 4, 2015
  11. [JENKINS-16441] Make it work for job names starting with '-'

    The problem here is that this maven SCM library omits -- for git rm.
    Factored out the nested class from a previous similar hack into its
    own file and added a new override for GitRemoveCommand.
    Enabled the test case for job name starting with a dash.
    tomaswolf committed with rodrigc Jul 1, 2015
  12. Test: job name starting with dash

    Add a test case for a job name starting with a dash. Is ignored; tests
    will fail if it is enabled. (Bug in maven-scm: GitRemoveCommand does
    not use -- to separate options from file names.)
    tomaswolf committed with rodrigc Jul 4, 2015
  13. Cleanup: add a few comments.

    In fact; I had been trapped by Eclipse's call hierarchy:
    getDefaultIncludes() appeared unreferenced. In reality, it is called via
    jelly from the manaualSynchronizationIncludes help text.
    tomaswolf committed with rodrigc Jul 1, 2015
  14. [JENKINS-16348] Trim & validate repository URL obtained from user

    Otherwise a mistakenly typed blank before or after may break things and
    leave the user puzzled about the reason.
    Also give that git repository URL a form validator. Yes, if this plugin
    is ever refactored to use git-plugin/git-client and Jenkins' proper
    Credential handling, this will have to change or be removed again, but
    I don't see this plugin being anywhere near that goal.
    The validation checks input for syntactic validity and also whether git
    actually can access the repository. It's still possible that pushing
    something to that repository fails later on (for instance, if Jenkins'
    OS user has no push permission), but at least this verifies the basic
    setup and gives the user a hint that and should be
    set, and that Jenkins' OS user may need to have a ssh key for
    repository access.
    I've included the validation in the plugin class itself and not in
    some git specific class because the corresponding jelly form is also
    the responsibility of the plugin class.
    Also some minor grammar things in help texts.
    tomaswolf committed with rodrigc Jun 30, 2015
Commits on Dec 11, 2015
  1. Cleanup: get a warning-free build & workspace.

    With all these warning markers it's a bit hard to see what's going on.
    tomaswolf committed with rodrigc Jun 30, 2015
  2. [JENKINS-15128] [JENKINS 16378] [JENKINS-24881] Job renaming

    1. JENKINS-15128: Maven SCM 1.9.1 _does_ use `git rm -r` to remove a
       directory. (At least on a machine with git 1.8.3) So I was not able
       to reproduce that particular problem.
    2. JENKINS-16378: The plugin mistakenly tried to copy the full job
       directory after a job rename. That's Github issue #8[1]. This
       may fail catastrophically if the build directory is in the job's
       directory and contains broken symlinks, for instance for new jobs
       or a job that never failed (lastFailed will point to a non-existing
       subdirectory named "-1")
          Even when it doesn't fail, it may end up putting way too many
       things into SCM, especially if the workspaces should also be
       located in the job directories.
    3. JENKINS-24881 is a duplicate of JENKINS-16378.
    4. Jenkins now does have a more general "move", the plugin has to
       account for that and use onLocationChanged instead of onRenamed.
       (Also in tests!)
    [1] #8
    * Refactored rename handling to submit only the stuff that is selected
      by some strategy.
    * ConfigurationEntityMatcher: removed unused method getIncludes(),
      added a new method to match deleted paths. Added a FileSelector
      to matchingFilesFrom() to be able to restrict the traversal to
      specific subdirectories under $JENKINS_HOME.
    * ChangeSet: removed registerRenamedPath (handled by transaction now).
    * Transaction: change rename handling to include only matched stuff
      under the new directory
    * AbstractScmSyncStrategy: createInitializationSynchronizedFileset()
      changed to account for FileSelector
    * ScmSyncConfigurationPlugin: fix the need to restart Jenkins to get
      going, and provide new operations to collect files.
    * The tests were broken. Moved two tests that cannot possibly succeed
      on git but per chance can succeed on svn to the svn-specific tests.
      These tests "succeeded" in the test runs so far only because they
      never did anything--they faked a job as Item.class, which never
      triggered anything, neither before nor after commit 141cc2b. These
      tests modify the repository from outside the plugin-managed SCM
      workspace. In git, this will always require a pull. In svn, these
      two test happen to work because the outside modification is on
      different paths. It should fail if there was a path conflict, so
      these two tests are dubious anyway.
    * Also removed a spurious mocking of the available strategies that
      was unused.
    tomaswolf committed with rodrigc Jun 29, 2015
  3. Fix dynamic load problem: avoid need to restart Jenkins.

    When the plugin is dynamically loaded into a running Jenkins, it
    would not properly initialize and thus refuse to do anything until
    Jenkins was restarted.
    Let's initialize early, but don't do so in tests where we do manually
    call init() at appropriate times.
    tomaswolf committed with rodrigc Jun 29, 2015
  4. [JENKINS-22540] Include built-in jenkins-plugins

    With the new Jenkins baseline, we not only have hudson.*.xml but also
    tomaswolf committed with rodrigc Jun 29, 2015
  5. Cleanup: avoid warnings about missing serialization ID.

    Use Collections.emptyList() of ImmutableList.of().
    tomaswolf committed with rodrigc Jun 29, 2015
  6. [JENKINS-18401] Don't fail on files outside $JENKINS_HOME

    This plugin can only put things under $JENKINS_HOME into SCM. If
    workspaces are located elsewhere, it failed with an exception.
    Newly, we just ignore such files. In all likelihood, users won't want
    to sync workspace files anyway. The same goes for the builds directory.
    People who really might want to put stuff from there into SCM can
    try symlinking to their desired workspace/build roots from
    $JENKINS_HOME. Restoring from SCM may, however, then produce unexpected
    Should fix JENKINS-18401 and related issues such as JENKINS-13593 and
    Includes two tests for buildPathRelativeToHudsonRoot(), and use
    org.junit.Assert.assertNotNull etc.instead of the hamcrest matchers.
    [JENKINS-13593] [JENKINS-19984]
    tomaswolf committed with rodrigc Jun 27, 2015
  7. [JENKINS-24993] Restrict looking for jobs to the jobs directory

    Having an ant pattern starting with "**" was a _very_ bad idea. It
    makes the plugin search way too many places, including even its own
    SCM workspace. Which then leads to recursively including ever deeper
    SCM workspace hierarchies in the SCM workspace and in the repository.
    Also, such an ant pattern makes the plugin scan all jobs' workspaces,
    which can take a long time and may discover bogus matches. (They're by
    default at $JENKINS_HOME/workspace.)
    The Cloudbees Folders plugin has all jobs under $JENKINS_HOME/jobs,
    and possibly nested as in
    Both Jobs and Folders are Saveables; folders also have a config.xml.
    Source changes:
    * Introduce a new ConfigurationEntityMatcher that matches and
      traverses only exactly this jobs/XXX/jobs/YYY/jobs... hierarchy.
    * To avoid problems with user-defined inclusions starting with * or
      even **, exclude our own SCM working directory always in ant pattern
    * Also exclude the war directory in $JENKINS_HOME.
    * Undo more changes from commit 141cc2b. Since we test new for
      AbstractItem, the tests should not mock TopLevelItem. Better mock
    * Add two little test cases for config file matching for a job nested
      in a folder.
    * Add minimal test cases for page URL matching for jobs.
    tomaswolf committed with rodrigc Jun 25, 2015
  8. [JENKINS-22666] Fix regexp

    Since PR #19 at GitHub (commit 141cc2b), we don't get a commit message
    dialog anymore for changes to job configurations.
    The regexp looks broken with the initial slashes and only a single
    [^/]. With the Cloudbees Folders plugin jobs can be not only at
    but also at
    This commit simplifies the regexp and fixes it.
    tomaswolf committed with rodrigc Jun 25, 2015
  9. Switch to Java 6.

    It's the minimum requirement for Jenkins since 1.520.
    tomaswolf committed with rodrigc Jun 29, 2015
  10. Get this to compile, build, and pass the tests.

    I did not manage to get this going with the 1.409 POM. And anyway
    newer Jenkins versions have some changes that this plugin should
    account for.
    POM changes:
    * Increase minimum Jenkins version to 1.565.3 (LTS from October 2014)
      and adapt POM as needed to get tests to run successfully in my
      Eclipse/m2e setup. Also clean out some obsolete stuff relating to
      easymock, which isn't used anymore.
    * Add a license (MIT).
    * Include some Eclipes m2e-specific "lifecycle mappings". Unfortunately
      that's needed for Eclipse users, otherwise nothing will work.
    * Fix some versions.
    * Resolve the sisu-vs.-plexus problems by using a resent
      sisu-inject-plexus and making sure that comes first and thus wins.
      Exclude the very old plexus container stuff pulled in via
      maven-scm-manager-plexus; sisu-inject-plexus provides a newer one.
      Didn't touch the SCMManagerFactory, though.
    Code changes:
    * Mock Jenkins, too, not just Hudson.
    * Add the Eclipse m2e annotation processor file to .gitignore
    tomaswolf committed with rodrigc Jun 29, 2015
  11. Add myself as a maintainer

    rodrigc committed Dec 11, 2015
Commits on Aug 24, 2014