stMind

about Tech, Computer vision and Machine learning

git bundle createとrev-list

例えば

* 05bc8e6 (HEAD, origin/master, master) add alias for ls-remote
* e9eba48 add alias for bundle create
* b6a5232 setting for hadoop and mahout
・・・

というコミットログ(githubで管理している自分のdotfiles)があった時に、

$ git rev-list e9eba48..05bc8e6

これは、git help rev-listによると、

Thus, the following command:

                  $ git rev-list foo bar ^baz

means "list all the commits which are reachable from foo or bar, but not from baz".

A special notation "<commit1>..<commit2>" can be used as a short-hand for "^<commit1> <commit2>". For example, either of the following may be used interchangeably:
                  $ git rev-list origin..HEAD
                  $ git rev-list HEAD ^origin

ということなので、05bc8e6から辿れるコミットで、e9eba48からは辿れないコミットのリストで、実際

$ git rev-list e9eba48..05bc8e6
05bc8e65be8c73fb1395dc545488242cb501f3b7

b6a5232のコミットより後のコミットがリストとして表示される。

$ git rev-list e9eba48..HEAD
05bc8e65be8c73fb1395dc545488242cb501f3b7

としても同様の結果を得ることが出来る。

しかし、git bundle createで

$ git bundle create test.bdl e9eba48..HEAD
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 307 bytes, done.
Total 3 (delta 2), reused 0 (delta 0)

とすると、bundleを作成することができるが、

$ git bundle create test.bdl e9eba48..05bc8e6
fatal: Refusing to create empty bundle.

となってエラーとなる。

何か違いはありそうだがわかってはいない。