Skip to content

Commit 271f5dc

Browse files
authored
Merge pull request #1418 from Morganov/small-fixes
Fix formatting
2 parents c0206b5 + 8e73b7d commit 271f5dc

File tree

12 files changed

+81
-69
lines changed

12 files changed

+81
-69
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/09-git-and-other-scms/sections/client-bzr.asc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Nevertheless, it is possible to work on a Bazaar repository from a Git one.
1010
There are many projects that allow you to use Git as a Bazaar client.
1111
Here we'll use Felipe Contreras' project that you may find at https://github.com/felipec/git-remote-bzr[].
1212
To install it, you just have to download the file git-remote-bzr in a folder contained in your `$PATH`:
13+
1314
[source,console]
1415
----
1516
$ wget https://raw.github.com/felipec/git-remote-bzr/master/git-remote-bzr -O ~/bin/git-remote-bzr
@@ -24,10 +25,11 @@ That's all!
2425
It is simple to use.
2526
It is enough to clone a Bazaar repository prefixing it by `bzr::`.
2627
Since Git and Bazaar both do full clones to your machine, it's possible to attach a Git clone to your local Bazaar clone, but it isn't recommended.
27-
It's much easier to attach your Git clone directly to the same place your Bazaar clone is attached to the central repository.
28+
It's much easier to attach your Git clone directly to the same place your Bazaar clone is attached to -- the central repository.
2829

2930
Let's suppose that you worked with a remote repository which is at address `bzr+ssh://developer@mybazaarserver:myproject`.
3031
Then you must clone it in the following way:
32+
3133
[source,console]
3234
----
3335
$ git clone bzr::bzr+ssh://developer@mybazaarserver:myproject myProject-Git
@@ -36,6 +38,7 @@ $ cd myProject-Git
3638

3739
At this point, your Git repository is created but it is not compacted for optimal disk use.
3840
That's why you should also clean and compact your Git repository, especially if it is a big one:
41+
3942
[source,console]
4043
----
4144
$ git gc --aggressive
@@ -45,18 +48,21 @@ $ git gc --aggressive
4548

4649
Bazaar only allows you to clone branches, but a repository may contain several branches, and `git-remote-bzr` can clone both.
4750
For example, to clone a branch:
51+
4852
[source,console]
4953
----
5054
$ git clone bzr::bzr://bzr.savannah.gnu.org/emacs/trunk emacs-trunk
5155
----
5256

5357
And to clone the whole repository:
58+
5459
[source,console]
5560
----
5661
$ git clone bzr::bzr://bzr.savannah.gnu.org/emacs emacs
5762
----
5863

5964
The second command clones all the branches contained in the emacs repository; nevertheless, it is possible to point out some branches:
65+
6066
[source,console]
6167
----
6268
$ git config remote-bzr.branches 'trunk, xwindow'
@@ -99,6 +105,7 @@ However, be careful with its creation because with Git it is impossible to re-in
99105

100106
To fetch the changes of the remote, you pull changes as usually, using Git commands.
101107
Supposing that your changes are on the `master` branch, you merge or rebase your work on the `origin/master` branch:
108+
102109
[source,console]
103110
----
104111
$ git pull --rebase origin
@@ -110,6 +117,7 @@ Because Bazaar also has the concept of merge commits, there will be no problem i
110117
So you can work on a branch, merge the changes into `master` and push your work.
111118
Then, you create your branches, you test and commit your work as usual.
112119
You finally push your work to the Bazaar repository:
120+
113121
[source,console]
114122
----
115123
$ git push origin master

book/09-git-and-other-scms/sections/import-bzr.asc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ Traceback (most recent call last):
5252
ImportError: No module named fastimport
5353
$ pip install fastimport
5454
----
55+
5556
If it is not available, you can download it at address https://pypi.python.org/pypi/fastimport/.
5657

5758
In the second case (on Windows), `bzr-fastimport` is automatically installed with the standalone version and the default installation (let all the checkboxes checked).

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/A-git-in-other-environments/sections/powershell.asc

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,39 @@ It looks like this:
1212
image::images/posh-git.png[PowerShell with Posh-git.]
1313

1414
==== Installation
15+
1516
===== Prerequisites (Windows only)
16-
Before you're able to run PowerShell scripts on your machine, you need to set your local ExecutionPolicy to RemoteSigned (Basically anything except Undefined and Restricted).
17-
If you choose AllSigned instead of RemoteSigned, also local scripts (your own) need to be digitally signed in order to be executed.
18-
With RemoteSigned, only Scripts having the "ZoneIdentifier" set to Internet (were downloaded from the web) need to be signed, others not.
19-
If you're an administrator and want to set it for all Users on that machine, use "-Scope LocalMachine".
20-
If you're a normal user, without administrative rights, you can use "-Scope CurrentUser" to set it only for you.
17+
18+
Before you're able to run PowerShell scripts on your machine, you need to set your local `ExecutionPolicy` to `RemoteSigned` (basically, anything except `Undefined` and `Restricted`).
19+
If you choose `AllSigned` instead of `RemoteSigned`, also local scripts (your own) need to be digitally signed in order to be executed.
20+
With `RemoteSigned`, only scripts having the `ZoneIdentifier` set to `Internet` (were downloaded from the web) need to be signed, others not.
21+
If you're an administrator and want to set it for all users on that machine, use `-Scope LocalMachine`.
22+
If you're a normal user, without administrative rights, you can use `-Scope CurrentUser` to set it only for you.
2123

2224
More about PowerShell Scopes: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_scopes[]
2325

2426
More about PowerShell ExecutionPolicy: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-executionpolicy[]
2527

28+
To set the value of `ExecutionPolicy` to `RemoteSigned` for all users use the next command:
29+
2630
[source,powershell]
27-
-----
31+
----
2832
> Set-ExecutionPolicy -Scope LocalMachine -ExecutionPolicy RemoteSigned -Force
29-
-----
33+
----
3034

3135
===== PowerShell Gallery
36+
3237
If you have at least PowerShell 5 or PowerShell 4 with PackageManagement installed, you can use the package manager to install posh-git for you.
3338

3439
More information about PowerShell Gallery: https://docs.microsoft.com/en-us/powershell/scripting/gallery/overview[]
40+
3541
[source,powershell]
36-
-----
42+
----
3743
> Install-Module posh-git -Scope CurrentUser -Force
3844
> Install-Module posh-git -Scope CurrentUser -AllowPrerelease -Force # Newer beta version with PowerShell Core support
39-
-----
40-
If you want to install posh-git for all users, use "-Scope AllUsers" instead and execute the command from an elevated PowerShell console.
45+
----
46+
47+
If you want to install posh-git for all users, use `-Scope AllUsers` instead and execute the command from an elevated PowerShell console.
4148
If the second command fails with an error like `Module 'PowerShellGet' was not installed by using Install-Module`, you'll need to run another command first:
4249

4350
[source,powershell]
@@ -49,26 +56,31 @@ Then you can go back and try again.
4956
This happens, because the modules that ship with Windows PowerShell are signed with a different publishment certificate.
5057

5158
===== Update PowerShell Prompt
59+
5260
To include git information in your prompt, the posh-git module needs to be imported.
53-
To have posh-git imported every time PowerShell starts, execute the Add-PoshGitToProfile command which will add the import statement into you $profile script.
61+
To have posh-git imported every time PowerShell starts, execute the `Add-PoshGitToProfile` command which will add the import statement into your `$profile` script.
5462
This script is executed everytime you open a new PowerShell console.
55-
Keep in mind, that there are multiple $profile scripts.
63+
Keep in mind, that there are multiple `$profile` scripts.
5664
E. g. one for the console and a separate one for the ISE.
65+
5766
[source,powershell]
58-
-----
67+
----
5968
> Import-Module posh-git
6069
> Add-PoshGitToProfile -AllHosts
61-
-----
70+
----
6271

6372
===== From Source
64-
Just download a posh-git release from (https://github.com/dahlbyk/posh-git[]), and uncompress it.
65-
Then import the module using the full path to the posh-git.psd1 file:
73+
74+
Just download a posh-git release from https://github.com/dahlbyk/posh-git/releases[], and uncompress it.
75+
Then import the module using the full path to the `posh-git.psd1` file:
76+
6677
[source,powershell]
67-
-----
78+
----
6879
> Import-Module <path-to-uncompress-folder>\src\posh-git.psd1
6980
> Add-PoshGitToProfile -AllHosts
70-
-----
81+
----
7182

7283
This will add the proper line to your `profile.ps1` file, and posh-git will be active the next time you open PowerShell.
84+
7385
For a description of the Git status summary information displayed in the prompt see: https://github.com/dahlbyk/posh-git/blob/master/README.md#git-status-summary-information[]
7486
For more details on how to customize your posh-git prompt see: https://github.com/dahlbyk/posh-git/blob/master/README.md#customization-variables[]

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,12 @@ This results in a display of the current branch on the right-hand side of the te
3737
(The left side is supported as well, of course; just uncomment the assignment to PROMPT.)
3838
It looks a bit like this:
3939

40-
.Customized `zsh` prompt.
40+
.Customized `zsh` prompt
4141
image::images/zsh-prompt.png[Customized `zsh` prompt.]
4242

43-
For more information on vcs_info, check out its documentation
44-
in the `zshcontrib(1)` manual page,
45-
or online at http://zsh.sourceforge.net/Doc/Release/User-Contributions.html#Version-Control-Information[].
43+
For more information on `vcs_info`, check out its documentation in the `zshcontrib(1)` manual page, or online at http://zsh.sourceforge.net/Doc/Release/User-Contributions.html#Version-Control-Information[].
4644

47-
Instead of vcs_info, you might prefer the prompt customization script that ships with Git, called `git-prompt.sh`; see https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh[] for details.
45+
Instead of `vcs_info`, you might prefer the prompt customization script that ships with Git, called `git-prompt.sh`; see https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh[] for details.
4846
`git-prompt.sh` is compatible with both Bash and Zsh.
4947

5048
Zsh is powerful enough that there are entire frameworks dedicated to making it better.
@@ -53,5 +51,5 @@ oh-my-zsh's plugin system comes with powerful git tab-completion, and it has a v
5351
<<oh_my_zsh_git>> is just one example of what can be done with this system.
5452

5553
[[oh_my_zsh_git]]
56-
.An example of an oh-my-zsh theme.
54+
.An example of an oh-my-zsh theme
5755
image::images/zsh-oh-my.png[An example of an oh-my-zsh theme.]

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: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +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

24-
2524
[source, go]
26-
-----
25+
----
2726
// retrieves the branch pointed by HEAD
2827
ref, err := r.Head()
2928
@@ -37,20 +36,19 @@ history, err := commit.History()
3736
for _, c := range history {
3837
fmt.Println(c)
3938
}
40-
-----
41-
39+
----
4240

4341
==== Advanced Functionality
4442

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

4846
[source, go]
49-
-----
47+
----
5048
r, err := git.Clone(memory.NewStorage(), nil, &git.CloneOptions{
5149
URL: "https://github.com/go-git/go-git",
5250
})
53-
-----
51+
----
5452

5553
Pluggable storage provides many interesting options.
5654
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.
@@ -61,24 +59,23 @@ Using https://pkg.go.dev/github.com/go-git/go-billy/v5?tab=doc#Filesystem[] it i
6159
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[].
6260

6361
[source, go]
64-
-----
62+
----
6563
customClient := &http.Client{
66-
Transport: &http.Transport{ // accept any certificate (might be useful for testing)
67-
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
68-
},
69-
Timeout: 15 * time.Second, // 15 second timeout
70-
CheckRedirect: func(req *http.Request, via []*http.Request) error {
71-
return http.ErrUseLastResponse // don't follow redirect
72-
},
64+
Transport: &http.Transport{ // accept any certificate (might be useful for testing)
65+
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
66+
},
67+
Timeout: 15 * time.Second, // 15 second timeout
68+
CheckRedirect: func(req *http.Request, via []*http.Request) error {
69+
return http.ErrUseLastResponse // don't follow redirect
70+
},
7371
}
7472
7573
// Override http(s) default protocol to use our custom client
7674
client.InstallProtocol("https", githttp.NewClient(customClient))
7775
7876
// Clone repository using the new client if the protocol is https://
7977
r, err := git.Clone(memory.NewStorage(), nil, &git.CloneOptions{URL: url})
80-
-----
81-
78+
----
8279

8380
==== Further Reading
8481

0 commit comments

Comments
 (0)