я вернулся :)
сейчас я питаюсь закоммитить измененный файл..
vv@crusader ~/work/own/python/config_tool/my_confman/configs $ gt status
# On branch tee
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: 2
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# .swp
# 3
no changes added to commit (use "git add" and/or "git commit -a")
vv@crusader ~/work/own/python/config_tool/my_confman/configs $ !p
python ../confman
<type 'file'> .swp
8
unexpected status
===
<type 'file'> 3
8
unexpected status
===
<type 'file'> 2
16
:)
.swp
8
--
3
8
--
2
2
--
÷ý*y²BZ8ѫ%|
<pygit2.Commit object at 0xb74ae120>
d54011f7fd2a7990c654b2425a38d1ab25c6717c
===
vv@crusader ~/work/own/python/config_tool/my_confman/configs $ gt status
# On branch tee
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: 2
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# .swp
# 3
vv@crusader ~/work/own/python/config_tool/my_confman/configs $ gt log -n 2
commit b01d1463ea2766dddecda1f13e8e12d83effe106
Author: vv <vv@crusader.terra.zu>
Date: Sun Jan 1 13:58:41 2012 +0200
test2
commit aa309cdf3330831d0f19de534921364991c54e7b
Author: vv <vv@crusader.terra.zu>
Date: Sun Jan 1 13:56:24 2012 +0200
test
vv@crusader ~/work/own/python/config_tool/my_confman/configs $
да, файл в staging добавляется. см внимательно статус после исполнения питонового скрипта.
код, который «делает» коммит
message = "Update of '" + os.path.basename(filepath) + "', "
message += "made at '" + socket.gethostname() + "' host"
# TODO: get name, email from ...
author = ('Jack Brown', '888@gmail.com', time.time(), time.altzone / 60)
# Get the last commit
head = repository.lookup_reference('HEAD')
head = head.resolve()
parent_commit = repository[head.oid]
parents = [parent_commit.hex]
# Get the tree object for last commit
tree_prefix = parent_commit.tree.hex
sha = repository.create_commit(None, author, author, message, tree_prefix, parents)
print sha
print repository[sha]
print repository[sha].hex
что теперь я делаю не так? или по другому: какой ман теперь надо читать?