Git journey from mars to neon EclipseCon North America - 2016-03-08
Transcript of Git journey from mars to neon EclipseCon North America - 2016-03-08
![Page 1: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/1.jpg)
Git Journey from Mars to Neon
Matthias Sohn (SAP)
![Page 2: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/2.jpg)
hookssupport
JGit
● pre-commit (4.0)● commit-msg (4.0)● pre-push (4.2)
![Page 3: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/3.jpg)
pre-commitcommit-msgpre-push
Hooks
![Page 4: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/4.jpg)
merge strategy extension point
JGit 4.0
● allows to plugin external merge strategy
● implemented by EMF Compare to provide model merge strategy
![Page 5: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/5.jpg)
EMF Compare provides model merge strategy
Computes the logical model for each version
Compares / merges complete logical model
![Page 6: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/6.jpg)
e4 smartproject import
wizardEGit 4.0
● clone repository● invoke e4 smart project import● auto-detects projects and their
project types
wiki e4 smart import
![Page 7: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/7.jpg)
e4 smart project import
![Page 8: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/8.jpg)
Staging ViewEGit
● block commit on errors (4.1)● compare mode (4.1)● better support non-workspace
files (4.2)● enable sorting files by status (4.3)
![Page 9: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/9.jpg)
Warn/block commit on errors
![Page 10: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/10.jpg)
Compare Mode in Staging View
![Page 11: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/11.jpg)
Better support non-workspace files
![Page 12: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/12.jpg)
Sorting files by status
![Page 13: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/13.jpg)
Misc Improvements
EGit
● dirty decorator in repositories view● most git actions enabled on
working sets● configure date format● branch auto-selection in history view● enable symlinked .git● support symlinks in compare editor
![Page 14: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/14.jpg)
dirty decorator in repositories view
![Page 15: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/15.jpg)
enable most git actions onworking sets
![Page 16: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/16.jpg)
configure date format
![Page 17: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/17.jpg)
Gerrit integration
EGit 4.3
● auto-configure repository cloned from Gerrit
● improved "Fetch from Gerrit" wizard● "Commit and push" opens "Push to
Gerrit" wizard
![Page 18: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/18.jpg)
Gitflow supportEGit
● Automation for gitflow branching strategy and workflow
● Install EGit Gitflow feature if you want to use this
![Page 19: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/19.jpg)
Gitflow in a nutshell
“It forms an elegant mental model that is easy to comprehend and allows team members to develop a shared understanding of the branching and releasing processes.”
- Vincent Driessen
(creator of Gitflow)
Author: Vincent DriessenOriginal blog post: http://nvie.com/posts/a-succesful-git-branching-modelLicense: Creative Commons BY-SA
![Page 20: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/20.jpg)
Gitflow integration - initialize
![Page 21: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/21.jpg)
Gitflow integration - create feature branch
![Page 22: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/22.jpg)
Gitflow integration - finish feature
![Page 23: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/23.jpg)
.gitattributesJGit 4.3
fixes most wanted JGit bug (108 votes)
● filter attributes (4.2)● text attributes● eol attributes● macros
![Page 24: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/24.jpg)
LFSLarge File Storage
JGit, EGit 4.3
● integrate git-lfs extension in client (4.2)● basic JGit LFS server (file system or S3)● Gerrit plugins integrating JGit LFS
server
![Page 25: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/25.jpg)
Versioning large binaries in Git
large binary files can't be packed by Git efficiently
➔ Git repository growing quickly➔ gc more expensive and less efficient➔ slows down transport➔ Git server load grows
![Page 26: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/26.jpg)
.gitattributesslides.pdfX.java
Large File Storage (LFS) extension
.git-- objects
-- lfs
git server
lfs server
git
git-lfs
![Page 27: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/27.jpg)
.gitattributesslides.pdfX.java
LFS configuration
.gitattributes*.pdf filter=lfs diff=lfs merge=lfs -text.gitconfig
[filter "lfs"]clean = git-lfs clean %fsmudge = git-lfs smudge %f
which files to store in LFS ?
lfs clean filter intercepts add
lfs smudge filter intercepts checkout
.git-- config-- objects
-- lfs
![Page 28: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/28.jpg)
.gitattributesslides.pdfX.java
git add slides.pdf
version git-lfs/spec/v1id sha256:5891b5b522...size 6
store meta data in objectsstore big file in lfs objects
lfs clean filter
slides.pdf
.git-- objects
-- lfs
![Page 29: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/29.jpg)
.gitattributesslides.pdfX.java
git push origin
git server
lfs server
pre-push hook
version git-lfs/spec/v1id sha256:5891b5b522...size 6
push
slides.pdf
.git-- objects
-- lfs
![Page 30: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/30.jpg)
.gitattributesslides.pdfX.java
git fetch/clone, git checkout
git server
lfs server
version git-lfs/spec/v1id sha256:5891b5b522...size 6
fetch
checkoutdownloads large object lazily
slides.pdf
lfs smudge filter
.git-- objects
-- lfs
![Page 31: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/31.jpg)
EGit
Gerrit.gitattributesslides.pdfX.java
LFS server with JGit filesystem/S3 storage
JGit
git-lfs
Gerrit plugin
LFS storage(filesystem
/ S3)
.git-- objects
JGit LFS server
.git-- objects
-- lfs
![Page 32: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/32.jpg)
Practical workflows with Git LFS
Tim Pettersen (Atlassian)Lake Anne A
Wednesday - 10:30 to 11:05https://www.eclipsecon.org/na2016/session/practical-workflows-git-lfs
![Page 33: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/33.jpg)
The quest for distributed JGit
JGit
RefTree (4.2)
● enable atomic push● version refs as git objects● push = commit containing ref updates
Ketch
● enable distributed JGit server● Raft distributed consensus● distributed transaction log based on
RefTree
![Page 34: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/34.jpg)
RefTree: Versioning branches in git
store refs in git tree objects
push can update many refs -> stored in one RefTree commit
-> enable transactional ref updates when receiving a pack-> compare single SHA1 to compare repository states
![Page 35: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/35.jpg)
jgitclone with worktreestandard refs
jgit.gitbare repositoryrefs stored in RefTree
bootstrap branch symlinkedobjects linked via alternates
commit,push bootstrap
branchbootstrap branch
RefTreeVersions
symlink
objects alternatesobjects
spyempty, used for introspection
![Page 36: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/36.jpg)
Ketch: multi-master git repository
● leader election (Raft)leader
![Page 37: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/37.jpg)
Ketch: multi-master git repository
● leader election (Raft)● push arrives on any server
push
leader
![Page 38: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/38.jpg)
Ketch: multi-master git repository
● leader election (Raft)● push arrives on any server● queue proposal to leader● leader creates new RefTree
describing target state
push
queue proposal RefTree
leader
![Page 39: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/39.jpg)
Ketch: multi-master git repository
● leader election (Raft)● push arrives on any server● queue proposal to leader● leader creates new RefTree
describing target state● replicate objects and RefTree
to majority of serverspush
queue proposal RefTree
RefTree
leader
![Page 40: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/40.jpg)
Ketch: multi-master git repository
● leader election (Raft)● push arrives on any server● queue proposal to leader● leader creates new RefTree
describing target state● replicate objects and RefTree
to majority of serverspush
queue proposal RefTree
RefTreeRefTree
leader
![Page 41: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/41.jpg)
Ketch: multi-master git repository
● leader election (Raft)● push arrives on any server● queue proposal to leader● leader creates new RefTree
describing target state● replicate objects and RefTree
to majority of servers● commit transaction
ackack
RefTree
RefTreeRefTree
leader
![Page 42: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/42.jpg)
Questions & Answers
![Page 43: Git journey from mars to neon EclipseCon North America - 2016-03-08](https://reader031.fdocuments.in/reader031/viewer/2022030118/589fd6431a28abf06d8b5e7d/html5/thumbnails/43.jpg)
Evaluate the Sessions
Sign in and vote at eclipsecon.org
- 1 + 10