{"thread":{"id":"2380","subject":"[PATCH] Refactored merge options into separate merge-options.txt.","startedAt":"2005-11-07T05:30:56Z","lastAt":"2005-11-07T05:30:56Z","messageCount":1,"participants":["Jon Loeliger"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"11247","messageId":"E1EYzaq-0003py-6f@jdl.com","threadId":"2380","inReplyTo":null,"subject":"[PATCH] Refactored merge options into separate merge-options.txt.","fromName":"Jon Loeliger","fromEmail":"jdl@freescale.com","sentAt":"2005-11-07T05:30:56Z","receivedAt":"2005-11-07T05:30:56Z","isPatch":true,"sender":{"key":"jdl@jdl.com","avatar":"https://gravatar.com/avatar/75ce9a10b151acd2c28ec4ab2136dba7b2ff1634530bd04b155981a749d08a64?d=mp&s=160"},"body":"\nRefactored fetch options into separate fetch-options.txt.\nMade git-merge use merge-options.\nMade git-fetch use fetch-options.\nMade git-pull use merge-options and fetch-options.\nAdded --help option to git-pull and git-format-patch scripts.\nRewrote Documentation/Makefile to dynamically determine\ninclude dependencies.\n\nSigned-off-by: Jon Loeliger <jdl@freescale.com>\n\n---\n\n Documentation/Makefile            |   23 +++++++++++++----------\n Documentation/fetch-options.txt   |   14 ++++++++++++++\n Documentation/git-fetch.txt       |   16 ++++------------\n Documentation/git-merge.txt       |    2 +-\n Documentation/git-pull.txt        |   17 +++++++----------\n Documentation/merge-options.txt   |   16 ++++++++++++++++\n Documentation/merge-pull-opts.txt |   14 --------------\n git-format-patch.sh               |    4 ++++\n git-pull.sh                       |   12 +++++++++++-\n 9 files changed, 70 insertions(+), 48 deletions(-)\n create mode 100644 Documentation/fetch-options.txt\n create mode 100644 Documentation/merge-options.txt\n delete mode 100644 Documentation/merge-pull-opts.txt\n mode change 100755 => 100644 git-pull.sh\n\napplies-to: ba0221fabc6d203e08fbe63442e816ed84193bb1\n2cf02ee5ec5f3b5ecaec5a80399988661ea5117b\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex 741f14c..b8f62cb 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -49,22 +49,25 @@ install: man\n \t$(INSTALL) $(DOC_MAN1) $(DESTDIR)/$(man1)\n \t$(INSTALL) $(DOC_MAN7) $(DESTDIR)/$(man7)\n \n-# 'include' dependencies\n-$(patsubst %.txt,%.1,$(wildcard git-diff-*.txt)): \\\n-\tdiff-format.txt diff-options.txt\n-$(patsubst %.txt,%.html,$(wildcard git-diff-*.txt)): \\\n-\tdiff-format.txt diff-options.txt\n \n-$(patsubst %,%.1,git-fetch git-pull git-push): pull-fetch-param.txt\n-$(patsubst %,%.html,git-fetch git-pull git-push): pull-fetch-param.txt\n+#\n+# Determine \"include::\" file references in asciidoc files.\n+#\n+TEXTFILES = $(wildcard *.txt)\n+DEPFILES = $(TEXTFILES:%.txt=%.dep)\n+\n+%.dep : %.txt\n+\t@rm -rf $@\n+\t@$(foreach dep, $(shell grep include:: $< | sed -e 's/include::/ /' -e 's/\\[\\]//'), \\\n+\t\techo $(<:%.txt=%.html) $(<:%.txt=%.1) : $(dep) >> $@; )\n \n-$(patsubst %,%.1,git-merge git-pull): merge-pull-opts.txt\n-$(patsubst %,%.html,git-merge git-pull): merge-pull-opts.txt\n+-include $(DEPFILES)\n \n git.7: ../README\n \n+\n clean:\n-\trm -f *.xml *.html *.1 *.7 howto-index.txt howto/*.html\n+\trm -f *.xml *.html *.1 *.7 howto-index.txt howto/*.html *.dep\n \n %.html : %.txt\n \tasciidoc -b xhtml11 -d manpage -f asciidoc.conf $<\ndiff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt\nnew file mode 100644\nindex 0000000..12d12b2\n--- /dev/null\n+++ b/Documentation/fetch-options.txt\n@@ -0,0 +1,14 @@\n+-a, \\--append::\n+\tAppend ref names and object names of fetched refs to the\n+\texisting contents of `.git/FETCH_HEAD`.  Without this\n+\toption old data in `.git/FETCH_HEAD` will be overwritten.\n+\n+-f, \\--force::\n+\n+-t, \\--tags::\n+\n+-u, \\--update-head-ok::\n+\tBy default `git-fetch` refuses to update the head which\n+\tcorresponds to the current branch.  This flag disables the\n+\tcheck.  Note that fetching into the current branch will not\n+\tupdate the index and working directory, so use it with care.\ndiff --git a/Documentation/git-fetch.txt b/Documentation/git-fetch.txt\nindex 73f8a99..438240c 100644\n--- a/Documentation/git-fetch.txt\n+++ b/Documentation/git-fetch.txt\n@@ -8,7 +8,7 @@ git-fetch - Download objects and a head \n \n SYNOPSIS\n --------\n-'git-fetch' <repository> <refspec>...\n+'git-fetch' <options> <repository> <refspec>...\n \n \n DESCRIPTION\n@@ -17,24 +17,16 @@ Fetches named heads or tags from another\n the objects necessary to complete them.\n \n The ref names and their object names of fetched refs are stored\n-in $GIT_DIR/FETCH_HEAD.  This information is left for a later merge\n+in `.git/FETCH_HEAD`.  This information is left for a later merge\n operation done by \"git resolve\" or \"git octopus\".\n \n \n OPTIONS\n -------\n+include::fetch-options.txt[]\n+\n include::pull-fetch-param.txt[]\n \n--a, \\--append::\n-\tAppend ref names and object names of fetched refs to the\n-\texisting contents of $GIT_DIR/FETCH_HEAD.  Without this\n-\toption old data in $GIT_DIR/FETCH_HEAD will be overwritten.\n-\n--u, \\--update-head-ok::\n-\tBy default 'git-fetch' refuses to update the head which\n-\tcorresponds to the current branch.  This flag disables the\n-\tcheck.  Note that fetching into the current branch will not\n-\tupdate the index and working directory, so use it with care.\n \n \n SEE ALSO\ndiff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt\nindex b3ef19b..904e2fc 100644\n--- a/Documentation/git-merge.txt\n+++ b/Documentation/git-merge.txt\n@@ -19,7 +19,7 @@ which drives multiple merge strategy scr\n \n OPTIONS\n -------\n-include::merge-pull-opts.txt[]\n+include::merge-options.txt[]\n \n <msg>::\n \tThe commit message to be used for the merge commit (in case\ndiff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt\nindex 7ebb08d..c65ca9a 100644\n--- a/Documentation/git-pull.txt\n+++ b/Documentation/git-pull.txt\n@@ -20,21 +20,18 @@ Note that you can use `.` (current direc\n <repository> to pull from the local repository -- this is useful\n when merging local branches into the current branch.\n \n+\n OPTIONS\n -------\n-include::pull-fetch-param.txt[]\n+include::merge-options.txt[]\n \n--a, \\--append::\n-\tAppend ref names and object names of fetched refs to the\n-\texisting contents of `$GIT_DIR/FETCH_HEAD`.  Without this\n-\toption old data in `$GIT_DIR/FETCH_HEAD` will be overwritten.\n+include::fetch-options.txt[]\n \n-include::merge-pull-opts.txt[]\n+include::pull-fetch-param.txt[]\n \n include::merge-strategies.txt[]\n \n \n-\n EXAMPLES\n --------\n \n@@ -72,7 +69,7 @@ $ git fetch origin master:origin +pu:pu \n $ git pull . origin\n ------------------------------------------------\n +\n-Here, a typical `$GIT_DIR/remotes/origin` file from a\n+Here, a typical `.git/remotes/origin` file from a\n `git-clone` operation is used in combination with\n command line options to `git-fetch` to first update\n multiple branches of the local repository and then\n@@ -85,7 +82,7 @@ known to have already obtained and made \n all the necessary objects.\n \n \n-Pull of multiple branches from one repository using `$GIT_DIR/remotes` file::\n+Pull of multiple branches from one repository using `.git/remotes` file::\n +\n ------------------------------------------------\n $ cat .git/remotes/origin\n@@ -98,7 +95,7 @@ $ git checkout master\n $ git pull origin\n ------------------------------------------------\n +\n-Here, a typical `$GIT_DIR/remotes/origin` file from a\n+Here, a typical `.git/remotes/origin` file from a\n `git-clone` operation has been hand-modified to include\n the branch-mapping of additional remote and local\n heads directly.  A single `git-pull` operation while\ndiff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt\nnew file mode 100644\nindex 0000000..eebaf3a\n--- /dev/null\n+++ b/Documentation/merge-options.txt\n@@ -0,0 +1,16 @@\n+-n, \\--no-summary::\n+\tDo not show diffstat at the end of the merge.\n+\n+--no-commit::\n+\tPerform the merge but pretend the merge failed and do\n+\tnot autocommit, to give the user a chance to inspect and\n+\tfurther tweak the merge result before committing.\n+\n+\n+-s <strategy>, \\--strategy=<strategy>::\n+\tUse the given merge strategy; can be supplied more than\n+\tonce to specify them in the order they should be tried.\n+\tIf there is no `-s` option, a built-in list of strategies\n+\tis used instead (`git-merge-resolve` when merging a single\n+\thead, `git-merge-octopus` otherwise).\n+\ndiff --git a/Documentation/merge-pull-opts.txt b/Documentation/merge-pull-opts.txt\ndeleted file mode 100644\nindex d9164a0..0000000\n--- a/Documentation/merge-pull-opts.txt\n+++ /dev/null\n@@ -1,14 +0,0 @@\n--n, --no-summary::\n-\tDo not show diffstat at the end of the merge.\n-\n---no-commit::\n-\tPerform the merge but pretend the merge failed and do\n-\tnot autocommit, to give the user a chance to inspect and\n-\tfurther tweak the merge result before committing.\n-\n--s <strategy>::\n-\tuse that merge strategy; can be given more than once to\n-\tspecify them in the order they should be tried.  If\n-\tthere is no `-s` option, built-in list of strategies is\n-\tused instead (`git-merge-resolve` when merging a single\n-\thead, `git-merge-octopus` otherwise).\ndiff --git a/git-format-patch.sh b/git-format-patch.sh\nindex b43ba39..548d2d5 100755\n--- a/git-format-patch.sh\n+++ b/git-format-patch.sh\n@@ -8,6 +8,7 @@\n usage () {\n     echo >&2 \"usage: $0\"' [-n] [-o dir | --stdout] [--keep-subject] [--mbox]\n     [--check] [--signoff] [-<diff options>...]\n+    [--help]\n     ( from..to ... | upstream [ our-head ] )\n \n Prepare each commit with its patch since our-head forked from upstream,\n@@ -63,6 +64,9 @@ do\n     --output-directo|--output-director|--output-directory)\n     case \"$#\" in 1) usage ;; esac; shift\n     outdir=\"$1\" ;;\n+    -h|--h|--he|--hel|--help)\n+        usage\n+\t;;\n     -*' '* | -*\"$LF\"* | -*'\t'*)\n \t# Ignore diff option that has whitespace for now.\n \t;;\ndiff --git a/git-pull.sh b/git-pull.sh\nold mode 100755\nnew mode 100644\nindex e23d4f5..2358af6\n--- a/git-pull.sh\n+++ b/git-pull.sh\n@@ -7,7 +7,14 @@\n . git-sh-setup || die \"Not a git archive\"\n \n usage () {\n-    die \"git pull [-n] [--no-commit] [-s strategy]... <repo> <head>...\"\n+    echo >&2 \"usage: $0\"' [-n] [--no-commit] [--no-summary] [--help]\n+    [-s strategy]...\n+    [<fetch-options>]\n+    <repo> <head>...\n+\n+Fetch one or more remote refs and merge it/them into the current HEAD.\n+'\n+    exit 1\n }\n \n strategy_args= no_summary= no_commit=\n@@ -33,6 +40,9 @@ do\n \t\tesac\n \t\tstrategy_args=\"${strategy_args}-s $strategy \"\n \t\t;;\n+\t-h|--h|--he|--hel|--help)\n+\t\tusage\n+\t\t;;\n \t-*)\n \t\t# Pass thru anything that is meant for fetch.\n \t\tbreak\n---\n0.99.9.GIT\n"}]}