Repository Guidelines » History » Version 4
Hans-Martin Haase, 08/12/2015 08:34 AM
Add table of content.
1 | 4 | Hans-Martin Haase | {{toc}} |
---|---|---|---|
2 | |||
3 | 2 | Detlef Hühnlein | h1. Repository Guidelines |
4 | |||
5 | 1 | Detlef Hühnlein | The git master repository is available under the following ssh URL: |
6 | 3 | Tobias Wich | <pre>https://github.com/ecsec/open-ecard.git</pre> |
7 | 1 | Detlef Hühnlein | The master repository contains the master and stage branch as well as all official tags. |
8 | The repository is not writable, except by the integrator. |
||
9 | |||
10 | Every user with git development access has his own repository which is accessible under the following URL: |
||
11 | <pre>git@vserver-001.urospace.de:ecard-client/firstname_lastname</pre> |
||
12 | |||
13 | To get access to your personal repository, you first have to add it to your remotes. This is accomplished by the following command: |
||
14 | <pre> git remote add local-name-for-repo git@vserver-001.urospace.de:ecard-client/firstname_lastname</pre> |
||
15 | local-name-for-repo identifies the remote repository on your local machine. The name can be freely chosen, but it is recommended to use the initials of the developer who owns the repository. |
||
16 | |||
17 | For example, if John Doe wants to add his personal repository to his remotes, he has to execute the following command: |
||
18 | <pre> git remote add jd git@vserver-001.urospace.de:ecard-client/john_doe</pre> |
||
19 | |||
20 | The same command can be used to add repositories of other developers. |
||
21 | |||
22 | |||
23 | h2. Development Workflow |
||
24 | |||
25 | # Set local repository to the commit/branch/tag, where you want to write a feature/fix/... |
||
26 | # Hack |
||
27 | # If you are working on master or stage, or more general when you have to combine your work with any other change, make sure to update your work properly (do a rebase) |
||
28 | # If the change is not a Hotfix, it will most likely go into the stage branch. |
||
29 | # Do a merge request (at the moment at Tobias Wich) |
||
30 | # Check out tests in CI system |
||
31 | # Correct change if needed |
||
32 | # Change goes into master |
||
33 | |||
34 | h2. Commit Rules |
||
35 | |||
36 | Commit messages and the appropriate level of granularity is the essence of a readable and comprehensible history. "Progit sec. 5.2":http://git-scm.com/book/ch5-2.html recommends that commits are revised with @git commit -p@ or @git add -i@ , before being committed. |
||
37 | If however it becomes apparent that the structure of the commits, or its log messages are badly done, a rewrite of the history with @git rebase -i@ can be used. There are other rewrite tools ("magit":http://philjackson.github.com/magit/magit.html#Rewriting) which help with the task at hand. http://alexvollmer.com/posts/2009/01/31/rewriting-history-with-git/ has a nice write-up how to rewrite history with the bundled git commands. |
||
38 | |||
39 | Concerning the commit message, there are a lot of descriptions on the web. Most of them are quite similar. One of the more comprehensive descriptions can be found in "Progit sec. 5.2":http://git-scm.com/book/ch5-2.html in paragraph Commit Guidelines. |
||
40 | |||
41 | A good commit message begins with a header line which is, according to Progit, 50 characters long. I tend to extend this length to ca. 70 characters. We don't live in times where consoles only have 78 character anymore. The header line should contain a brief summary of the changes in the commit. Issue references should go into the body, because nobody knows what is behind them when looking at the log. An exception to this rule is, when the summary is sufficient to describe the change and no body is needed. The summary must use imperative present tense, meaning 'Add X' instead of 'Added X'. The summary ends without a full stop. |
||
42 | If a body is needed, a blank line followed by the body is inserted after the header line. These items are optional, but it is good practise to add them. The line width of the body should be about 100 characters. The body should contain details and perhaps a motivation for the patch. Especially when adding changes in complicated code, think of cryptography for example, the reader may not understand the change without this explanation. The body may consist of several paragraphs which are separated by blank lines. |
||
43 | Enumerations or bullet points can be used inside the body. They should be indented by one space and their text should be aligned by the first character of the items text. Bullet points should be written with -. |
||
44 | |||
45 | <pre> |
||
46 | Short (up to 70 chars) summary of changes |
||
47 | |||
48 | More detailed explanatory text, if necessary. Wrap it to about 100 characters or so. In some |
||
49 | contexts, the first line is treated as the subject of an email and the rest of the text as the body. |
||
50 | The blank line separating the summary from the body is critical (unless you omit the body entirely); |
||
51 | tools like rebase can get confused if you run the two together. |
||
52 | |||
53 | Further paragraphs come after blank lines. Enumerations and bullet points look like this: |
||
54 | - Bullet points are okay, too |
||
55 | - Typically a hyphen or asterisk is used for the bullet, preceded by a single space, with blank |
||
56 | lines in between, but conventions vary here |
||
57 | or |
||
58 | 1. Point one |
||
59 | 2. Another point |
||
60 | </pre> |