1 |
|
1 |
|
2 |
|
2 |
|
3 |
SVN QUICKSTART
|
3 |
SVN QUICKSTART
|
4 |
|
4 |
|
5 |
[authored by Mateusz Viste, the 29th June 2023]
|
5 |
[authored by Mateusz Viste, the 29th June 2023]
|
6 |
|
6 |
|
7 |
|
7 |
|
8 |
=== INTRO =====================================================================
|
8 |
=== INTRO =====================================================================
|
9 |
|
9 |
|
10 |
This document is aimed at people that are committing changes to the SvarDOS
|
10 |
This document is aimed at people that are committing changes to the SvarDOS
|
11 |
svn repository: developers, packagers, writers, translators...
|
11 |
svn repository: developers, packagers, writers, translators...
|
12 |
|
12 |
|
13 |
If you are reading this, then you probably received a write access to the
|
13 |
If you are reading this, then you probably received a write access to the
|
14 |
SvarDOS svn server at svn.svardos.org, ie. a login and password.
|
14 |
SvarDOS svn server at svn.svardos.org, ie. a login and password.
|
15 |
|
15 |
|
16 |
Subversion isn't hugely popular these days, hence people are less and less
|
16 |
Subversion isn't hugely popular these days, hence people are less and less
|
17 |
comfortable with it. But worry not - it's extremely straightforward!
|
17 |
comfortable with it. But worry not - it's extremely straightforward!
|
18 |
|
18 |
|
- |
|
19 |
This is obviously not meant to be a complete manual of svn. Here you will learn
|
19 |
Here you will learn the few most basic operations that will allow you to
|
20 |
the few most basic operations that will allow you to interact with svn right
|
- |
|
21 |
away. In case of more in-depth details about Subversion usage I recommend
|
20 |
interact with svn right away.
|
22 |
consulting the excellent SVN book at https://svnbook.red-bean.com/.
|
21 |
|
23 |
|
22 |
|
24 |
|
23 |
=== REPOSITORY CHECKOUT =======================================================
|
25 |
=== REPOSITORY CHECKOUT =======================================================
|
24 |
|
26 |
|
25 |
This is one time action that you need to perform so your svn client pulls the
|
27 |
This is one time action that you need to perform so your svn client pulls the
|
26 |
current state of the SvarDOS repository to your disk. It's called a "checkout":
|
28 |
current state of the SvarDOS repository to your disk. It's called a "checkout":
|
27 |
|
29 |
|
28 |
svn co svn://your.username@svn.svardos.org/svardos
|
30 |
svn co svn://your.username@svn.svardos.org/svardos
|
29 |
|
31 |
|
30 |
This will create a "svardos" directory on your disk. All further actions will
|
32 |
This will create a "svardos" directory on your disk. All further actions will
|
31 |
be always performed from within this directory.
|
33 |
be always performed from within this directory.
|
32 |
|
34 |
|
33 |
|
35 |
|
34 |
=== PERIODIC UPDATES ==========================================================
|
36 |
=== PERIODIC UPDATES ==========================================================
|
35 |
|
37 |
|
36 |
The repository changes with time, so you need to make sure that your local copy
|
38 |
The repository changes with time, so you need to make sure that your local copy
|
37 |
is always up to date. To do so, you only need to execute a single command from
|
39 |
is always up to date. To do so, you only need to execute a single command from
|
38 |
time to time. We call it an "update":
|
40 |
time to time. We call it an "update":
|
39 |
|
41 |
|
40 |
svn up
|
42 |
svn up
|
41 |
|
43 |
|
42 |
|
44 |
|
43 |
=== ADD NEW FILES OR DIRECTORIES ==============================================
|
45 |
=== CREATE A NEW DIRECTORY ====================================================
|
44 |
|
46 |
|
45 |
If you need to create a new subdirectory somewhere in the repo, you can either
|
47 |
If you need to create a new subdirectory somewhere in the repo, you can either
|
46 |
ask your svn client to do it, or do it yourself and then ask your svn client to
|
48 |
ask your svn client to do it, or do it yourself and then ask your svn client to
|
47 |
track it.
|
49 |
track it.
|
48 |
|
50 |
|
49 |
Option 1:
|
51 |
Option 1:
|
50 |
svn mkdir newdir
|
52 |
svn mkdir newdir
|
51 |
|
53 |
|
52 |
Option 2:
|
54 |
Option 2:
|
53 |
mkdir newdir
|
55 |
mkdir newdir
|
54 |
svn add newdir
|
56 |
svn add newdir
|
55 |
|
57 |
|
- |
|
58 |
|
- |
|
59 |
=== ADD A NEW FILE TO THE REPOSITORY ==========================================
|
- |
|
60 |
|
56 |
If you creates a new file (new translation, new package, new code file...), you
|
61 |
If you creates a new file (new translation, new package, new code file...), you
|
57 |
need to tell svn about it so it starts to version it:
|
62 |
need to tell svn about it so it starts to version it:
|
58 |
|
63 |
|
59 |
svn add newfile.txt
|
64 |
svn add newfile.txt
|
60 |
|
65 |
|
61 |
Once done, you should review your changes and commit them (we will talk about
|
- |
|
62 |
it below).
|
- |
|
63 |
|
- |
|
64 |
|
66 |
|
65 |
=== DELETE A FILE OR DIRECTORY ================================================
|
67 |
=== DELETE A FILE OR DIRECTORY ================================================
|
66 |
|
68 |
|
67 |
Deleting a file or directory via svn is as simple as this:
|
69 |
Deleting a file or directory via svn is as simple as this:
|
68 |
|
70 |
|
69 |
svn del file_to_dele.txt
|
71 |
svn del file_to_dele.txt
|
70 |
svn del dir_to_delete
|
72 |
svn del dir_to_delete
|
71 |
|
73 |
|
72 |
And of course, you need to commit the changes to apply them on the server.
|
74 |
And of course, you need to commit the changes to apply them on the server.
|
73 |
|
75 |
|
74 |
|
76 |
|
75 |
=== REVIEWING YOUR CHANGES BEFORE COMMIT ======================================
|
77 |
=== REVIEWING YOUR CHANGES BEFORE COMMIT ======================================
|
76 |
|
78 |
|
77 |
You have done some changes on your local data, and are ready to push them to
|
79 |
You have done some changes on your local data, and are ready to push them to
|
78 |
the server? Thath's great, but I encourage you to review your changes one last
|
80 |
the server? Thath's great, but I encourage you to review your changes one last
|
79 |
time, asking svn to list them.
|
81 |
time, asking svn to list them.
|
80 |
|
82 |
|
81 |
1. Display the list of changed files or directories:
|
83 |
1. Display the list of changed files or directories:
|
82 |
|
84 |
|
83 |
svn st
|
85 |
svn st
|
84 |
|
86 |
|
85 |
2. Display the difference between your local files and the server's content:
|
87 |
2. Display the difference between your local files and the server's content:
|
86 |
|
88 |
|
87 |
svn diff
|
89 |
svn diff
|
88 |
|
90 |
|
89 |
|
91 |
|
90 |
Both these operations will show you the state compared to the last known
|
92 |
Both these operations will show you the state compared to the last known
|
91 |
content of the server. To make sure nothing changed on the server in the mean
|
93 |
content of the server. To make sure nothing changed on the server in the mean
|
92 |
time, you should update your local copy (svn up) beforehand.
|
94 |
time, you should update your local copy (svn up) beforehand.
|
93 |
|
95 |
|
94 |
|
96 |
|
95 |
=== UNDOING (REVERTING) LOCAL CHANGES =========================================
|
97 |
=== UNDOING (REVERTING) LOCAL CHANGES =========================================
|
96 |
|
98 |
|
97 |
You made some huge mistake and would like to erase your local changes to revert
|
99 |
You made some huge mistake and would like to erase your local changes to revert
|
98 |
back to the last known server's state? Easy:
|
100 |
back to the last known server's state? Easy:
|
99 |
|
101 |
|
100 |
svn revert file_or_dir_to_revert
|
102 |
svn revert file_or_dir_to_revert
|
101 |
|
103 |
|
102 |
It is worth mentionning that this works even if you deleted your local copy of
|
104 |
It is worth mentionning that this works even if you deleted your local copy of
|
103 |
the file or dir.
|
105 |
the file or dir.
|
104 |
|
106 |
|
105 |
|
107 |
|
106 |
=== COMMIT ====================================================================
|
108 |
=== COMMIT ====================================================================
|
107 |
|
109 |
|
108 |
Finally, you made your changes, reviewed them, made sure your local files are
|
110 |
Finally, you made your changes, reviewed them, made sure your local files are
|
109 |
up to date, and are ready to push things to the server. Awesome. To push all
|
111 |
up to date, and are ready to push things to the server. Awesome. To push all
|
110 |
your changes at once, do a general commit:
|
112 |
your changes at once, do a general commit:
|
111 |
|
113 |
|
112 |
svn commit -m "short description of the changes"
|
114 |
svn commit -m "short description of the changes"
|
113 |
|
115 |
|
114 |
If you prefer to push your changed files in separate commits for a better
|
116 |
If you prefer to push your changed files in separate commits for a better
|
115 |
visibility, then that' s no problem either:
|
117 |
visibility, then that' s no problem either:
|
116 |
|
118 |
|
117 |
svn commit -m "fixed bug #123" changed_file.c
|
119 |
svn commit -m "fixed bug #123" changed_file.c
|
118 |
svn commit -m "improved polish translations" pl.txt
|
120 |
svn commit -m "improved polish translations" pl.txt
|
119 |
svn commit -m "updated FDISK to ver 1.3.7" fdisk-1.3.7.svp fdisk-1.3.7.zip
|
121 |
svn commit -m "updated FDISK to ver 1.3.7" fdisk-1.3.7.svp fdisk-1.3.7.zip
|
120 |
|
122 |
|
121 |
|
123 |
|
122 |
=== WHY SVN? ==================================================================
|
124 |
=== WHY SVN? ==================================================================
|
123 |
|
125 |
|
124 |
Nowadays most project rely on git for their versioning. Many people think
|
126 |
Nowadays most project rely on git for their versioning. Many people think
|
125 |
that's because of some technical superiority of git. I think that's rather a
|
127 |
that's because of some technical superiority of git. I think that's rather a
|
126 |
bandwagon trend.
|
128 |
bandwagon trend.
|
127 |
|
129 |
|
128 |
Of course I have nothing against git. It is a very impressive technology and an
|
130 |
Of course I have nothing against git. It is a very impressive technology and an
|
129 |
outstanding solution to the specific problem it was designed for: enabling
|
131 |
outstanding solution to the specific problem it was designed for: enabling
|
130 |
collaboration of huge, unorganized teams on a complex code base while having no
|
132 |
collaboration of huge, unorganized teams on a complex code base while having no
|
131 |
centralized authority. But when it comes to more limited projects, it is my
|
133 |
centralized authority. But when it comes to more limited projects, it is my
|
132 |
opinion that git is an unnecessary complication that presents no added value
|
134 |
opinion that git is an unnecessary complication that presents no added value
|
133 |
over svn, while having a number of downsides:
|
135 |
over svn, while having a number of downsides:
|
134 |
- lack of a centrally managed repository,
|
136 |
- lack of a centrally managed repository,
|
135 |
- lack of monotonically increasing revisions,
|
137 |
- lack of monotonically increasing revisions,
|
136 |
- non-obvious usage,
|
138 |
- non-obvious usage,
|
137 |
- poor storage of binary files,
|
139 |
- poor storage of binary files,
|
138 |
- inefficient client-side storage (stores the entire history)
|
140 |
- inefficient client-side storage (stores the entire history)
|
139 |
- ...
|
141 |
- ...
|
140 |
|
142 |
|
141 |
Subversion, on the other hand, is simpler due to its centralized nature.
|
143 |
Subversion, on the other hand, is simpler due to its centralized nature.
|
142 |
Syncing (updating) local files is both faster and leaner than with git, because
|
144 |
Syncing (updating) local files is both faster and leaner than with git, because
|
143 |
svn cares only about the latest available revision, it does not keep the entire
|
145 |
svn cares only about the latest available revision, it does not keep the entire
|
144 |
project's history on the client side. In a word - it's simpler, and I am always
|
146 |
project's history on the client side. In a word - it's simpler, and I am always
|
145 |
in favor of technical simplicity as long as it does not come with significant
|
147 |
in favor of technical simplicity as long as it does not come with significant
|
146 |
limitations.
|
148 |
limitations.
|
147 |
|
149 |
|
148 |
|
150 |
|
149 |
======================================================================= EOF ===
|
151 |
======================================================================= EOF ===
|
150 |
|
152 |
|