# 극도로 선형적인 Git History 유지하기

> Clean Markdown view of GeekNews topic #7881. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=7881](https://news.hada.io/topic?id=7881)
- GeekNews Markdown: [https://news.hada.io/topic/7881.md](https://news.hada.io/topic/7881.md)
- Type: news
- Author: [xguru](https://news.hada.io/@xguru)
- Published: 2022-11-24T09:41:49+09:00
- Updated: 2022-11-24T09:41:49+09:00
- Original source: [westling.dev](https://westling.dev/b/extremely-linear-git)
- Points: 11
- Comments: 9

## Topic Body

- 첫번째 커밋은 해쉬가 `0000000` 으로 시작하고 두번째는 `0000001` 처럼 늘어나도록 해서 직관적으로 번호가 보이게 관리하는 방식   
- 이런 해쉬 헤더값을 찾기 위해서는 커밋 메시지에 정크 데이터를 넣어서 SHA-1 해쉬를 조정해야함   
- 맥북에서 `githashcrash` 도구를 이용하면 8글자 해쉬헤더의 경우 5분, 6글자인 경우 1초내에 찾을 수 있음  
- `bash-glue`를 이용해서 이걸 `git linearize`라는 이름으로 자동화 시킴   
- `lucky-commit` 을 해쉬 생성 백엔드로 사용해서, GPU를 이용하면 20x 빠르게 생성 가능   
→ lucky-commit 은 정크텍스트가 아닌 안보이는 공백문자를 사용해서 커밋메시지를 수정하므로 보기에도 나쁘지 않음

## Comments



### Comment 13452

- Author: edunga1
- Created: 2022-11-24T17:03:20+09:00
- Points: 1

재밌네요 ㅋㅋ 앞 8자리면 정크 데이터가 길지도 않네요.

### Comment 13449

- Author: bbulbum
- Created: 2022-11-24T14:33:47+09:00
- Points: 1

ㅋㅋㅋㅋ... 리누스가 보면 뭐라고할지 너무 궁금한..

### Comment 13444

- Author: ruinnel
- Created: 2022-11-24T10:34:21+09:00
- Points: 1

블록체인 nonce 값 계산하는거랑 뭔가....

### Comment 13443

- Author: kallare
- Created: 2022-11-24T10:33:27+09:00
- Points: 2

그냥 svn을 쓰면 리비전 번호가 깔끔하게 쌓일텐데......

### Comment 13440

- Author: mse9000
- Created: 2022-11-24T09:56:20+09:00
- Points: 1

외람되지만 첫 번째가 0000000라면 두번째는 0000001이 아닐까요? 오타가 나신것 같습니다ㅋㅋ..

### Comment 13441

- Author: xguru
- Created: 2022-11-24T09:57:52+09:00
- Points: 1
- Parent comment: 13440
- Depth: 1

윽 ㅎㅎ 수정해두었습니다.

### Comment 13438

- Author: nicewook
- Created: 2022-11-24T09:45:30+09:00
- Points: 1

결벽증이 느껴질 정도네요.   
그래도 아이디어를 떠올리고 실행에 옮기신게 대단합니다.   
단순 brute-force 이려나요

### Comment 13439

- Author: kandk
- Created: 2022-11-24T09:55:23+09:00
- Points: 1
- Parent comment: 13438
- Depth: 1

비트코인 채굴 방식이네요 ㅋㅋ

### Comment 13446

- Author: galadbran
- Created: 2022-11-24T10:58:21+09:00
- Points: 1
- Parent comment: 13439
- Depth: 2

github 을 거래소로 !
