Skip to content

Commit 117d2f6

Browse files
committed
Use four dashes to wrap code snippets accordingly to AsciiDoc format
1 parent d4caff5 commit 117d2f6

File tree

7 files changed

+28
-28
lines changed

7 files changed

+28
-28
lines changed

book/07-git-tools/sections/credentials.asc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,9 @@ Once again, we'll write this extension in Ruby, but any language will work so lo
164164
Here's the full source code of our new credential helper:
165165

166166
[source,ruby]
167-
--------
167+
----
168168
include::../git-credential-read-only[]
169-
--------
169+
----
170170

171171
<1> Here we parse the command-line options, allowing the user to specify the input file.
172172
The default is `~/.git-credentials`.

book/07-git-tools/sections/signing.asc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ user: "Ben Straub <[email protected]>"
5151
If you run `git show` on that tag, you can see your GPG signature attached to it:
5252

5353
[source,console]
54-
--------
54+
----
5555
$ git show v1.5
5656
tag v1.5
5757
Tagger: Ben Straub <[email protected]>
@@ -75,7 +75,7 @@ Author: Scott Chacon <[email protected]>
7575
Date: Mon Mar 17 21:52:11 2008 -0700
7676

7777
Change version number
78-
--------
78+
----
7979

8080
==== Verifying Tags
8181

book/A-git-in-other-environments/sections/bash.asc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ First, you need to get a copy of the `contrib/completion/git-completion.bash` fi
88
Copy it somewhere handy, like your home directory, and add this to your `.bashrc`:
99

1010
[source,console]
11-
-----
11+
----
1212
. ~/git-completion.bash
13-
-----
13+
----
1414

1515
Once that's done, change your directory to a Git repository, and type:
1616

@@ -27,11 +27,11 @@ This can be as simple or complex as you want, but there are generally a few key
2727
To add these to your prompt, just copy the `contrib/completion/git-prompt.sh` file from Git's source repository to your home directory, add something like this to your `.bashrc`:
2828

2929
[source,console]
30-
-----
30+
----
3131
. ~/git-prompt.sh
3232
export GIT_PS1_SHOWDIRTYSTATE=1
3333
export PS1='\w$(__git_ps1 " (%s)")\$ '
34-
-----
34+
----
3535

3636
The `\w` means print the current working directory, the `\$` prints the `$` part of the prompt, and `__git_ps1 " (%s)"` calls the function provided by `git-prompt.sh` with a formatting argument.
3737
Now your bash prompt will look like this when you're anywhere inside a Git-controlled project:

book/A-git-in-other-environments/sections/guis.asc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ In between is a collection of controls used for searching history.
4343
It, too, is easiest to invoke from the command line:
4444

4545
[source,console]
46-
-----
46+
----
4747
$ git gui
48-
-----
48+
----
4949

5050
And it looks something like this:
5151

book/B-embedding-git/sections/dulwich.asc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Dulwich follows git design and separate two basic levels of API: plumbing and po
1111
Here is an example of using the lower level API to access the commit message of the last commit:
1212

1313
[source, python]
14-
-----
14+
----
1515
from dulwich.repo import Repo
1616
r = Repo('.')
1717
r.head()
@@ -23,19 +23,19 @@ c
2323
2424
c.message
2525
# 'Add note about encoding.\n'
26-
-----
26+
----
2727

2828
To print a commit log using high-level porcelain API, one can use:
2929

3030
[source, python]
31-
-----
31+
----
3232
from dulwich import porcelain
3333
porcelain.log('.', max_entries=1)
3434
3535
#commit: 57fbe010446356833a6ad1600059d80b1e731e15
3636
#Author: Jelmer Vernooij <[email protected]>
3737
#Date: Sat Apr 29 2017 23:57:34 +0000
38-
-----
38+
----
3939

4040

4141
==== Further Reading

book/B-embedding-git/sections/go-git.asc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ go-git is focused on extensibility, compatibility and supports most of the plumb
1010
Here is a basic example of using Go APIs:
1111

1212
[source, go]
13-
-----
13+
----
1414
import "github.com/go-git/go-git/v5"
1515
1616
r, err := git.PlainClone("/tmp/foo", false, &git.CloneOptions{
1717
URL: "https://github.com/go-git/go-git",
1818
Progress: os.Stdout,
1919
})
20-
-----
20+
----
2121

2222
As soon as you have a `Repository` instance, you can access information and perform mutations on it:
2323

2424
[source, go]
25-
-----
25+
----
2626
// retrieves the branch pointed by HEAD
2727
ref, err := r.Head()
2828
@@ -36,19 +36,19 @@ history, err := commit.History()
3636
for _, c := range history {
3737
fmt.Println(c)
3838
}
39-
-----
39+
----
4040

4141
==== Advanced Functionality
4242

4343
go-git has few notable advanced features, one of which is a pluggable storage system, which is similar to Libgit2 backends.
4444
The default implementation is in-memory storage, which is very fast.
4545

4646
[source, go]
47-
-----
47+
----
4848
r, err := git.Clone(memory.NewStorage(), nil, &git.CloneOptions{
4949
URL: "https://github.com/go-git/go-git",
5050
})
51-
-----
51+
----
5252

5353
Pluggable storage provides many interesting options.
5454
For instance, https://github.com/go-git/go-git/tree/master/_examples/storage[] allows you to store references, objects, and configuration in an Aerospike database.
@@ -59,7 +59,7 @@ Using https://pkg.go.dev/github.com/go-git/go-billy/v5?tab=doc#Filesystem[] it i
5959
Another advanced use-case includes a fine-tunable HTTP client, such as the one found at https://github.com/go-git/go-git/blob/master/_examples/custom_http/main.go[].
6060

6161
[source, go]
62-
-----
62+
----
6363
customClient := &http.Client{
6464
Transport: &http.Transport{ // accept any certificate (might be useful for testing)
6565
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
@@ -75,7 +75,7 @@ client.InstallProtocol("https", githttp.NewClient(customClient))
7575
7676
// Clone repository using the new client if the protocol is https://
7777
r, err := git.Clone(memory.NewStorage(), nil, &git.CloneOptions{URL: url})
78-
-----
78+
----
7979

8080
==== Further Reading
8181

book/B-embedding-git/sections/libgit2.asc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ First, let's take a look at what the C API looks like.
99
Here's a whirlwind tour:
1010

1111
[source,c]
12-
-----
12+
----
1313
// Open a repository
1414
git_repository *repo;
1515
int error = git_repository_open(&repo, "/path/to/repository");
@@ -28,7 +28,7 @@ const git_oid *tree_id = git_commit_tree_id(commit);
2828
// Cleanup
2929
git_commit_free(commit);
3030
git_repository_free(repo);
31-
-----
31+
----
3232

3333
The first couple of lines open a Git repository.
3434
The `git_repository` type represents a handle to a repository with a cache in memory.
@@ -194,9 +194,9 @@ The bindings are written in C#, and great care has been taken to wrap the raw Li
194194
Here's what our example program looks like:
195195

196196
[source,csharp]
197-
-----
197+
----
198198
new Repository(@"C:\path\to\repo").Head.Tip.Message;
199-
-----
199+
----
200200

201201
For desktop Windows applications, there's even a NuGet package that will help you get started quickly.
202202

@@ -208,11 +208,11 @@ Objective-Git (https://github.com/libgit2/objective-git[]) is the name of the Li
208208
The example program looks like this:
209209

210210
[source,objc]
211-
-----
211+
----
212212
GTRepository *repo =
213213
[[GTRepository alloc] initWithURL:[NSURL fileURLWithPath: @"/path/to/repo"] error:NULL];
214214
NSString *msg = [[[repo headReferenceWithError:NULL] resolvedTarget] message];
215-
-----
215+
----
216216

217217
Objective-git is fully interoperable with Swift, so don't fear if you've left Objective-C behind.
218218

0 commit comments

Comments
 (0)