Skip to content

Commit 9cc92d6

Browse files
committed
Merge pull request #399 from crd/fix-console-blocks-in-08-customizing-git
Fix console blocks in 08-customizing.git
2 parents bb21ef0 + 55c5915 commit 9cc92d6

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

book/08-customizing-git/sections/attributes.asc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ In essence, you want to treat it like a binary file.
2424

2525
To tell Git to treat all `pbxproj` files as binary data, add the following line to your `.gitattributes` file:
2626

27-
[source]
27+
[source,ini]
2828
----
2929
*.pbxproj binary
3030
----
@@ -53,7 +53,7 @@ You can't directly compare two versions unless you check them out and scan them
5353
It turns out you can do this fairly well using Git attributes.
5454
Put the following line in your `.gitattributes` file:
5555

56-
[source]
56+
[source,ini]
5757
----
5858
*.docx diff=word
5959
----
@@ -121,7 +121,7 @@ $ git config diff.exif.textconv exiftool
121121

122122
If you replace an image in your project and run `git diff`, you see something like this:
123123

124-
[source]
124+
[source,diff]
125125
----
126126
diff --git a/image.png b/image.png
127127
index 88839c4..4afcb7c 100644
@@ -193,7 +193,7 @@ image::images/clean.png[The ``clean'' filter is run when files are staged.]
193193
The original commit message for this feature gives a simple example of running all your C source code through the `indent` program before committing.
194194
You can set it up by setting the filter attribute in your `.gitattributes` file to filter `*.c` files with the ``indent'' filter:
195195

196-
[source]
196+
[source,ini]
197197
----
198198
*.c filter=indent
199199
----
@@ -271,7 +271,7 @@ If there is a subdirectory or file that you don't want to include in your archiv
271271
For example, say you have some test files in a `test/` subdirectory, and it doesn't make sense to include them in the tarball export of your project.
272272
You can add the following line to your Git attributes file:
273273

274-
[source]
274+
[source,ini]
275275
----
276276
test/ export-ignore
277277
----
@@ -304,7 +304,7 @@ Last commit date: Tue Apr 21 08:38:48 2009 -0700 by Scott Chacon
304304

305305
The substitutions can include for example the commit message and any git notes, and git log can do simple word wrapping:
306306

307-
[source.console]
307+
[source,console]
308308
----
309309
$ echo '$Format:Last commit: %h by %aN at %cd%n%+w(76,6,9)%B$' > LAST_COMMIT
310310
$ git commit -am 'export-subst uses git log's custom formatter
@@ -333,7 +333,7 @@ This is helpful if a branch in your project has diverged or is specialized, but
333333
Say you have a database settings file called `database.xml` that is different in two branches, and you want to merge in your other branch without messing up the database file.
334334
You can set up an attribute like this:
335335

336-
[source]
336+
[source,ini]
337337
----
338338
database.xml merge=ours
339339
----

book/08-customizing-git/sections/config.asc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Now, no matter what is set as your default shell editor, Git will fire up Emacs
6666
If you set this to the path of a file on your system, Git will use that file as the default message when you commit.
6767
For instance, suppose you create a template file at `~/.gitmessage.txt` that looks like this:
6868

69-
[source]
69+
[source,text]
7070
----
7171
subject line
7272
@@ -85,7 +85,7 @@ $ git commit
8585

8686
Then, your editor will open to something like this for your placeholder commit message when you commit:
8787

88-
[source]
88+
[source,text]
8989
----
9090
subject line
9191
@@ -150,7 +150,7 @@ If your preferred editor is Emacs or Vim, you know about files that end with a `
150150
This setting lets you write a kind of global `.gitignore` file.
151151
If you create a `~/.gitignore_global` file with these contents:
152152

153-
[source]
153+
[source,ini]
154154
----
155155
*~
156156
.DS_Store
@@ -221,7 +221,10 @@ Each of these can be set to `true`, `false`, or `always`:
221221
In addition, each of these has subsettings you can use to set specific colors for parts of the output, if you want to override each color.
222222
For example, to set the meta information in your diff output to blue foreground, black background, and bold text, you can run
223223

224-
$ git config --global color.diff.meta "blue black bold"
224+
[source,console]
225+
----
226+
$ git config --global color.diff.meta "blue black bold"
227+
----
225228

226229
You can set the color to any of the following values: `normal`, `black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, or `white`.
227230
If you want an attribute like bold in the previous example, you can choose from `bold`, `dim`, `ul` (underline), `blink`, and `reverse` (swap foreground and background).

book/08-customizing-git/sections/policy.asc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ error: failed to push some refs to 'git@gitserver:project.git'
239239
There are a couple of interesting things here.
240240
First, you see this where the hook starts running.
241241

242-
[source]
242+
[source,console]
243243
----
244244
Enforcing Policies...
245245
(refs/heads/master) (fb8c72) (c56860)
@@ -250,7 +250,7 @@ Anything your script echoes to `stdout` will be transferred to the client.
250250

251251
The next thing you'll notice is the error message.
252252

253-
[source]
253+
[source,console]
254254
----
255255
[POLICY] Your message is not formatted correctly
256256
error: hooks/update exited with error code 1
@@ -260,7 +260,7 @@ error: hook declined to update refs/heads/master
260260
The first line was printed out by you, the other two were Git telling you that the update script exited non-zero and that is what is declining your push.
261261
Lastly, you have this:
262262

263-
[source]
263+
[source,console]
264264
----
265265
To git@gitserver:project.git
266266
! [remote rejected] master -> master (hook declined)
@@ -272,7 +272,7 @@ You'll see a remote rejected message for each reference that your hook declined,
272272
Furthermore, if someone tries to edit a file they don't have access to and push a commit containing it, they will see something similar.
273273
For instance, if a documentation author tries to push a commit modifying something in the `lib` directory, they see
274274

275-
[source]
275+
[source,console]
276276
----
277277
[POLICY] You do not have access to push to lib/test.rb
278278
----

0 commit comments

Comments
 (0)