Refactored merge options into separate merge-options.txt.
Refactored fetch options into separate fetch-options.txt. Made git-merge use merge-options. Made git-fetch use fetch-options. Made git-pull use merge-options and fetch-options. Added --help option to git-pull and git-format-patch scripts. Rewrote Documentation/Makefile to dynamically determine include dependencies. Signed-off-by: Jon Loeliger <jdl@freescale.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Jon Loeliger committed
Nov 6, 2005 at 23:30 UTC
93d69d86912c44206543f6670e93f9fc6f2f859f
9 files changed
+70
-48
Documentation/Makefile
+13
-10
@@ -49,22 +49,25 @@ install: man
49
$(INSTALL) $(DOC_MAN1) $(DESTDIR)/$(man1)
50
$(INSTALL) $(DOC_MAN7) $(DESTDIR)/$(man7)
51
52
-# 'include' dependencies
53
-$(patsubst %.txt,%.1,$(wildcard git-diff-*.txt)): \
54
- diff-format.txt diff-options.txt
55
-$(patsubst %.txt,%.html,$(wildcard git-diff-*.txt)): \
56
- diff-format.txt diff-options.txt
52
58
-$(patsubst %,%.1,git-fetch git-pull git-push): pull-fetch-param.txt
59
-$(patsubst %,%.html,git-fetch git-pull git-push): pull-fetch-param.txt
53
+#
54
+# Determine "include::" file references in asciidoc files.
55
+#
56
+TEXTFILES = $(wildcard *.txt)
57
+DEPFILES = $(TEXTFILES:%.txt=%.dep)
58
61
-$(patsubst %,%.1,git-merge git-pull): merge-pull-opts.txt
62
-$(patsubst %,%.html,git-merge git-pull): merge-pull-opts.txt
59
+%.dep : %.txt
60
+ @rm -f $@
61
+ @$(foreach dep, $(shell grep include:: $< | sed -e 's/include::/ /' -e 's/\[\]//'), \
62
+ echo $(<:%.txt=%.html) $(<:%.txt=%.1) : $(dep) >> $@; )
63
+
64
+-include $(DEPFILES)
65
66
git.7: ../README
67
68
+
69
clean:
67
- rm -f *.xml *.html *.1 *.7 howto-index.txt howto/*.html
70
+ rm -f *.xml *.html *.1 *.7 howto-index.txt howto/*.html *.dep
71
72
%.html : %.txt
73
asciidoc -b xhtml11 -d manpage -f asciidoc.conf $<
Documentation/fetch-options.txt
new
+14
@@ -0,0 +1,14 @@
1
+-a, \--append::
2
+ Append ref names and object names of fetched refs to the
3
+ existing contents of `.git/FETCH_HEAD`. Without this
4
+ option old data in `.git/FETCH_HEAD` will be overwritten.
5
+
6
+-f, \--force::
7
+
8
+-t, \--tags::
9
+
10
+-u, \--update-head-ok::
11
+ By default `git-fetch` refuses to update the head which
12
+ corresponds to the current branch. This flag disables the
13
+ check. Note that fetching into the current branch will not
14
+ update the index and working directory, so use it with care.
Documentation/git-fetch.txt
+4
-12
@@ -8,7 +8,7 @@ git-fetch - Download objects and a head from another repository.
8
9
SYNOPSIS
10
--------
11
-'git-fetch' <repository> <refspec>...
11
+'git-fetch' <options> <repository> <refspec>...
12
13
14
DESCRIPTION
@@ -17,24 +17,16 @@ Fetches named heads or tags from another repository, along with
17
the objects necessary to complete them.
18
19
The ref names and their object names of fetched refs are stored
20
-in $GIT_DIR/FETCH_HEAD. This information is left for a later merge
20
+in `.git/FETCH_HEAD`. This information is left for a later merge
21
operation done by "git resolve" or "git octopus".
22
23
24
OPTIONS
25
-------
26
-include::pull-fetch-param.txt[]
26
+include::fetch-options.txt[]
27
28
--a, \--append::
29
- Append ref names and object names of fetched refs to the
30
- existing contents of $GIT_DIR/FETCH_HEAD. Without this
31
- option old data in $GIT_DIR/FETCH_HEAD will be overwritten.
28
+include::pull-fetch-param.txt[]
29
33
--u, \--update-head-ok::
34
- By default 'git-fetch' refuses to update the head which
35
- corresponds to the current branch. This flag disables the
36
- check. Note that fetching into the current branch will not
37
- update the index and working directory, so use it with care.
30
31
32
SEE ALSO
Documentation/git-merge.txt
+1
-1
@@ -19,7 +19,7 @@ which drives multiple merge strategy scripts.
19
20
OPTIONS
21
-------
22
-include::merge-pull-opts.txt[]
22
+include::merge-options.txt[]
23
24
<msg>::
25
The commit message to be used for the merge commit (in case
Documentation/git-pull.txt
+7
-10
@@ -20,21 +20,18 @@ Note that you can use `.` (current directory) as the
20
<repository> to pull from the local repository -- this is useful
21
when merging local branches into the current branch.
22
23
+
24
OPTIONS
25
-------
25
-include::pull-fetch-param.txt[]
26
+include::merge-options.txt[]
27
27
--a, \--append::
28
- Append ref names and object names of fetched refs to the
29
- existing contents of `$GIT_DIR/FETCH_HEAD`. Without this
30
- option old data in `$GIT_DIR/FETCH_HEAD` will be overwritten.
28
+include::fetch-options.txt[]
29
32
-include::merge-pull-opts.txt[]
30
+include::pull-fetch-param.txt[]
31
32
include::merge-strategies.txt[]
33
34
37
-
35
EXAMPLES
36
--------
37
@@ -72,7 +69,7 @@ $ git fetch origin master:origin +pu:pu maint:maint
69
$ git pull . origin
70
------------------------------------------------
71
+
75
-Here, a typical `$GIT_DIR/remotes/origin` file from a
72
+Here, a typical `.git/remotes/origin` file from a
73
`git-clone` operation is used in combination with
74
command line options to `git-fetch` to first update
75
multiple branches of the local repository and then
@@ -85,7 +82,7 @@ known to have already obtained and made available
82
all the necessary objects.
83
84
88
-Pull of multiple branches from one repository using `$GIT_DIR/remotes` file::
85
+Pull of multiple branches from one repository using `.git/remotes` file::
86
+
87
------------------------------------------------
88
$ cat .git/remotes/origin
@@ -98,7 +95,7 @@ $ git checkout master
95
$ git pull origin
96
------------------------------------------------
97
+
101
-Here, a typical `$GIT_DIR/remotes/origin` file from a
98
+Here, a typical `.git/remotes/origin` file from a
99
`git-clone` operation has been hand-modified to include
100
the branch-mapping of additional remote and local
101
heads directly. A single `git-pull` operation while
Documentation/merge-options.txt
new
+16
@@ -0,0 +1,16 @@
1
+-n, \--no-summary::
2
+ Do not show diffstat at the end of the merge.
3
+
4
+--no-commit::
5
+ Perform the merge but pretend the merge failed and do
6
+ not autocommit, to give the user a chance to inspect and
7
+ further tweak the merge result before committing.
8
+
9
+
10
+-s <strategy>, \--strategy=<strategy>::
11
+ Use the given merge strategy; can be supplied more than
12
+ once to specify them in the order they should be tried.
13
+ If there is no `-s` option, a built-in list of strategies
14
+ is used instead (`git-merge-resolve` when merging a single
15
+ head, `git-merge-octopus` otherwise).
16
+
Documentation/merge-pull-opts.txt
deleted
-14
@@ -1,14 +0,0 @@
1
--n, --no-summary::
2
- Do not show diffstat at the end of the merge.
3
-
4
---no-commit::
5
- Perform the merge but pretend the merge failed and do
6
- not autocommit, to give the user a chance to inspect and
7
- further tweak the merge result before committing.
8
-
9
--s <strategy>::
10
- use that merge strategy; can be given more than once to
11
- specify them in the order they should be tried. If
12
- there is no `-s` option, built-in list of strategies is
13
- used instead (`git-merge-resolve` when merging a single
14
- head, `git-merge-octopus` otherwise).
git-format-patch.sh
+4
@@ -8,6 +8,7 @@
8
usage () {
9
echo >&2 "usage: $0"' [-n] [-o dir | --stdout] [--keep-subject] [--mbox]
10
[--check] [--signoff] [-<diff options>...]
11
+ [--help]
12
( from..to ... | upstream [ our-head ] )
13
14
Prepare each commit with its patch since our-head forked from upstream,
@@ -63,6 +64,9 @@ do
64
--output-directo|--output-director|--output-directory)
65
case "$#" in 1) usage ;; esac; shift
66
outdir="$1" ;;
67
+ -h|--h|--he|--hel|--help)
68
+ usage
69
+ ;;
70
-*' '* | -*"$LF"* | -*' '*)
71
# Ignore diff option that has whitespace for now.
72
;;
git-pull.sh
+11
-1
@@ -7,7 +7,14 @@
7
. git-sh-setup || die "Not a git archive"
8
9
usage () {
10
- die "git pull [-n] [--no-commit] [-s strategy]... <repo> <head>..."
10
+ echo >&2 "usage: $0"' [-n] [--no-commit] [--no-summary] [--help]
11
+ [-s strategy]...
12
+ [<fetch-options>]
13
+ <repo> <head>...
14
+
15
+Fetch one or more remote refs and merge it/them into the current HEAD.
16
+'
17
+ exit 1
18
}
19
20
strategy_args= no_summary= no_commit=
@@ -33,6 +40,9 @@ do
40
esac
41
strategy_args="${strategy_args}-s $strategy "
42
;;
43
+ -h|--h|--he|--hel|--help)
44
+ usage
45
+ ;;
46
-*)
47
# Pass thru anything that is meant for fetch.
48
break