Slide 1

Slide 1 text

GIT NOTES & GITHUB

Slide 2

Slide 2 text

GIT NOTES & GITHUB A Parallel Message Set

Slide 3

Slide 3 text

Notes

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

• Object pointing to a commit • Supplemental to commit messages • Namespaced for grouping of notes

Slide 6

Slide 6 text

• Object pointing to a commit • Supplemental to commit messages • Namespaced for grouping of notes

Slide 7

Slide 7 text

• Object pointing to a commit • Supplemental to commit messages • Namespaced for grouping of notes

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

— Git notes man page A typical use of notes is to supplement a commit message without changing the commit itself.

Slide 10

Slide 10 text

The Basics

Slide 11

Slide 11 text

GIT-NOTES(1) Git Manual GIT-NOTES(1) NAME git-notes - Add or inspect object notes SYNOPSIS git notes [list []] git notes add [-f] [-F | -m | (-c | -C) ] [] git notes copy [-f] ( --stdin | ) git notes append [-F | -m | (-c | -C) ] [] git notes edit [] git notes show [] git notes merge [-v | -q] [-s ] git notes merge --commit [-v | -q] git notes merge --abort [-v | -q] git notes remove [--ignore-missing] [--stdin] [...] git notes prune [-n | -v] git notes get-ref

Slide 12

Slide 12 text

GIT-NOTES(1) Git Manual GIT-NOTES(1) NAME git-notes - Add or inspect object notes SYNOPSIS git notes [list []] git notes add [-f] [-F | -m | (-c | -C) ] [] git notes copy [-f] ( --stdin | ) git notes append [-F | -m | (-c | -C) ] [] git notes edit [] git notes show [] git notes merge [-v | -q] [-s ] git notes merge --commit [-v | -q] git notes merge --abort [-v | -q] git notes remove [--ignore-missing] [--stdin] [...] git notes prune [-n | -v] git notes get-ref

Slide 13

Slide 13 text

Create a note

Slide 14

Slide 14 text

$ git notes add -m””

Slide 15

Slide 15 text

Video

Slide 16

Slide 16 text

Examine the directory structure

Slide 17

Slide 17 text

$ tree .git/refs/notes

Slide 18

Slide 18 text

Video

Slide 19

Slide 19 text

Displaying notes

Slide 20

Slide 20 text

$ git notes show

Slide 21

Slide 21 text

Video

Slide 22

Slide 22 text

$ git log

Slide 23

Slide 23 text

Video

Slide 24

Slide 24 text

Namespacing

Slide 25

Slide 25 text

Default namespace is commits

Slide 26

Slide 26 text

$ git notes --ref add -m””

Slide 27

Slide 27 text

Video

Slide 28

Slide 28 text

Viewing a different namespace

Slide 29

Slide 29 text

$ git notes --ref jenkins show

Slide 30

Slide 30 text

Video

Slide 31

Slide 31 text

$ git log --show-notes=jenkins

Slide 32

Slide 32 text

Video

Slide 33

Slide 33 text

$ git log --show-notes=*

Slide 34

Slide 34 text

Video

Slide 35

Slide 35 text

Pushing

Slide 36

Slide 36 text

Notes don’t push by default

Slide 37

Slide 37 text

git push origin refs/notes/commits // or git push origin refs/notes/jenkins // or git push origin refs/notes/*

Slide 38

Slide 38 text

Video

Slide 39

Slide 39 text

$ git config --global alias.pushnotes "\!sh -c 'git push \$1 refs/notes/*' -" $ git pushnotes origin

Slide 40

Slide 40 text

Fetching

Slide 41

Slide 41 text

Notes don’t fetch by default

Slide 42

Slide 42 text

$ git fetch origin refs/notes/commits:refs/notes/commits // or $ git fetch origin refs/notes/jenkins:refs/notes/jenkins // or $ git fetch origin refs/notes/*:refs/notes/*

Slide 43

Slide 43 text

Video

Slide 44

Slide 44 text

$ git config --global alias.fetchnotes\ "\!sh -c 'git fetch \$1 refs/notes/*:refs/notes/*' -"

Slide 45

Slide 45 text

$ vim .git/config ...and edit [remote ”origin”] fetch = +refs/heads/*:refs/remotes/origin/* ...to be [remote ”origin”] fetch = +refs/heads/*:refs/remotes/origin/* fetch = +refs/notes/*:refs/notes/*

Slide 46

Slide 46 text

GitHub

Slide 47

Slide 47 text

Notes are shown with commits

Slide 48

Slide 48 text

Video

Slide 49

Slide 49 text

More?

Slide 50

Slide 50 text

Notes can be appended

Slide 51

Slide 51 text

GIT-NOTES(1) Git Manual GIT-NOTES(1) NAME git-notes - Add or inspect object notes SYNOPSIS git notes [list []] git notes add [-f] [-F | -m | (-c | -C) ] [] git notes copy [-f] ( --stdin | ) git notes append [-F | -m | (-c | -C) ] [] git notes edit [] git notes show [] git notes merge [-v | -q] [-s ] git notes merge --commit [-v | -q] git notes merge --abort [-v | -q] git notes remove [--ignore-missing] [--stdin] [...] git notes prune [-n | -v] git notes get-ref

Slide 52

Slide 52 text

GIT-NOTES(1) Git Manual GIT-NOTES(1) NAME git-notes - Add or inspect object notes SYNOPSIS git notes [list []] git notes add [-f] [-F | -m | (-c | -C) ] [] git notes copy [-f] ( --stdin | ) git notes append [-F | -m | (-c | -C) ] [] git notes edit [] git notes show [] git notes merge [-v | -q] [-s ] git notes merge --commit [-v | -q] git notes merge --abort [-v | -q] git notes remove [--ignore-missing] [--stdin] [...] git notes prune [-n | -v] git notes get-ref

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

Notes can be merged

Slide 55

Slide 55 text

GIT-NOTES(1) Git Manual GIT-NOTES(1) NAME git-notes - Add or inspect object notes SYNOPSIS git notes [list []] git notes add [-f] [-F | -m | (-c | -C) ] [] git notes copy [-f] ( --stdin | ) git notes append [-F | -m | (-c | -C) ] [] git notes edit [] git notes show [] git notes merge [-v | -q] [-s ] git notes merge --commit [-v | -q] git notes merge --abort [-v | -q] git notes remove [--ignore-missing] [--stdin] [...] git notes prune [-n | -v] git notes get-ref

Slide 56

Slide 56 text

GIT-NOTES(1) Git Manual GIT-NOTES(1) NAME git-notes - Add or inspect object notes SYNOPSIS git notes [list []] git notes add [-f] [-F | -m | (-c | -C) ] [] git notes copy [-f] ( --stdin | ) git notes append [-F | -m | (-c | -C) ] [] git notes edit [] git notes show [] git notes merge [-v | -q] [-s ] git notes merge --commit [-v | -q] git notes merge --abort [-v | -q] git notes remove [--ignore-missing] [--stdin] [...] git notes prune [-n | -v] git notes get-ref

Slide 57

Slide 57 text

No content

Slide 58

Slide 58 text

Notes can be removed

Slide 59

Slide 59 text

GIT-NOTES(1) Git Manual GIT-NOTES(1) NAME git-notes - Add or inspect object notes SYNOPSIS git notes [list []] git notes add [-f] [-F | -m | (-c | -C) ] [] git notes copy [-f] ( --stdin | ) git notes append [-F | -m | (-c | -C) ] [] git notes edit [] git notes show [] git notes merge [-v | -q] [-s ] git notes merge --commit [-v | -q] git notes merge --abort [-v | -q] git notes remove [--ignore-missing] [--stdin] [...] git notes prune [-n | -v] git notes get-ref

Slide 60

Slide 60 text

GIT-NOTES(1) Git Manual GIT-NOTES(1) NAME git-notes - Add or inspect object notes SYNOPSIS git notes [list []] git notes add [-f] [-F | -m | (-c | -C) ] [] git notes copy [-f] ( --stdin | ) git notes append [-F | -m | (-c | -C) ] [] git notes edit [] git notes show [] git notes merge [-v | -q] [-s ] git notes merge --commit [-v | -q] git notes merge --abort [-v | -q] git notes remove [--ignore-missing] [--stdin] [...] git notes prune [-n | -v] git notes get-ref

Slide 61

Slide 61 text

Resources

Slide 62

Slide 62 text

http://progit.org/2010/08/25/notes.html

Slide 63

Slide 63 text

https://github.com/blog/707-git-notes-display

Slide 64

Slide 64 text

Useful?

Slide 65

Slide 65 text

No content

Slide 66

Slide 66 text

GIT NOTES & GITHUB A Parallel Message Set