Skip to content

Instantly share code, notes, and snippets.

@mancdaz
Last active August 29, 2015 14:23
Show Gist options
  • Save mancdaz/fa2ec4e7270bfd1ac2ec to your computer and use it in GitHub Desktop.
Save mancdaz/fa2ec4e7270bfd1ac2ec to your computer and use it in GitHub Desktop.

####given a commit SHA, find out if a deployed wheel contains that commit

i.e. Does our deployed neutron wheel contain a commit with a SHA of 9ff5bb967105451a1c3c1a6dfdbeb0ec979afaeb

#####1. find out the sha of the commit from which our wheel was built Log in to the neutron container of interest and get info on the wheel:

# lxc-attach -n aio1_neutron_agents_container-28d6792d
# pbr info neutron
neutron	2014.2.4.dev9	pre-release	1fafe42

The last thing on the line is the SHA of the commit from which the wheel was built. Now we just need to find out if that contains the commit we are interested in.

#####2. examine the commit history On any linux box, we need to clone the neutron repo and examine the commit history

# git clone https://github.com/openstack/neutron.git
# cd neutron

The format of the command we're going to run is:

git rev-list <SHA from which wheel was built> | grep <commit SHA that we are interested in>

So for our example:

# git rev-list 1fafe42 | grep 9ff5bb967105451a1c3c1a6dfdbeb0ec979afaeb
9ff5bb967105451a1c3c1a6dfdbeb0ec979afaeb

The fact that we did get a result from grep means that this wheel does in fact contain that commit.

What we're doing with that last command is saying

'list all the ancestor commits of commit object 1fafe42, and tell me if any of them are 9ff5bb967105451a1c3c1a6dfdbeb0ec979afaeb'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment