Skip to content

Commit d425142

Browse files
author
Junio C Hamano
committed
Merge branches 'jc/checkout', 'jc/format-patch', 'jc/octopus', 'jc/sb' and 'jc/clone'
6 parents 9e9b267 + 980d8ce + 36383a3 + 98efc8f + 1aa68d6 + 8a1a120 commit d425142

File tree

10 files changed

+286
-165
lines changed

10 files changed

+286
-165
lines changed

Documentation/git-clone.txt

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ git-clone - Clones a repository.
99
SYNOPSIS
1010
--------
1111
[verse]
12-
'git-clone' [-l [-s]] [-q] [-n] [-o <name>] [-u <upload-pack>]
12+
'git-clone' [-l [-s]] [-q] [-n] [--naked] [-o <name>] [-u <upload-pack>]
1313
<repository> [<directory>]
1414

1515
DESCRIPTION
@@ -58,6 +58,12 @@ OPTIONS
5858
-n::
5959
No checkout of HEAD is performed after the clone is complete.
6060

61+
--naked::
62+
Make a 'naked' GIT repository. That is, instead of
63+
creating `<directory>` and placing the administrative
64+
files in `<directory>/.git`, make the `<directory>`
65+
itself the `$GIT_DIR`. This implies `-n` option.
66+
6167
-o <name>::
6268
Instead of using the branch name 'origin' to keep track
6369
of the upstream repository, use <name> instead. Note
@@ -103,6 +109,22 @@ $ cd copy
103109
$ git show-branch
104110
------------
105111

112+
113+
Create a naked repository to publish your changes to the public::
114+
+
115+
------------
116+
$ git clone --naked -l /home/proj/.git /pub/scm/proj.git
117+
------------
118+
119+
120+
Create a repository on the kernel.org machine that borrows from Linus::
121+
+
122+
------------
123+
$ git clone --naked -l -s /pub/scm/.../torvalds/linux-2.6.git \
124+
/pub/scm/.../me/subsys-2.6.git
125+
------------
126+
127+
106128
Author
107129
------
108130
Written by Linus Torvalds <torvalds@osdl.org>

Documentation/git-show-branch.txt

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ git-show-branch - Show branches and their commits.
77

88
SYNOPSIS
99
--------
10-
'git-show-branch [--all] [--heads] [--tags] [--topo-order] [--more=<n> | --list | --independent | --merge-base] [--no-name | --sha1-name] [<rev> | <glob>]...'
10+
[verse]
11+
git-show-branch [--all] [--heads] [--tags] [--topo-order] [--current]
12+
[--more=<n> | --list | --independent | --merge-base]
13+
[--no-name | --sha1-name] [<rev> | <glob>]...
1114

1215
DESCRIPTION
1316
-----------
@@ -18,6 +21,9 @@ and/or $GIT_DIR/refs/tags) semi-visually.
1821

1922
It cannot show more than 29 branches and commits at a time.
2023

24+
It uses `showbranch.default` multi-valued configuration items if
25+
no <rev> nor <glob> is given on the command line.
26+
2127

2228
OPTIONS
2329
-------
@@ -35,6 +41,11 @@ OPTIONS
3541
Show all refs under $GIT_DIR/refs, $GIT_DIR/refs/heads,
3642
and $GIT_DIR/refs/tags, respectively.
3743

44+
--current::
45+
With this option, the command includes the current
46+
branch to the list of revs to be shown when it is not
47+
given on the command line.
48+
3849
--topo-order::
3950
By default, the branches and their commits are shown in
4051
reverse chronological order. This option makes them
@@ -50,7 +61,7 @@ OPTIONS
5061
tree.
5162

5263
--list::
53-
Synomym to `--more=-1`
64+
Synonym to `--more=-1`
5465

5566
--merge-base::
5667
Instead of showing the commit list, just act like the
@@ -78,21 +89,22 @@ OUTPUT
7889
------
7990
Given N <references>, the first N lines are the one-line
8091
description from their commit message. The branch head that is
81-
pointed at by $GIT_DIR/HEAD is prefixed with an asterisk '*'
82-
character while other heads are prefixed with a '!' character.
92+
pointed at by $GIT_DIR/HEAD is prefixed with an asterisk `*`
93+
character while other heads are prefixed with a `!` character.
8394

8495
Following these N lines, one-line log for each commit is
8596
displayed, indented N places. If a commit is on the I-th
86-
branch, the I-th indentation character shows a '+' sign;
87-
otherwise it shows a space. Each commit shows a short name that
97+
branch, the I-th indentation character shows a `+` sign;
98+
otherwise it shows a space. Merge commits are denoted by
99+
a `-` sign. Each commit shows a short name that
88100
can be used as an extended SHA1 to name that commit.
89101

90102
The following example shows three branches, "master", "fixes"
91103
and "mhf":
92104

93105
------------------------------------------------
94106
$ git show-branch master fixes mhf
95-
! [master] Add 'git show-branch'.
107+
* [master] Add 'git show-branch'.
96108
! [fixes] Introduce "reset type" flag to "git reset"
97109
! [mhf] Allow "+remote:local" refspec to cause --force when fetching.
98110
---
@@ -106,13 +118,33 @@ $ git show-branch master fixes mhf
106118
+ [mhf~6] Retire git-parse-remote.
107119
+ [mhf~7] Multi-head fetch.
108120
+ [mhf~8] Start adding the $GIT_DIR/remotes/ support.
109-
+++ [master] Add 'git show-branch'.
121+
*++ [master] Add 'git show-branch'.
110122
------------------------------------------------
111123

112124
These three branches all forked from a common commit, [master],
113125
whose commit message is "Add 'git show-branch'. "fixes" branch
114126
adds one commit 'Introduce "reset type"'. "mhf" branch has many
115-
other commits.
127+
other commits. The current branch is "master".
128+
129+
130+
EXAMPLE
131+
-------
132+
133+
If you keep your primary branches immediately under
134+
`$GIT_DIR/refs/heads`, and topic branches in subdirectories of
135+
it, having the following in the configuration file may help:
136+
137+
------------
138+
[showbranch]
139+
default = --topo-order
140+
default = heads/*
141+
142+
------------
143+
144+
With this,`git show-branch` without extra parameters would show
145+
only the primary branches. In addition, if you happen to be on
146+
your topic branch, it is shown as well.
147+
116148

117149

118150
Author

Documentation/howto/revert-branch-rebase.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ merge introduced 5 commits or so:
3232

3333
------------------------------------------------
3434
$ git show-branch --more=4 master master^2 | head
35-
! [master] Merge refs/heads/portable from http://www.cs.berkeley....
35+
* [master] Merge refs/heads/portable from http://www.cs.berkeley....
3636
! [master^2] Replace C99 array initializers with code.
3737
--
38-
+ [master] Merge refs/heads/portable from http://www.cs.berkeley....
39-
++ [master^2] Replace C99 array initializers with code.
40-
++ [master^2~1] Replace unsetenv() and setenv() with older putenv().
41-
++ [master^2~2] Include sys/time.h in daemon.c.
42-
++ [master^2~3] Fix ?: statements.
43-
++ [master^2~4] Replace zero-length array decls with [].
44-
+ [master~1] tutorial note about git branch
38+
- [master] Merge refs/heads/portable from http://www.cs.berkeley....
39+
*+ [master^2] Replace C99 array initializers with code.
40+
*+ [master^2~1] Replace unsetenv() and setenv() with older putenv().
41+
*+ [master^2~2] Include sys/time.h in daemon.c.
42+
*+ [master^2~3] Fix ?: statements.
43+
*+ [master^2~4] Replace zero-length array decls with [].
44+
* [master~1] tutorial note about git branch
4545
------------------------------------------------
4646

4747
The '--more=4' above means "after we reach the merge base of refs,
@@ -193,8 +193,8 @@ $ git show-branch --more=1 master pu rc
193193
+ [pu~4] Document "git cherry-pick" and "git revert"
194194
+ [pu~5] Remove git-apply-patch-script.
195195
+ [pu~6] Redo "revert" using three-way merge machinery.
196-
+ [rc] Merge refs/heads/master from .
197-
+++ [master] Revert "Replace zero-length array decls with []."
198-
+ [rc~1] Merge refs/heads/master from .
199-
+++ [master~1] Merge refs/heads/portable from http://www.cs.berkeley....
196+
- [rc] Merge refs/heads/master from .
197+
++* [master] Revert "Replace zero-length array decls with []."
198+
- [rc~1] Merge refs/heads/master from .
199+
... [master~1] Merge refs/heads/portable from http://www.cs.berkeley....
200200
------------------------------------------------

Documentation/tutorial.txt

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -968,8 +968,8 @@ $ git show-branch master mybranch
968968
* [master] Merge work in mybranch
969969
! [mybranch] Some work.
970970
--
971-
+ [master] Merge work in mybranch
972-
++ [mybranch] Some work.
971+
- [master] Merge work in mybranch
972+
*+ [mybranch] Some work.
973973
------------------------------------------------
974974

975975
The first two lines indicate that it is showing the two branches
@@ -979,7 +979,8 @@ top-of-the-tree commits, you are currently on `master` branch
979979
the later output lines is used to show commits contained in the
980980
`master` branch, and the second column for the `mybranch`
981981
branch. Three commits are shown along with their log messages.
982-
All of them have plus `+` characters in the first column, which
982+
All of them have non blank characters in the first column (`*`
983+
shows an ordinary commit on the current branch, `.` is a merge commit), which
983984
means they are now part of the `master` branch. Only the "Some
984985
work" commit has the plus `+` character in the second column,
985986
because `mybranch` has not been merged to incorporate these
@@ -1024,7 +1025,7 @@ $ git show-branch master mybranch
10241025
! [master] Merge work in mybranch
10251026
* [mybranch] Merge work in mybranch
10261027
--
1027-
++ [master] Merge work in mybranch
1028+
-- [master] Merge work in mybranch
10281029
------------------------------------------------
10291030

10301031

@@ -1199,9 +1200,9 @@ $ git show-branch --more=3 master mybranch
11991200
! [master] Merge work in mybranch
12001201
* [mybranch] Merge work in mybranch
12011202
--
1202-
++ [master] Merge work in mybranch
1203-
++ [master^2] Some work.
1204-
++ [master^] Some fun.
1203+
-- [master] Merge work in mybranch
1204+
+* [master^2] Some work.
1205+
+* [master^] Some fun.
12051206
------------
12061207

12071208
Remember, before running `git merge`, our `master` head was at
@@ -1223,8 +1224,8 @@ $ git show-branch
12231224
! [mybranch] Some work.
12241225
--
12251226
+ [mybranch] Some work.
1226-
+ [master] Some fun.
1227-
++ [mybranch^] New day.
1227+
* [master] Some fun.
1228+
*+ [mybranch^] New day.
12281229
------------
12291230

12301231
Now we are ready to experiment with the merge by hand.
@@ -1743,8 +1744,8 @@ $ git show-branch
17431744
+ [diff-fix] Fix rename detection.
17441745
+ [diff-fix~1] Better common substring algorithm.
17451746
+ [commit-fix] Fix commit message normalization.
1746-
+ [master] Release candidate #1
1747-
+++ [diff-fix~2] Pretty-print messages.
1747+
* [master] Release candidate #1
1748+
++* [diff-fix~2] Pretty-print messages.
17481749
------------
17491750

17501751
Both fixes are tested well, and at this point, you want to merge
@@ -1764,13 +1765,13 @@ $ git show-branch
17641765
! [diff-fix] Fix rename detection.
17651766
* [master] Merge fix in commit-fix
17661767
---
1767-
+ [master] Merge fix in commit-fix
1768-
+ + [commit-fix] Fix commit message normalization.
1769-
+ [master~1] Merge fix in diff-fix
1770-
++ [diff-fix] Fix rename detection.
1771-
++ [diff-fix~1] Better common substring algorithm.
1772-
+ [master~2] Release candidate #1
1773-
+++ [master~3] Pretty-print messages.
1768+
- [master] Merge fix in commit-fix
1769+
+ * [commit-fix] Fix commit message normalization.
1770+
- [master~1] Merge fix in diff-fix
1771+
+* [diff-fix] Fix rename detection.
1772+
+* [diff-fix~1] Better common substring algorithm.
1773+
* [master~2] Release candidate #1
1774+
++* [master~3] Pretty-print messages.
17741775
------------
17751776

17761777
However, there is no particular reason to merge in one branch
@@ -1797,12 +1798,12 @@ $ git show-branch
17971798
! [diff-fix] Fix rename detection.
17981799
* [master] Octopus merge of branches 'diff-fix' and 'commit-fix'
17991800
---
1800-
+ [master] Octopus merge of branches 'diff-fix' and 'commit-fix'
1801-
+ + [commit-fix] Fix commit message normalization.
1802-
++ [diff-fix] Fix rename detection.
1803-
++ [diff-fix~1] Better common substring algorithm.
1804-
+ [master~1] Release candidate #1
1805-
+++ [master~2] Pretty-print messages.
1801+
- [master] Octopus merge of branches 'diff-fix' and 'commit-fix'
1802+
+ * [commit-fix] Fix commit message normalization.
1803+
+* [diff-fix] Fix rename detection.
1804+
+* [diff-fix~1] Better common substring algorithm.
1805+
* [master~1] Release candidate #1
1806+
++* [master~2] Pretty-print messages.
18061807
------------
18071808

18081809
Note that you should not do Octopus because you can. An octopus

git-checkout.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ else
164164
esac
165165
exit 0
166166
)
167+
saved_err=$?
168+
git diff-files --name-status
169+
(exit $saved_err)
167170
fi
168171

169172
#

0 commit comments

Comments
 (0)