Mark Waite edited a comment on Bug JENKINS-22510

I've been trying to understand the sequence of git operations which arrive at that state, and haven't yet understood them. My attempts have persuaded me that I don't understand submodules. I used my fork of the git-client-plugin for my experiments.

Clone the repository - works

git clone git://github.com/MarkEWaite/git-client-plugin
cd git-client-plugin
ls modules/ntp # reports an error, no content in modules/ntp

Checkout tests/getSubmodules - works

git checkout tests/getSubmodules
git submodule update --init --recursive
ls modules/ntp # Shows there is content in modules/ntp

Checkout master again - works

git checkout master # warns there are untracked files in modules directory
ls modules/ntp # shows content in modules/ntp is still there

git clean -xfd # skips modules/ntp and modules/firewall
ls modules/ntp # shows content in modules/ntp is still there

git clean -xffd # deletes modules/ntp and modules/firewall
ls modules/ntp # no content in modules/ntp

Checkout branch containing a conflicting file - works

git checkout tests/notSubmodules
ls modules/ntp # one file in modules/ntp

Checkout tests/getSubmodules again - works

git checkout tests/getSubmodules
git submodule update --init --recursive

Checkout branch (force) containing a conflicting file - works

git checkout -f tests/notSubmodules # works - but warns unable to rmdir
git clean -xffd
ls modules/ntp # one file in modules/ntp as expected

Checkout tests/getSubmodules (force) - fails

git checkout -f tests/getSubmodules
git submodule update --init --recursive
ls modules/ntp # one file in modules/ntp - should be more files there

The working sequence in my case seems to be "force checkout, then use git clean -xffd". That doesn't work for the transition from "getSubmodules" to "notSubmodules", but covers the other cases. Even a clean before checkout does not work for the transition from "getSubmodules" to "notSubmodules" (as far as I can tell). However, since my case does not duplicate your message, I'm not sure if you'll see the same behavior as I see.

In that repository, the branch to branch transitions seem to behave like this:

Current Branch Branch to Checkout Result
master tests/getSubmodules ok
master tests/notSubmodules ok
tests/getSubmodules master ok
tests/notSubmodules master ok
tests/getSubmodules tests/notSubmodules fails
tests/notSubmodules tests/getSubmodules ok

However, the failure message I'm seeing is not the same as the failure message you're seeing. I'm confident that means I don't understand enough about submodules. Can you provide a similar series of steps (preferably using a fork of the git-client-plugin repository) to show your case?

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to