SLIDE 1 Versions all the way down
Versioning commits and patches with git-series Josh Triplett josh@joshtriplett.org LinuxCon North America 2016
SLIDE 2
SLIDE 3
RFC: feature
SLIDE 4
RFC: feature
SLIDE 5
Development
SLIDE 6
git commit
SLIDE 7
git format-patch -3
SLIDE 8
git format-patch -3
[PATCH 1/3] Cleanup and yak shaving [PATCH 2/3] Implement feature [PATCH 3/3] Use feature
SLIDE 9
git request-pull ...
SLIDE 10
git request-pull ... git hub pull new ...
SLIDE 11
Feedback
Split cleanup and yak shaving
SLIDE 12
Feedback
Split cleanup and yak shaving Additional use of feature
SLIDE 13
Feedback
Split cleanup and yak shaving Additional use of feature Add benchmark data
SLIDE 14
Feedback
Split cleanup and yak shaving Additional use of feature Add benchmark data Add tests
SLIDE 15
Feedback
Split cleanup and yak shaving Additional use of feature Add benchmark data Add tests Fix typo
SLIDE 16
Rewriting history
SLIDE 17
git commit --amend
SLIDE 18
git rebase -i
SLIDE 19
“fast-forward” vs “non-fast-forward”
SLIDE 20
git format-patch -v2 -6
SLIDE 21
git format-patch -v2 -6
[PATCH v2 1/6] Cleanup [PATCH v2 2/6] Yak shaving [PATCH v2 3/6] Implement feature [PATCH v2 4/6] Tests for feature [PATCH v2 5/6] Use feature [PATCH v2 6/6] Use feature elsewhere
SLIDE 22
What about v1?
SLIDE 23
git reflog
SLIDE 24
mutt -f =Sent
SLIDE 25
Public mailing list archives
SLIDE 26
Git tracks history
SLIDE 27
We rewrite history
SLIDE 28
We need the history of history
SLIDE 29
git submodule
SLIDE 30 git submodule --
SLIDE 31
Two common solutions
SLIDE 32
Two common solutions Pull one of the histories out of git
SLIDE 33
Pull the patches out of git
SLIDE 34
quilt patch files
SLIDE 35
debian/patches/*
SLIDE 36
git rebase -i
SLIDE 37
Pull the history of the patches out of git
SLIDE 38
Versioned branch names
SLIDE 39
feature-v1
SLIDE 40
feature-v1 feature-v2
SLIDE 41
feature-v1 feature-v2 feature-v3-typofix
SLIDE 42
feature-v1 feature-v2 feature-v3-typofix feature-v8-rebased-4.6-alice-fix
SLIDE 43
feature-v1 feature-v2 feature-v3-typofix feature-v8-rebased-4.6-alice-fix feature-v8-rebased-4.6-alice-fix.pptx
SLIDE 44
We have a version control system!
SLIDE 45
Cover letter
SLIDE 46
Cover letter
[PATCH v2 0/5] feature: summary of new idea
SLIDE 47
Base
SLIDE 48
Base git format-patch -3 git format-patch -v2 -6
SLIDE 49
Base git format-patch -3 git format-patch -v2 -6 git rebase -i ...
SLIDE 50
Base git format-patch -3 git format-patch -v2 -6 git rebase -i ... git log
SLIDE 51
Collaboration
SLIDE 52
“Never rewrite published history”
SLIDE 53
How can you collaborate on it?
SLIDE 54
Patch series
SLIDE 55
Patch series Feature backport
SLIDE 56
Patch series Feature backport Distribution package
SLIDE 57
git-series
SLIDE 58
git-series
Tracks the history of a patch series
SLIDE 59
git-series
Tracks the history of a patch series Handles non-fast-forwarding changes
SLIDE 60
git-series
Tracks the history of a patch series Handles non-fast-forwarding changes Tracks a cover letter
SLIDE 61
git-series
Tracks the history of a patch series Handles non-fast-forwarding changes Tracks a cover letter Tracks the base of the series
SLIDE 62
Demo
SLIDE 63
Internals
SLIDE 64 Internals INTERNALS.md
https://github.com/git-series/git-series/blob/master/INTERNALS.md
SLIDE 65
Review of git internals
SLIDE 66
Review of git internals
blob (file)
SLIDE 67
Review of git internals
blob (file) tree (directory)
SLIDE 68
Review of git internals
blob (file) tree (directory) commit (tree, message, parents)
SLIDE 69
Review of git internals
blob (file) tree (directory) commit (tree, message, parents) tag
SLIDE 70
Review of git internals
blob (file) tree (directory) commit (tree, message, parents) tag ref
SLIDE 71
trees can refer to commits
SLIDE 72
trees can refer to commits “gitlink”
SLIDE 73
Requirement: Every object must remain reachable by git.
SLIDE 74
Requirement: Every object must remain reachable by git. Required to keep git from pruning objects Required for push/pull of series
SLIDE 75 upstream x upstream y v1 b v1 a v2 b v2 a
SLIDE 76 upstream x upstream y v1 b v1 a v2 b v2 a series v1 series v2
SLIDE 77 upstream x upstream y v1 b v1 a v2 b v2 a series v1 series v2 refs/heads/git-series/feature
SLIDE 78 upstream x upstream y v1 b v1 a v2 b v2 a series v1 series v2 refs/heads/git-series/feature series
SLIDE 79 upstream x upstream y v1 b v1 a v2 b v2 a series v1 series v2 refs/heads/git-series/feature series base
SLIDE 80 upstream x upstream y v1 b v1 a v2 b v2 a series v1 series v2 refs/heads/git-series/feature series base series
SLIDE 81 upstream x upstream y v1 b v1 a v2 b v2 a series v1 series v2 refs/heads/git-series/feature series base series base
SLIDE 82 upstream x upstream y v1 b v1 a v2 b v2 a series v1 series v2 refs/heads/git-series/feature series base series base cover letter blob cover
SLIDE 83
git doesn’t follow gitlinks for reachability or push/pull
SLIDE 84
git doesn’t follow gitlinks for reachability or push/pull Have to also include “series” as a parent
SLIDE 85
git doesn’t follow gitlinks for reachability or push/pull Have to also include “series” as a parent git-series ignores that parent when traversing
SLIDE 86
HEAD → Current branch
SLIDE 87
HEAD → Current branch refs/SHEAD → Current series
SLIDE 88
Working and staged (as seen in status)?
SLIDE 89
Working and staged (as seen in status)? refs/git-series-internals/working/feature refs/git-series-internals/staged/feature
SLIDE 90
Avoiding errors
SLIDE 91
Long and complex error messages
SLIDE 92
Long and complex error messages suggest a design flaw
SLIDE 93
Long and complex error messages suggest a design flaw Redesign to make the error impossible
SLIDE 94
Detach from a series or check out a new series with uncommitted changes to the series (series, base, cover)
SLIDE 95
Detach from a series or check out a new series with uncommitted changes to the series (series, base, cover) Every series has its own independent working and staged versions
SLIDE 96
Detach from a series or check out a new series without making any commits
SLIDE 97
Detach from a series or check out a new series without making any commits git series start makes working/staged
SLIDE 98
Detach from a series or check out a new series without making any commits git series start makes working/staged “(new, no commits yet)”
SLIDE 99
Detach from a series or check out a new series without making any commits git series start makes working/staged “(new, no commits yet)” git series checkout works
SLIDE 100
Long and complex error messages suggest a design flaw Redesign to make the error impossible
SLIDE 101
git series rebase
SLIDE 102
git series rebase git rebase --continue
SLIDE 103
Rust and libgit2
SLIDE 104
https://github.com/git-series/git-series
SLIDE 105
https://github.com/git-series/git-series Questions?