Merge lp:~jelmer/ubuntu/precise/etckeeper/tutorial-bzr into lp:ubuntu/precise/etckeeper

Proposed by Jelmer Vernooij
Status: Merged
Merged at revision: 40
Proposed branch: lp:~jelmer/ubuntu/precise/etckeeper/tutorial-bzr
Merge into: lp:ubuntu/precise/etckeeper
Diff against target: 149 lines (+33/-36)
2 files modified
README (+27/-36)
debian/changelog (+6/-0)
To merge this branch: bzr merge lp:~jelmer/ubuntu/precise/etckeeper/tutorial-bzr
Reviewer Review Type Date Requested Status
Colin Watson Approve
Review via email: mp+99165@code.launchpad.net

Description of the change

Change the tutorial to use bzr - which is the default VCS for etckeeper in Ubuntu.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

"You can clone the repository using bzr BRANCH"

Are the all-caps there deliberate?

41. By Jelmer Vernooij

Fix accidental uppercasing of branch command. Thanks, Colin.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

On Mon, Mar 26, 2012 at 01:33:20PM -0000, Colin Watson wrote:
> "You can clone the repository using bzr BRANCH"
>
> Are the all-caps there deliberate?
They weren't, thanks for catching that.

I've pushed a fix to Launchpad.

Cheers,

Jelmer

Revision history for this message
Colin Watson (cjwatson) wrote :

Thanks, looks good to me now.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README'
2--- README 2011-11-25 20:03:36 +0000
3+++ README 2012-03-26 14:09:17 +0000
4@@ -78,10 +78,10 @@
5
6 A quick walkthrough of using etckeeper.
7
8-Note that the default VCS is git, and this tutorial assumes you're using
9+Note that the default VCS is bzr, and this tutorial assumes you're using
10 it. Using other VCSes should be broadly similar.
11
12-The `etckeeper init` command initialises an /etc/.git/ repository.
13+The `etckeeper init` command initialises an /etc/.bzr/ repository.
14 If you installed etckeeper from a package, this was probably automatically
15 performed during the package installation. If not, your first step is to
16 run it by hand:
17@@ -89,50 +89,49 @@
18 etckeeper init
19
20 The `etckeeper init` command is careful to never overwrite existing files
21-or directories in /etc. It will create a `.gitignore` if one doesn't
22+or directories in /etc. It will create a `.bzrignore` if one doesn't
23 already exist (or update content inside a "managed by etckeeper" comment
24 block), sets up pre-commit hooks if they don't already exist, and so on. It
25-does *not* commit any files, but does `git add` all interesting files for
26+does *not* commit any files, but does `bzr add` all interesting files for
27 an initial commit later.
28
29-Now you might want to run `git status` to check that it includes all
30+Now you might want to run `bzr status` to check that it includes all
31 the right files, and none of the wrong files. And you can edit the
32-`.gitignore` and so forth. Once you're ready, it's time to commit:
33+`.bzrignore` and so forth. Once you're ready, it's time to commit:
34
35 cd /etc
36- git status
37- git commit -m "initial checkin"
38- git gc # pack git repo to save a lot of space
39+ bzr status
40+ bzr commit -m "initial checkin"
41
42-After this first commit, you can use regular git commands to handle
43+After this first commit, you can use regular bzr commands to handle
44 further changes:
45
46 passwd someuser
47- git status
48- git commit -a -m "changed a password"
49+ bzr status
50+ bzr commit -m "changed a password"
51
52 Rinse, lather, repeat. You might find that some files are changed by
53-daemons and shouldn't be tracked by git. These can be removed from git:
54+daemons and shouldn't be tracked by bzr. These can be removed from bzr:
55
56- git rm --cached printcap # modified by CUPS
57- echo printcap >> .gitignore
58- git commit -a -m "don't track printcap"
59+ bzr rm printcap # modified by CUPS
60+ echo printcap >> .bzrignore
61+ bzr commit -m "don't track printcap"
62
63 etckeeper hooks into apt (and similar systems) so changes to interesting
64 files in /etc caused by installing or upgrading packages will automatically
65 be committed. Here "interesting" means files that are not ignored by
66-`.gitignore`.
67+`.bzrignore`.
68
69-You can use any git commands you like, but do keep in mind that, if you
70-check out a different branch or an old version, git is operating directly
71+You can use any bzr commands you like, but do keep in mind that, if you
72+check out a different branch or an old version, bzr is operating directly
73 on your system's /etc. If you do decide to check out a branch or tag,
74 make sure you run "etckeeper init" again, to get any metadata changes:
75
76- git checkout april_first_joke_etc
77+ bzr revert april_first_joke_etc
78 etckeeper init
79
80 Often it's better to clone /etc to elsewhere and do potentially dangerous
81-stuff in a staging directory. You can clone the repository using git clone,
82+stuff in a staging directory. You can clone the repository using bzr branch,
83 but be careful that the directory it's cloned into starts out mode 700, to
84 prevent anyone else from seeing files like shadow, before `etckeeper init`
85 fixes their permissions:
86@@ -140,30 +139,27 @@
87 mkdir /my/workdir
88 cd /my/workdir
89 chmod 700 .
90- git clone /etc
91+ bzr branch /etc
92 cd etc
93 etckeeper init -d .
94 chmod 755 ..
95
96 Another common reason to clone the repository is to make a backup to a
97-server. When using git push to create a new remote clone, make sure the new
98+server. When using bzr push to create a new remote clone, make sure the new
99 remote clone is mode 700! (And, obviously, only push over a secure
100 transport like ssh, and only to a server you trust.)
101
102- ssh server 'mkdir /etc-clone; cd /etc-clone; chmod 700 .; git init --bare'
103- git remote add backup ssh://server/etc-clone
104- git push backup --all
105+ ssh server 'bzr init --no-tree /etc-clone; chmod -R 700 /etc-clone'
106+ bzr push bzr+ssh://server/etc-clone
107
108 If you have several machine's using etckeeper, you can start with a
109 etckeeper repository on one machine, then add another machine's etckeeper
110-repository as a git remote. Then you can diff against it, examine its
111+repository. Then you can diff against it, examine its
112 history, merge with it, and so on. It would probably not, however, be wise
113-to "git checkout" the other machine's branch! (And if you do, make sure to
114+to "bzr checkout" the other machine's branch! (And if you do, make sure to
115 run "etckeeper init" to update file permissions.)
116
117- root@kodama:/etc>git remote add dodo ssh://dodo/etc
118- root@kodama:/etc>git fetch dodo
119- root@kodama:/etc>git diff dodo/master group |head
120+ root@kodama:/etc>bzr diff -rbranch:bzr+ssh://dodo/etc | head
121 diff --git a/group b/group
122 index 0242b84..b5e4384 100644
123 --- a/group
124@@ -175,11 +171,6 @@
125 -lp:x:7:cupsys
126 +lp:x:7:
127
128-Incidentially, this also means I have a backup of dodo's /etc on kodama.
129-So if kodama is compromised, that data could be used to attack dodo
130-too. On the other hand, if dodo's disk dies, I can restore it from this
131-handy hackup.
132-
133 Of course, it's also possible to pull changes from a server onto client
134 machines, to deploy changes to /etc. Once /etc is under version control, the
135 sky's the limit..
136
137=== modified file 'debian/changelog'
138--- debian/changelog 2012-02-06 07:49:28 +0000
139+++ debian/changelog 2012-03-26 14:09:17 +0000
140@@ -1,3 +1,9 @@
141+etckeeper (0.61ubuntu2) UNRELEASED; urgency=low
142+
143+ * Update tutorial to use bzr. LP: #945453
144+
145+ -- Jelmer Vernooij <jelmer@debian.org> Sat, 24 Mar 2012 12:34:30 +0100
146+
147 etckeeper (0.61ubuntu1) precise; urgency=low
148
149 [Chuck Short]

Subscribers

People subscribed via source and target branches