Versions all the way down Versioning commits and patches with - - PowerPoint PPT Presentation

versions all the way down
SMART_READER_LITE
LIVE PREVIEW

Versions all the way down Versioning commits and patches with - - PowerPoint PPT Presentation

Versions all the way down Versioning commits and patches with git-series Josh Triplett josh@joshtriplett.org LinuxCon North America 2016 RFC: feature RFC: feature Development git commit git format-patch -3 git format-patch -3 [PATCH 1/3]


slide-1
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 2
slide-3
SLIDE 3

RFC: feature

slide-4
SLIDE 4

RFC: feature

slide-5
SLIDE 5

Development

slide-6
SLIDE 6

git commit

slide-7
SLIDE 7

git format-patch -3

slide-8
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
SLIDE 9

git request-pull ...

slide-10
SLIDE 10

git request-pull ... git hub pull new ...

slide-11
SLIDE 11

Feedback

Split cleanup and yak shaving

slide-12
SLIDE 12

Feedback

Split cleanup and yak shaving Additional use of feature

slide-13
SLIDE 13

Feedback

Split cleanup and yak shaving Additional use of feature Add benchmark data

slide-14
SLIDE 14

Feedback

Split cleanup and yak shaving Additional use of feature Add benchmark data Add tests

slide-15
SLIDE 15

Feedback

Split cleanup and yak shaving Additional use of feature Add benchmark data Add tests Fix typo

slide-16
SLIDE 16

Rewriting history

slide-17
SLIDE 17

git commit --amend

slide-18
SLIDE 18

git rebase -i

slide-19
SLIDE 19

“fast-forward” vs “non-fast-forward”

slide-20
SLIDE 20

git format-patch -v2 -6

slide-21
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
SLIDE 22

What about v1?

slide-23
SLIDE 23

git reflog

slide-24
SLIDE 24

mutt -f =Sent

slide-25
SLIDE 25

Public mailing list archives

slide-26
SLIDE 26

Git tracks history

slide-27
SLIDE 27

We rewrite history

slide-28
SLIDE 28

We need the history of history

slide-29
SLIDE 29

git submodule

slide-30
SLIDE 30

git submodule --

  • -fthagn
slide-31
SLIDE 31

Two common solutions

slide-32
SLIDE 32

Two common solutions Pull one of the histories out of git

slide-33
SLIDE 33

Pull the patches out of git

slide-34
SLIDE 34

quilt patch files

slide-35
SLIDE 35

debian/patches/*

slide-36
SLIDE 36

git rebase -i

slide-37
SLIDE 37

Pull the history of the patches out of git

slide-38
SLIDE 38

Versioned branch names

slide-39
SLIDE 39

feature-v1

slide-40
SLIDE 40

feature-v1 feature-v2

slide-41
SLIDE 41

feature-v1 feature-v2 feature-v3-typofix

slide-42
SLIDE 42

feature-v1 feature-v2 feature-v3-typofix feature-v8-rebased-4.6-alice-fix

slide-43
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
SLIDE 44

We have a version control system!

slide-45
SLIDE 45

Cover letter

slide-46
SLIDE 46

Cover letter

[PATCH v2 0/5] feature: summary of new idea

slide-47
SLIDE 47

Base

slide-48
SLIDE 48

Base git format-patch -3 git format-patch -v2 -6

slide-49
SLIDE 49

Base git format-patch -3 git format-patch -v2 -6 git rebase -i ...

slide-50
SLIDE 50

Base git format-patch -3 git format-patch -v2 -6 git rebase -i ... git log

slide-51
SLIDE 51

Collaboration

slide-52
SLIDE 52

“Never rewrite published history”

slide-53
SLIDE 53

How can you collaborate on it?

slide-54
SLIDE 54

Patch series

slide-55
SLIDE 55

Patch series Feature backport

slide-56
SLIDE 56

Patch series Feature backport Distribution package

slide-57
SLIDE 57

git-series

slide-58
SLIDE 58

git-series

Tracks the history of a patch series

slide-59
SLIDE 59

git-series

Tracks the history of a patch series Handles non-fast-forwarding changes

slide-60
SLIDE 60

git-series

Tracks the history of a patch series Handles non-fast-forwarding changes Tracks a cover letter

slide-61
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
SLIDE 62

Demo

slide-63
SLIDE 63

Internals

slide-64
SLIDE 64

Internals INTERNALS.md

https://github.com/git-series/git-series/blob/master/INTERNALS.md

slide-65
SLIDE 65

Review of git internals

slide-66
SLIDE 66

Review of git internals

blob (file)

slide-67
SLIDE 67

Review of git internals

blob (file) tree (directory)

slide-68
SLIDE 68

Review of git internals

blob (file) tree (directory) commit (tree, message, parents)

slide-69
SLIDE 69

Review of git internals

blob (file) tree (directory) commit (tree, message, parents) tag

slide-70
SLIDE 70

Review of git internals

blob (file) tree (directory) commit (tree, message, parents) tag ref

slide-71
SLIDE 71

trees can refer to commits

slide-72
SLIDE 72

trees can refer to commits “gitlink”

slide-73
SLIDE 73

Requirement: Every object must remain reachable by git.

slide-74
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
SLIDE 75

upstream x upstream y v1 b v1 a v2 b v2 a

slide-76
SLIDE 76

upstream x upstream y v1 b v1 a v2 b v2 a series v1 series v2

slide-77
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
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
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
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
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
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
SLIDE 83

git doesn’t follow gitlinks for reachability or push/pull

slide-84
SLIDE 84

git doesn’t follow gitlinks for reachability or push/pull Have to also include “series” as a parent

slide-85
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
SLIDE 86

HEAD → Current branch

slide-87
SLIDE 87

HEAD → Current branch refs/SHEAD → Current series

slide-88
SLIDE 88

Working and staged (as seen in status)?

slide-89
SLIDE 89

Working and staged (as seen in status)? refs/git-series-internals/working/feature refs/git-series-internals/staged/feature

slide-90
SLIDE 90

Avoiding errors

slide-91
SLIDE 91

Long and complex error messages

slide-92
SLIDE 92

Long and complex error messages suggest a design flaw

slide-93
SLIDE 93

Long and complex error messages suggest a design flaw Redesign to make the error impossible

slide-94
SLIDE 94

Detach from a series or check out a new series with uncommitted changes to the series (series, base, cover)

slide-95
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
SLIDE 96

Detach from a series or check out a new series without making any commits

slide-97
SLIDE 97

Detach from a series or check out a new series without making any commits git series start makes working/staged

slide-98
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
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
SLIDE 100

Long and complex error messages suggest a design flaw Redesign to make the error impossible

slide-101
SLIDE 101

git series rebase

slide-102
SLIDE 102

git series rebase git rebase --continue

slide-103
SLIDE 103

Rust and libgit2

slide-104
SLIDE 104

https://github.com/git-series/git-series

slide-105
SLIDE 105

https://github.com/git-series/git-series Questions?