Skip to content

Instantly share code, notes, and snippets.

View anteaya's full-sized avatar

Anita Kuno anteaya

View GitHub Profile
$ git checkout -b feature
Switched to a new branch 'feature'
$ tree .git
.git
├── branches
├── COMMIT_EDITMSG
├── config
├── HEAD
├── index
├── logs
$ cat .git/refs/heads/master
d561f82d45e267593220296ac3e956e47a98717f
$ cat .git/logs/HEAD
0000000000000000000000000000000000000000 d561f82d45e267593220296ac3e956e47a98717f Anita Kuno <[email protected]> 1361885197 -0500 commit (initial): adding my first file
$ cat .git/logs/refs/heads/master
0000000000000000000000000000000000000000 d561f82d45e267593220296ac3e956e47a98717f Anita Kuno <[email protected]> 1361885197 -0500 commit (initial): adding my first file
$ git commit -m 'adding my first file'
[master (root-commit) d561f82] adding my first file
1 file changed, 1 insertion(+)
create mode 100644 first_file.txt
$ tree .git
.git
├── branches
├── COMMIT_EDITMSG
├── config
├── HEAD
$ git add first_file.txt
$ tree .git
.git
├── branches
├── config
├── HEAD
├── index
├── objects
│ ├── 44
│ │ └── 10ed47ea8a5200397d85926fe7bbdd25d1408a
$ tree .git
.git
├── branches
├── config
├── HEAD
├── objects
│ ├── info
│ └── pack
└── refs
├── heads
$ git init .
Initialized empty Git repository in /home/anita/work/openstack/git_sample/.git/
$ tree .git
.git
├── branches
├── config
├── description
├── HEAD
├── hooks
│ ├── applypatch-msg.sample
@anteaya
anteaya / swift and ceph
Created February 22, 2013 23:56
swift and ceph
<anteaya> just one question
<anteaya> That method will call GETorHEAD which in
<anteaya> do you think it would look better if it was GET or HEAD
<anteaya> rather that GETorHEAD as it is now? GETorHEAD looks like one message rather than two
* lloydde ([email protected]) has joined #openstack-101
* torgomatic ([email protected]) has joined #openstack-101
* dolphm ([email protected]) has joined #openstack-101
<notmyname> anteaya: ok, pushed those fixes. also, GETorHEAD is correct (https://github.com/openstack/swift/blob/master/swift/proxy/controllers/obj.py#L328)
<notmyname> GETs and HEADs, per the HTTP spec, are the same except for the existence of a response body, so they are implemented in swift as the same function (rather than duplicating the code)
<anteaya> nice
$ python logging_example_01.py
CRITICAL:__main__:foo was called
Hello World!
$ python logging_example_04.py
CRITICAL:__main__:foo was called
DEBUG:__main__:this message output from debug
WARNING:__main__:this is a warning message
INFO:__main__:this is some information, hope it is helpful
ERROR:__main__:this is an error
Hello World!
import logging
logging.basicConfig(level=logging.DEBUG)
LOG = logging.getLogger(__name__)
def foo():
LOG.critical("foo was called")
LOG.debug("this message output from debug")
LOG.warning("this is a warning message")