forked from performancecopilot/pcp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.github
89 lines (64 loc) · 3.29 KB
/
README.github
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
A Possible github Workflow
--------------------------
These notes describe how Ken does development and integration with
the PCP repos on github.
It may work for others, or perhaps someone with a deeper knowledge
of git and github can suggest a better way.
First, a long time ago, I forked https://github.com/performancecopilot/pcp
on github to make my PCP tree at https://github.com/kmcdonell/pcp.
Then on my main local machine (bozo) I cloned my github PCP tree into
~kenj/src/pcp and this is where all my development and git commits
are done [actually there is another machine bozo-vm that is sort of
a mirror of bozo, but that's not relevant for this discussion].
And finally a cloned my github PCP tree to make a bare git tree at
~kenj/git-mirror/pcp.git on bozo and all the VMs in the QA Farm git
pull from there (this one is a local git cache to conserve my internet
traffic between my home and github).
So there are 4 repos in play:
[0] https://github.com/performancecopilot/pcp (the official one)
[1] https://github.com/kmcdonell/pcp (my staging area for new commits)
[2] ~kenj/src/pcp on bozo
[3] ~kenj/git-mirror/pcp.git on bozo
Task 1: updating my trees to pull changes from the official PCP repo
--------------------------------------------------------------------
So, we want all the latest commits from [0] included in [1], [2] and
[3].
First we need to pull from [0] into [2], but only if [2] is on the
master branch and contains no commits that have not already been
pushed to [1] and [3]. The script below does this after ensuring
the preconditions are met.
$ scripts/pcp-refresh
Now do Task 2 (below) to push any new commits from [2] to [1] and [3].
Task 2: pushing commits from my staging area into my other repos
----------------------------------------------------------------
Because [2] and [3] drive the QA, I need/want to test changes before
asking others to review and merge. So, I make changes in the master
branch and commit in [2], and then these commits need to be pushed to
[3] and this is done via [1].
$ scripts/pcp-push -m
Push to [email protected]:.../pcp.git master [y|n|q] (or ctrl+C to abort)
[reply y]
the -m is important for pcp-push, because we don't want to do any of
the github pull request steps yet.
Task 3: pushing my commits to the official repo
-----------------------------------------------
First, make sure my repos are up to date, see Task 1 above.
Next make a new branch as the base for a batch of changes.
$ scripts/new-branch
although the new branch <datestamp> has been created, we end up back
on the master branch where all the commits are done.
After some amount of changes, debugging, QA and committing (on the
master branch) we're ready to initiate a github pull request.
$ git checkout <datestamp> # <datestamp> from earlier scripts/new-branch
$ git pull . master
$ scripts/pcp-push
Push to [email protected]:.../pcp.git <datestamp> [y|n|q] (or ctrl+C to abort)
[reply y]
Pull request title: [n|q|title]
[reply with a meaningful title for your pull request]
This will also (silently), update [3] if it exists, checkout the
master branch and delete the <datestamp> branch.
Bells and Whistles
------------------
scripts/pcp-push and scripts/new-branch have a -n option for a dry
run to see what would be done, without changing anything.