Correct way to get ansible and modules from github and how to keep it tracking devel?

1,251 views
Skip to first unread message

Bob Tanner

unread,
May 5, 2016, 1:28:44 PM5/5/16
to Ansible Development
Got a new Mac and decided to get ansible from github vs copying it from my old Mac.

$ git --version
git version 2.8.2

<snip>

$ git submodule update --init --recursive
<snip>

$ cd ansible/lib/ansible/modules/core
$ git remote -v

$ git status
HEAD detached from 9db1233
nothing to commit, working directory clean

Why is HEAD detached?

$ cd ../extras/

$ git status
HEAD detached at 675d778
nothing to commit, working directory clean

Same problem with extras, HEAD is detached?

I thought the "git submodule update --init --recursive" would keep core and extra updated?

in ansible/modules/extras

$ git pull origin devel
 * branch            devel      -> FETCH_HEAD
Updating 675d778..77eee2b
Fast-forward
 .travis.yml                          |   2 +-
 cloud/amazon/GUIDELINES.md           |   5 +
 cloud/cloudstack/cs_template.py      |  17 ++
 cloud/vmware/vmware_datacenter.py    |   2 +
 messaging/rabbitmq_user.py           |   2 +-
 monitoring/monit.py                  |   5 +-
 network/f5/bigip_monitor_http.py     |  15 +-
 network/f5/bigip_monitor_tcp.py      |  17 +-
 network/f5/bigip_node.py             |  17 +-
 network/f5/bigip_pool.py             |  15 +-
 network/f5/bigip_pool_member.py      |  18 +-
 network/f5/bigip_virtual_server.py   |  16 +-
 notification/hipchat.py              |   5 +-
 packaging/language/maven_artifact.py |   8 +-
 packaging/os/homebrew_cask.py        |  42 +++-
 packaging/os/zypper.py               | 425 +++++++++++++++++++----------------
 16 files changed, 396 insertions(+), 215 deletions(-)

I've used How can I reconcile detached HEAD with master/origin? to fix up the "HEAD detached"  but why does clean clone from github put things into "HEAD detached" state?

Why doesn't the "git submodule update --init --recursive" keep the modules up today? 

I'm guessing the "HEAD detached" might be the reason "git submodule update --init --recursive" doesn't keep the modules up today.

For many months I thought I've been keeping my local repository tracking github with this series of commands:

$ git pull --rebase
$ git submodule update --recursive --init

Is that still the best way to track devel branch on github?

I'll admit I'm a git newbie so any help would be appreciated. 

Thanks.

Bob Tanner

unread,
May 5, 2016, 1:47:46 PM5/5/16
to Ansible Development
Using How can I reconcile detached HEAD with master/origin? to fix the "HEAD detached" the extra modules I'm told:

Your branch is behind 'origin/devel' by 17 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)

(ansible.git)tanner@alliance:extras$ git pull
Updating 675d778..77eee2b
Fast-forward
 .travis.yml                          |   2 +-
 cloud/amazon/GUIDELINES.md           |   5 +
 cloud/cloudstack/cs_template.py      |  17 ++
 cloud/vmware/vmware_datacenter.py    |   2 +
 messaging/rabbitmq_user.py           |   2 +-
 monitoring/monit.py                  |   5 +-
 network/f5/bigip_monitor_http.py     |  15 +-
 network/f5/bigip_monitor_tcp.py      |  17 +-
 network/f5/bigip_node.py             |  17 +-
 network/f5/bigip_pool.py             |  15 +-
 network/f5/bigip_pool_member.py      |  18 +-
 network/f5/bigip_virtual_server.py   |  16 +-
 notification/hipchat.py              |   5 +-
 packaging/language/maven_artifact.py |   8 +-
 packaging/os/homebrew_cask.py        |  42 +++-
 packaging/os/zypper.py               | 425 +++++++++++++++++++----------------
 16 files changed, 396 insertions(+), 215 deletions(-)

And now (example) the zypper.py file matches what I'm seeing on github

$ git log --follow zypper.py
commit bb68df525c78c48951cd925b5982c9dff45222fb
Author: Robin Roth <robin-roth@********.de>
Date:   Wed May 4 07:47:47 2016 +0200

But if I run "git submodule update --init --recursive" it changes both extra and core modules back to "HEAD detached" and (in this example) the zypper.py reverts back to a version Jan 28, 2016

$ git submodule update --init --recursive
$ cd lib/ansible/modules/extras/packaging/os/
$ git log --follow zypper.py

commit 36be779888cb69f6a2849c72731a9d03e5565d1e
Author: Toshio Kuratomi <toshio@*********.org>
Date:   Thu Jan 28 09:20:37 2016 -0800

Please let me know what I'm doing wrong.

Thanks.

Matt Martz

unread,
May 5, 2016, 2:31:18 PM5/5/16
to Bob Tanner, Ansible Development
You can generally expect your submodules to always be in a detached head state.

The submodules are pinned to specific commits, so when you update your submodules, it will check out an individual commit, rather than devel.

Once the submodules are bumped, which happens about once a week, you will see new updates.

If you checkout devel in the submodules, then a git status would tell you have unstaged changes to the submodules commit sha references.
--
You received this message because you are subscribed to the Google Groups "Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-deve...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Matt Martz
@sivel
sivel.net

Bob Tanner

unread,
May 5, 2016, 4:29:08 PM5/5/16
to Ansible Development, basicth...@gmail.com
To summarize, I'm not doing anything wrong?

Just need to wait until submodules to get bumped and I'll see them?

Further, my commands to keep current are correct?
Reply all
Reply to author
Forward
0 new messages