-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: sketch for git graph node types #13
Conversation
export type CommitRaw = { | ||
id: string, | ||
parents: string[], | ||
message: string, | ||
author: string, | ||
authorDate: string, | ||
committer: string, | ||
date: string, | ||
tags: string[], | ||
branches: string[], | ||
|
||
// fill necessary properties... | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
�요 type은 콘솔에 찍히는 commit log를 그대로 표현하려고 해봤습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
소스코드에 커멘트를 남겼으니 참고해주시고,
이건 말그대로 "스케치" 이니, 실제 구현에 따라서 바꾸면 되겠습니다.
- directory 구조가 결정되면 그곳으로 옮기거나, 새로 만들어 주는게 좋겠고,
- 추후에 engine은 이 type들을 외부로 export하고,
- view는 type만 import해서 쓰면 되겠습니다.
parents: Commit[], | ||
author: GitHubUser, | ||
committer: GitHubUser, | ||
authorDate: Date, | ||
commitDate: Date, | ||
diffStatistics: DiffStatistics, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CommitRaw의 primitive type들을 객체 형태로 바꾼 거라고 봐도 될 것 같습니다.
export type NodeTypeName = typeof NODE_TYPE_NAME[number]; | ||
|
||
export type NodeBase = { | ||
nodeTypeName: NodeTypeName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여긴 나중에 node type별로 분기를 탈 일이 있을까봐 일단 선언해봤습니다.
hasMajorTag: boolean, | ||
hasMinorTag: boolean, | ||
isMergeCommit: boolean, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
node에는 log에서 가져온 commit이라는 객체 외에
우리가 분석하는 과정, 분석한 후에 사용될 properties를 담는 곳이라고 보면 되겠습니다.
export type ClusterNode = NodeBase & { | ||
nodeTypeName: 'CLUSTR', | ||
commitNodeList: CommitNode[], | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commit들을 묶을 놈인데, 이게
- PR이 될 수도 있고.
- CSM이 된 node가 될 수도 있고,
- 유사도에 따라 묶은 cluster가 될 수도 있을 것 같습니다.
이름이 별로 안 이�쁘긴 하네요 ㅜ.ㅜ
@@ -0,0 +1,7 @@ | |||
import { NodeType } from "./NodeTypes.temp" | |||
|
|||
export type ViewNode = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
엔진에서 만든 node를 감싸서 view에서 사용될 정보들을 모아놓은 곳입니다.
githru(org) 에서는 상대적 x,y 위치나, 절대적 좌표 등등의 정보들이 다 들어갔는데, 이번에도 그런 rendering정보들을 넣으면 될 것 같습니다.
parents: string[], | ||
message: string, | ||
author: string, | ||
authorDate: string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이름이 왜 commitDate이 아니라 authorDate인가 해서 찾아봤는데, 둘 다 기록되는 값이고 두가지가 다르게 쓰이네요!
참고: stackoverflow, Git book
- authorDate => 커밋이 만들어진 시간, 변경되지 않음
- commitDate => 커밋에 대한 작업이 마지막으로 적용된 시간, 변경될 수 있음 (ex. rebase, cherry-pick 등등)
- author => 커밋을 생성한 오리지널 작업자
- committer => 커밋에 영향을 주는 작업을 한 작업자
새로 알게되어서 기록 겸 코멘트로 남겨요 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
와우 날카로우시네요!!
명확한게 어떻다.. 이런건 저도 까먹고 있었는데;; 😄
정리 잘해주셔서 감사합니다!!!
저게 signed-off-by랑 엉켜서
가능하시면, 해당 부분을 어딘가에 정보 처럼 저장해놓는것도 괜찮을 것 같습니다.
Reference in new Issue로 열어주셔도 검색하기 편할 것 같네요. (아무나 해주셔요 ㅎㅎㅎ)
Git Graph Node Type들에 대한 약간의 스케치를 올립니다.
구조에 관련된 토의/질문/토론 환영합니다. 리뷰에 남겨주세요!