Skip to content

Commit a8f1411

Browse files
authored
Merge pull request #891 from rpjday/maintain
Numerous tweaks (rewording/grammar/fonts) to "Maintaining a Project"
2 parents c088089 + 9ca32ce commit a8f1411

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

book/05-distributed-git/sections/maintaining.asc

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ There are two ways to apply an emailed patch: with `git apply` or with `git am`.
3838
===== Applying a Patch with apply
3939

4040
(((git commands, apply)))
41-
If you received the patch from someone who generated it with the `git diff` or a Unix `diff` command (which is not recommended; see the next section), you can apply it with the `git apply` command.
41+
If you received the patch from someone who generated it with `git diff` or some variation of the Unix `diff` command (which is not recommended; see the next section), you can apply it with the `git apply` command.
4242
Assuming you saved the patch at `/tmp/patch-ruby-client.patch`, you can apply the patch like this:
4343

4444
[source,console]
@@ -87,12 +87,11 @@ Subject: [PATCH 1/2] add limit to log function
8787
Limit log functionality to the first 20
8888
----
8989

90-
This is the beginning of the output of the `format-patch` command that you saw in the previous section.
91-
This is also a valid mbox email format.
90+
This is the beginning of the output of the `git format-patch` command that you saw in the previous section; it also represents a valid mbox email format.
9291
If someone has emailed you the patch properly using `git send-email`, and you download that into an mbox format, then you can point `git am` to that mbox file, and it will start applying all the patches it sees.
9392
If you run a mail client that can save several emails out in mbox format, you can save entire patch series into a file and then use `git am` to apply them one at a time.
9493

95-
However, if someone uploaded a patch file generated via `format-patch` to a ticketing system or something similar, you can save the file locally and then pass that file saved on your disk to `git am` to apply it:
94+
However, if someone uploaded a patch file generated via `git format-patch` to a ticketing system or something similar, you can save the file locally and then pass that file saved on your disk to `git am` to apply it:
9695

9796
[source,console]
9897
----
@@ -264,7 +263,7 @@ For example, if you've added a line in a file on the `master` branch, a direct c
264263

265264
If `master` is a direct ancestor of your topic branch, this isn't a problem; but if the two histories have diverged, the diff will look like you're adding all the new stuff in your topic branch and removing everything unique to the `master` branch.
266265

267-
What you really want to see are the changes added to the topic branch the work you'll introduce if you merge this branch with master.
266+
What you really want to see are the changes added to the topic branch -- the work you'll introduce if you merge this branch with master.
268267
You do that by having Git compare the last commit on your topic branch with the first common ancestor it has with the master branch.
269268

270269
Technically, you can do that by explicitly figuring out the common ancestor and then running your diff on it:
@@ -276,8 +275,15 @@ $ git merge-base contrib master
276275
$ git diff 36c7db
277276
----
278277

279-
However, that isn't convenient, so Git provides another shorthand for doing the same thing: the triple-dot syntax.
280-
In the context of the `diff` command, you can put three periods after another branch to do a `diff` between the last commit of the branch you're on and its common ancestor with another branch:
278+
or, more concisely:
279+
280+
[source,console]
281+
----
282+
$ git diff $(git merge-base contrib master)
283+
----
284+
285+
However, neither of those is particularly convenient, so Git provides another shorthand for doing the same thing: the triple-dot syntax.
286+
In the context of the `git diff` command, you can put three periods after another branch to do a `diff` between the last commit of the branch you're on and its common ancestor with another branch:
281287

282288
[source,console]
283289
----
@@ -297,10 +303,11 @@ You have a number of choices, so we'll cover a few of them.
297303
===== Merging Workflows
298304

299305
(((workflows, merging)))
300-
One simple workflow is to merge the work into your `master` branch.
306+
One basic workflow is to simply merge all that work directly into your `master` branch.
301307
In this scenario, you have a `master` branch that contains basically stable code.
302-
When you have work in a topic branch that you've done or that someone has contributed and you've verified, you merge it into your master branch, delete the topic branch, and then continue the process.
303-
If we have a repository with work in two branches named `ruby_client` and `php_client` that looks like <<merwf_a>> and merge `ruby_client` first and then `php_client` next, then your history will end up looking like <<merwf_b>>.
308+
When you have work in a topic branch that you think you've completed, or work that someone else has contributed and you've verified, you merge it into your master branch, delete that just-merged topic branch, and repeat.
309+
310+
For instance, if we have a repository with work in two branches named `ruby_client` and `php_client` that looks like <<merwf_a>>, and we merge `ruby_client` followed by `php_client`, your history will end up looking like <<merwf_b>>.
304311

305312
[[merwf_a]]
306313
.History with several topic branches.
@@ -329,7 +336,7 @@ image::images/merging-workflows-4.png[After a topic branch merge.]
329336
.After a project release.
330337
image::images/merging-workflows-5.png[After a topic branch release.]
331338

332-
This way, when people clone your project's repository, they can either check out `master` to build the latest stable version and keep up to date on that easily, or they can check out `develop`, which is the more cutting-edge stuff.
339+
This way, when people clone your project's repository, they can either check out `master` to build the latest stable version and keep up to date on that easily, or they can check out `develop`, which is the more cutting-edge content.
333340
You can also extend this concept by having an `integrate` branch where all the work is merged together.
334341
Then, when the codebase on that branch is stable and passes tests, you merge it into a `develop` branch; and when that has proven itself stable for a while, you fast-forward your `master` branch.
335342

@@ -421,7 +428,7 @@ We will cover rerere in more detail in <<_rerere>>.
421428
==== Tagging Your Releases
422429

423430
(((tags)))(((tags, signing)))
424-
When you've decided to cut a release, you'll probably want to drop a tag so you can re-create that release at any point going forward.
431+
When you've decided to cut a release, you'll probably want to assign a tag so you can re-create that release at any point going forward.
425432
You can create a new tag as discussed in <<_git_basics_chapter>>.
426433
If you decide to sign the tag as the maintainer, the tagging may look something like this:
427434

0 commit comments

Comments
 (0)