[過去ログ] Git 18 (1002レス)
上下前次1-新
抽出解除 必死チェッカー(本家) (べ) 自ID レス栞 あぼーん
このスレッドは過去ログ倉庫に格納されています。
次スレ検索 歴削→次スレ 栞削→次スレ 過去ログメニュー
924(1): (ワッチョイ 617b-8+ss) 2022/11/05(土)22:46 ID:646uiMLL0(31/38) AAS
>>921
@はやっぱcommit履歴だよな?
エントリポインタだけだと、commit履歴に出来ないんだよ。
今回はfast-forwardマージしてるから、
init<-0<-1<-2<-3<-4<-5 = master, develop
で、単にエントリポイントだけなら master も develop も同じ 5 で区別がない。
当たり前だが両方とも HEAD~1 は4を指してる。
ただ、@{1}は、commit履歴だから、masterでは init を指し、developでは4を指す。
この、commit履歴情報はどこに記録されてるの?というのが俺の質問。
>>923
そこは理解出来てるはず。上記の通り。
問題はcommit履歴がどこにあるか。
928(1): (ワッチョイ 617b-8+ss) 2022/11/05(土)22:57 ID:646uiMLL0(32/38) AAS
>>926
$ git log --graph --branches --oneline
* 1a804d9 (HEAD -> master, develop) impl5
* ba4e962 impl4
* a32e11d impl3
* 8d9924f impl2
* 0f78740 impl1
* 47792a3 impl0
* b0325fc initial
930(3): (ワッチョイ 617b-8+ss) 2022/11/05(土)23:04 ID:646uiMLL0(33/38) AAS
>>917,926
ちな --no-ff 版、
今出すと余計に混乱するかもだが。
$ git log --graph --branches --oneline
* a5aaf72 (HEAD -> master, develop) Merge branch 'feature5' into develop
|\
| * e03bcd0 impl5
|/
* 324df68 Merge branch 'feature4' into develop
|\
| * c2634c4 impl4
|/
* 68ed20a Merge branch 'feature3' into develop
|\
| * 5e12b99 impl3
|/
* 608e5d7 Merge branch 'feature2' into develop
|\
| * 4660e46 impl2
|/
* 3924eae Merge branch 'feature1' into develop
|\
| * 138d83f impl1
|/
* 7db4424 Merge branch 'feature0' into develop
|\
| * 8877414 impl0
|/
* ec041f9 initial
931(1): (ワッチョイ 617b-8+ss) 2022/11/05(土)23:08 ID:646uiMLL0(34/38) AAS
>>929
$ git reflog master
1a804d9 (HEAD -> master, develop) master@{0}: merge develop: Fast-forward
b0325fc master@{1}: commit (initial): initial
$ git reflog develop
1a804d9 (HEAD -> master, develop) develop@{0}: merge feature5: Fast-forward
ba4e962 develop@{1}: merge feature4: Fast-forward
a32e11d develop@{2}: merge feature3: Fast-forward
8d9924f develop@{3}: merge feature2: Fast-forward
0f78740 develop@{4}: merge feature1: Fast-forward
47792a3 develop@{5}: merge feature0: Fast-forward
b0325fc develop@{6}: branch: Created from master
ってことは、commit履歴はreflogにしか無いって事か?
ならbrahchを消すとreflogも消されてcommit履歴が消えるが、マジ?
これだとbranchの復活は本質的に無理なことになってしまう。
(他branchに断片的には残ってるんだけどさ)
936(1): (ワッチョイ 617b-8+ss) 2022/11/05(土)23:18 ID:646uiMLL0(35/38) AAS
>>932
ごめん、それは分かってる。
それはグローバル履歴=gitオブジェクトを辿った履歴、だろ。
問題は、masterのcommitには b0325fc と 1a804d9 しかない、という情報が、
今のところ master の reflogにしか見あたらないんだよ。
だから、各branchを消したら、それ以前の gitオブジェクト は全部辿れるが、commit履歴は消失してしまう。
今のmasterみたいに、fast-forwardマージで中間をすっ飛ばしてきた、
という情報が無くなってしまうんだよ。
だから、branchを消す前の状態に完全には戻せない、という話。
だから、常識的に考えればもうちょっとましな何処かに保持してるはずなんだけど、無いんだ。
937(1): (ワッチョイ 617b-8+ss) 2022/11/05(土)23:21 ID:646uiMLL0(36/38) AAS
>>935
ほい
$ git log --graph --branches --oneline
* 2fb59f1 (HEAD -> master) Merge branch 'develop'
|\
| * 25e1b95 (develop) Merge branch 'feature5' into develop
| |\
| | * 4b27393 impl5
| |/
| * 9bfb8cc Merge branch 'feature4' into develop
| |\
| | * c2a5b7d impl4
| |/
| * 02d2308 Merge branch 'feature3' into develop
| |\
| | * f6d1cf7 impl3
| |/
| * 81e18bb Merge branch 'feature2' into develop
| |\
| | * 01c3871 impl2
| |/
| * 5b57f48 Merge branch 'feature1' into develop
| |\
| | * 0fe34d2 impl1
| |/
| * 6272da6 Merge branch 'feature0' into develop
| |\
|/ /
| * fe1b132 impl0
|/
* 832f464 initial
940: (ワッチョイ 617b-8+ss) 2022/11/05(土)23:35 ID:646uiMLL0(37/38) AAS
>>938
$ git log --graph --branches --oneline --first-parent
* a5aaf72 (HEAD -> master, develop) Merge branch 'feature5' into develop
* 324df68 Merge branch 'feature4' into develop
* 68ed20a Merge branch 'feature3' into develop
* 608e5d7 Merge branch 'feature2' into develop
* 3924eae Merge branch 'feature1' into develop
* 7db4424 Merge branch 'feature0' into develop
* ec041f9 initial
>>939
$ git log --graph --branches --oneline --first-parent
* 2fb59f1 (HEAD -> master) Merge branch 'develop'
| * 25e1b95 (develop) Merge branch 'feature5' into develop
| * 9bfb8cc Merge branch 'feature4' into develop
| * 02d2308 Merge branch 'feature3' into develop
| * 81e18bb Merge branch 'feature2' into develop
| * 5b57f48 Merge branch 'feature1' into develop
| * 6272da6 Merge branch 'feature0' into develop
|/
* 832f464 initial
942: (ワッチョイ 617b-8+ss) 2022/11/05(土)23:41 ID:646uiMLL0(38/38) AAS
>>938
なるほど了解した。
データ側に混ぜ込んでて、保持したければ --no-ff で使えってことか。
そもそも同じハッシュなら同じgitオブジェクトにリンクするようになってるのだし、
(つまり見た目が膨らんでるだけで実際の容量は大して食わない)
--no-ff がデフォのほうがよかった気がするが。
まあとにかく了解した。長々とありがとう。
上下前次1-新書関写板覧索設栞歴
スレ情報 赤レス抽出 画像レス抽出 歴の未読スレ
ぬこの手 ぬこTOP 1.897s*