diff options
Diffstat (limited to 'Documentation')
156 files changed, 1851 insertions, 469 deletions
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines index 994eb9159a..d2a0a76e6c 100644 --- a/Documentation/CodingGuidelines +++ b/Documentation/CodingGuidelines @@ -89,6 +89,8 @@ For C programs: of "else if" statements, it can make sense to add braces to single line blocks. + - We try to avoid assignments inside if(). + - Try to make your code understandable. You may put comments in, but comments invariably tend to stale out when the code they were describing changes. Often splitting a function diff --git a/Documentation/Makefile b/Documentation/Makefile index 43781fb248..62269e39c4 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -1,9 +1,12 @@ MAN1_TXT= \ $(filter-out $(addsuffix .txt, $(ARTICLES) $(SP_ARTICLES)), \ $(wildcard git-*.txt)) \ - gitk.txt -MAN5_TXT=gitattributes.txt gitignore.txt gitcli.txt gitmodules.txt -MAN7_TXT=git.txt + gitk.txt git.txt +MAN5_TXT=gitattributes.txt gitignore.txt gitmodules.txt githooks.txt \ + gitrepository-layout.txt +MAN7_TXT=gitcli.txt gittutorial.txt gittutorial-2.txt \ + gitcvs-migration.txt gitcore-tutorial.txt gitglossary.txt \ + gitdiffcore.txt MAN_TXT = $(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT) MAN_XML=$(patsubst %.txt,%.xml,$(MAN_TXT)) @@ -11,17 +14,9 @@ MAN_HTML=$(patsubst %.txt,%.html,$(MAN_TXT)) DOC_HTML=$(MAN_HTML) -ARTICLES = tutorial -ARTICLES += tutorial-2 -ARTICLES += core-tutorial -ARTICLES += cvs-migration -ARTICLES += diffcore -ARTICLES += howto-index -ARTICLES += repository-layout -ARTICLES += hooks +ARTICLES = howto-index ARTICLES += everyday ARTICLES += git-tools -ARTICLES += glossary # with their own formatting rules. SP_ARTICLES = howto/revert-branch-rebase howto/using-merge-subtree user-manual API_DOCS = $(patsubst %.txt,%,$(filter-out technical/api-index-skel.txt technical/api-index.txt, $(wildcard technical/api-*.txt))) @@ -144,8 +139,6 @@ cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT) $(PERL_PATH) ./cmd-list.perl ../command-list.txt date >$@ -git.7 git.html: git.txt - clean: $(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7 $(RM) *.texi *.texi+ git.info gitman.info diff --git a/Documentation/RelNotes-1.5.6.txt b/Documentation/RelNotes-1.5.6.txt new file mode 100644 index 0000000000..1855cf3923 --- /dev/null +++ b/Documentation/RelNotes-1.5.6.txt @@ -0,0 +1,110 @@ +GIT v1.5.6 Release Notes +======================== + +Updates since v1.5.5 +-------------------- + +(subsystems) + +* Comes with updated gitk and git-gui. + +(portability) + +* git will build on AIX better than before now. + +* core.ignorecase configuration variable can be used to work better on + filesystems that are not case sensitive. + +* "git init" now autodetects the case sensitivity of the filesystem and + sets core.ignorecase accordingly. + +(performance) + +* "git clone" was rewritten in C. This will hopefully help cloning a + repository with insane number of refs. + +* "git rebase --onto $there $from $branch" used to switch to the tip of + $branch only to immediately reset back to $from, smudging work tree + files unnecessarily. This has been optimized. + +* Object creation codepath in "git-svn" has been optimized by enhancing + plumbing commands git-cat-file and git-hash-object. + +(usability, bells and whistles) + +* "git add -p" (and the "patch" subcommand of "git add -i") can choose to + apply (or not apply) mode changes independently from contents changes. + +* "git bisect help" gives longer and more helpful usage information. + +* "git bisect" does not use a special branch "bisect" anymore; instead, it + does its work on a detached HEAD. + +* "git branch" (and "git checkout -b") can be told to set up + branch.<name>.rebase automatically, so that later you can say "git pull" + and magically cause "git pull --rebase" to happen. + +* "git branch --merged" and "git branch --no-merged" can be used to list + branches that have already been merged (or not yet merged) to the + current branch. + +* "git cherry-pick" and "git revert" can add a sign-off. + +* "git commit" mentions the author identity when you are committing + somebody else's changes. + +* "git diff/log --dirstat" output is consistent between binary and textual + changes. + +* "git filter-branch" rewrites signed tags by demoting them to annotated. + +* "git format-patch --no-binary" can produce a patch that lack binary + changes (i.e. cannot be used to propagate the whole changes) meant only + for reviewing. + +* "git init --bare" is a synonym for "git --bare init" now. + +* "git gc --auto" honors a new pre-aut-gc hook to temporarily disable it. + +* "git log --pretty=tformat:<custom format>" gives a LF after each entry, + instead of giving a LF between each pair of entries which is how + "git log --pretty=format:<custom format>" works. + +* "git log" and friends learned the "--graph" option to show the ancestry + graph at the left margin of the output. + +* "git log" and friends can be told to use date format that is different + from the default via 'log.date' configuration variable. + +* "git send-email" now can send out messages outside a git repository. + +* "git send-email --compose" was made aware of rfc2047 quoting. + +* "git status" can optionally include output from "git submodule + summary". + +* "git svn" learned --add-author-from option to propagate the authorship + by munging the commit log message. + +* new object creation and looking up in "git svn" has been optimized. + +* "gitweb" can read from a system-wide configuration file. + +(internal) + +* "git unpack-objects" and "git receive-pack" is now more strict about + detecting breakage in the objects they receive over the wire. + + +Fixes since v1.5.5 +------------------ + +All of the fixes in v1.5.5 maintenance series are included in +this release, unless otherwise noted. + + +-- +exec >/var/tmp/1 +O=v1.5.6-rc1 +echo O=`git describe refs/heads/master` +git shortlog --no-merges $O..refs/heads/master ^refs/heads/maint diff --git a/Documentation/config.txt b/Documentation/config.txt index 273b358069..5331b450ea 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -205,10 +205,13 @@ Can be overridden by the 'GIT_PROXY_COMMAND' environment variable handling). core.ignoreStat:: - The working copy files are assumed to stay unchanged until you - mark them otherwise manually - Git will not detect the file changes - by lstat() calls. This is useful on systems where those are very - slow, such as Microsoft Windows. See linkgit:git-update-index[1]. + If true, commands which modify both the working tree and the index + will mark the updated paths with the "assume unchanged" bit in the + index. These marked files are then assumed to stay unchanged in the + working copy, until you mark them otherwise manually - Git will not + detect the file changes by lstat() calls. This is useful on systems + where those are very slow, such as Microsoft Windows. + See linkgit:git-update-index[1]. False by default. core.preferSymlinkRefs:: @@ -234,7 +237,13 @@ core.worktree:: used in combination with repositories found automatically in a .git directory (i.e. $GIT_DIR is not set). This can be overridden by the GIT_WORK_TREE environment - variable and the '--work-tree' command line option. + variable and the '--work-tree' command line option. It can be + a absolute path or relative path to the directory specified by + --git-dir or GIT_DIR. + Note: If --git-dir or GIT_DIR are specified but none of + --work-tree, GIT_WORK_TREE and core.worktree is specified, + the current working directory is regarded as the top directory + of your working tree. core.logAllRefUpdates:: Enable the reflog. Updates to a ref <ref> is logged to the file @@ -261,7 +270,12 @@ core.sharedRepository:: group-writable). When 'all' (or 'world' or 'everybody'), the repository will be readable by all users, additionally to being group-shareable. When 'umask' (or 'false'), git will use permissions - reported by umask(2). See linkgit:git-init[1]. False by default. + reported by umask(2). When '0xxx', where '0xxx' is an octal number, + files in the repository will have this mode value. '0xxx' will override + user's umask value, and thus, users with a safe umask (0077) can use + this option. Examples: '0660' is equivalent to 'group'. '0640' is a + repository that is group-readable but not group-writable. + See linkgit:git-init[1]. False by default. core.warnAmbiguousRefs:: If true, git will warn you if the ref name you passed it is ambiguous @@ -388,6 +402,21 @@ branch.autosetupmerge:: done when the starting point is either a local branch or remote branch. This option defaults to true. +branch.autosetuprebase:: + When a new branch is created with `git-branch` or `git-checkout` + that tracks another branch, this variable tells git to set + up pull to rebase instead of merge (see "branch.<name>.rebase"). + When `never`, rebase is never automatically set to true. + When `local`, rebase is set to true for tracked branches of + other local branches. + When `remote`, rebase is set to true for tracked branches of + remote branches. + When `always`, rebase will be set to true for all tracking + branches. + See "branch.autosetupmerge" for details on how to set up a + branch to track another branch. + This option defaults to never. + branch.<name>.remote:: When in branch <name>, it tells `git fetch` which remote to fetch. If this option is not given, `git fetch` defaults to remote "origin". @@ -497,8 +526,10 @@ color.status.<slot>:: one of `header` (the header text of the status message), `added` or `updated` (files which are added but not committed), `changed` (files which are changed but not added in the index), - or `untracked` (files which are not tracked by git). The values of - these variables may be specified as in color.branch.<slot>. + `untracked` (files which are not tracked by git), or + `nobranch` (the color the 'no branch' warning is shown in, defaulting + to red). The values of these variables may be specified as in + color.branch.<slot>. commit.template:: Specify a file to use as the template for new commit messages. @@ -634,11 +665,24 @@ gitcvs.logfile:: Path to a log file where the CVS server interface well... logs various stuff. See linkgit:git-cvsserver[1]. +gitcvs.usecrlfattr + If true, the server will look up the `crlf` attribute for + files to determine the '-k' modes to use. If `crlf` is set, + the '-k' mode will be left blank, so cvs clients will + treat it as text. If `crlf` is explicitly unset, the file + will be set with '-kb' mode, which supresses any newline munging + the client might otherwise do. If `crlf` is not specified, + then 'gitcvs.allbinary' is used. See linkgit:gitattribute[5]. + gitcvs.allbinary:: - If true, all files are sent to the client in mode '-kb'. This - causes the client to treat all files as binary files which suppresses - any newline munging it otherwise might do. A work-around for the - fact that there is no way yet to set single files to mode '-kb'. + This is used if 'gitcvs.usecrlfattr' does not resolve + the correct '-kb' mode to use. If true, all + unresolved files are sent to the client in + mode '-kb'. This causes the client to treat them + as binary files, which suppresses any newline munging it + otherwise might do. Alternatively, if it is set to "guess", + then the contents of the file are examined to decide if + it is binary, similar to 'core.autocrlf'. gitcvs.dbname:: Database used by git-cvsserver to cache revision information @@ -669,11 +713,42 @@ gitcvs.dbTableNamePrefix:: linkgit:git-cvsserver[1] for details). Any non-alphabetic characters will be replaced with underscores. -All gitcvs variables except for 'gitcvs.allbinary' can also be -specified as 'gitcvs.<access_method>.<varname>' (where 'access_method' +All gitcvs variables except for 'gitcvs.usecrlfattr' and +'gitcvs.allbinary' can also be specified as +'gitcvs.<access_method>.<varname>' (where 'access_method' is one of "ext" and "pserver") to make them apply only for the given access method. +gui.commitmsgwidth:: + Defines how wide the commit message window is in the + linkgit:git-gui[1]. "75" is the default. + +gui.diffcontext:: + Specifies how many context lines should be used in calls to diff + made by the linkgit:git-gui[1]. The default is "5". + +gui.matchtrackingbranch:: + Determines if new branches created with linkgit:git-gui[1] should + default to tracking remote branches with matching names or + not. Default: "false". + +gui.newbranchtemplate:: + Is used as suggested name when creating new branches using the + linkgit:git-gui[1]. + +gui.pruneduringfetch:: + "true" if linkgit:git-gui[1] should prune tracking branches when + performing a fetch. The default value is "false". + +gui.trustmtime:: + Determines if linkgit:git-gui[1] should trust the file modification + timestamp or not. By default the timestamps are not trusted. + +gui.spellingdictionary:: + Specifies the dictionary used for spell checking commit messages in + the linkgit:git-gui[1]. When set to "none" spell checking is turned + off. + help.browser:: Specify the browser that will be used to display help in the 'web' format. See linkgit:git-help[1]. @@ -759,6 +834,12 @@ instaweb.port:: The port number to bind the gitweb httpd to. See linkgit:git-instaweb[1]. +log.date:: + Set default date-time mode for the log command. Setting log.date + value is similar to using git log's --date option. The value is one of + following alternatives: {relative,local,default,iso,rfc,short}. + See linkgit:git-log[1]. + log.showroot:: If true, the initial commit will be shown as a big creation event. This is equivalent to a diff against an empty tree. @@ -769,37 +850,16 @@ man.viewer:: Specify the programs that may be used to display help in the 'man' format. See linkgit:git-help[1]. -merge.summary:: - Whether to include summaries of merged commits in newly created - merge commit messages. False by default. - -merge.tool:: - Controls which merge resolution program is used by - linkgit:git-mergetool[1]. Valid built-in values are: "kdiff3", - "tkdiff", "meld", "xxdiff", "emerge", "vimdiff", "gvimdiff", and - "opendiff". Any other value is treated is custom merge tool - and there must be a corresponing mergetool.<tool>.cmd option. - -merge.verbosity:: - Controls the amount of output shown by the recursive merge - strategy. Level 0 outputs nothing except a final error - message if conflicts were detected. Level 1 outputs only - conflicts, 2 outputs conflicts and file changes. Level 5 and - above outputs debugging information. The default is level 2. - Can be overridden by 'GIT_MERGE_VERBOSITY' environment variable. - -merge.<driver>.name:: - Defines a human readable name for a custom low-level - merge driver. See linkgit:gitattributes[5] for details. - -merge.<driver>.driver:: - Defines the command that implements a custom low-level - merge driver. See linkgit:gitattributes[5] for details. - -merge.<driver>.recursive:: - Names a low-level merge driver to be used when - performing an internal merge between common ancestors. - See linkgit:gitattributes[5] for details. +include::merge-config.txt[] + +man.<tool>.cmd:: + Specify the command to invoke the specified man viewer. The + specified command is evaluated in shell with the man page + passed as argument. (See linkgit:git-help[1].) + +man.<tool>.path:: + Override the path for the given tool that may be used to + display help in the 'man' format. See linkgit:git-help[1]. mergetool.<tool>.path:: Override the path for the given tool. This is useful in case @@ -911,6 +971,10 @@ remote.<name>.push:: The default set of "refspec" for linkgit:git-push[1]. See linkgit:git-push[1]. +remote.<name>.mirror:: + If true, pushing to this remote will automatically behave + as if the `\--mirror` option was given on the command line. + remote.<name>.skipDefaultUpdate:: If true, this remote will be skipped by default when updating using the update subcommand of linkgit:git-remote[1]. @@ -992,6 +1056,12 @@ imap:: The configuration variables in the 'imap' section are described in linkgit:git-imap-send[1]. +receive.fsckObjects:: + If it is set to true, git-receive-pack will check all received + objects. It will abort in the case of a malformed object or a + broken link. The result of an abort are only dangling objects. + Defaults to false. + receive.unpackLimit:: If the number of objects received in a push is below this limit then the objects will be unpacked into loose object diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 13234fa280..572154834b 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -228,6 +228,9 @@ endif::git-format-patch[] --no-ext-diff:: Disallow external diff drivers. +--ignore-submodules:: + Ignore changes to submodules in the diff generation. + --src-prefix=<prefix>:: Show the given source prefix instead of "a/". @@ -238,4 +241,4 @@ endif::git-format-patch[] Do not show any source or destination prefix. For more detailed explanation on these common options, see also -link:diffcore.html[diffcore documentation]. +linkgit:gitdiffcore[7][diffcore documentation]. diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt index e2389e380b..88165da38f 100644 --- a/Documentation/git-add.txt +++ b/Documentation/git-add.txt @@ -9,7 +9,7 @@ SYNOPSIS -------- [verse] 'git-add' [-n] [-v] [-f] [--interactive | -i] [--patch | -p] [-u] [--refresh] - [--] <filepattern>... + [--ignore-errors] [--] <filepattern>... DESCRIPTION ----------- @@ -83,6 +83,11 @@ OPTIONS Don't add the file(s), but only refresh their stat() information in the index. +\--ignore-errors:: + If some files could not be added because of errors indexing + them, do not abort the operation, but continue adding the + others. The command shall still exit with non-zero status. + \--:: This option can be used to separate command-line options from the list of files, (useful when filenames might be mistaken @@ -95,26 +100,32 @@ Configuration The optional configuration variable 'core.excludesfile' indicates a path to a file containing patterns of file names to exclude from git-add, similar to $GIT_DIR/info/exclude. Patterns in the exclude file are used in addition to -those in info/exclude. See link:repository-layout.html[repository layout]. +those in info/exclude. See linkgit:gitrepository-layout[5][repository layout]. EXAMPLES -------- -git-add Documentation/\\*.txt:: - Adds content from all `\*.txt` files under `Documentation` - directory and its subdirectories. +* Adds content from all `\*.txt` files under `Documentation` directory +and its subdirectories: ++ +------------ +$ git add Documentation/\\*.txt +------------ + Note that the asterisk `\*` is quoted from the shell in this example; this lets the command to include the files from subdirectories of `Documentation/` directory. -git-add git-*.sh:: - - Considers adding content from all git-*.sh scripts. - Because this example lets shell expand the asterisk - (i.e. you are listing the files explicitly), it does not - consider `subdir/git-foo.sh`. +* Considers adding content from all git-*.sh scripts: ++ +------------ +$ git add git-*.sh +------------ ++ +Because this example lets shell expand the asterisk (i.e. you are +listing the files explicitly), it does not consider +`subdir/git-foo.sh`. Interactive mode ---------------- @@ -235,7 +246,7 @@ characters that need C-quoting. `core.quotepath` configuration can be used to work this limitation around to some degree, but backslash, double-quote and control characters will still have problems. -See Also +SEE ALSO -------- linkgit:git-status[1] linkgit:git-rm[1] @@ -254,4 +265,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt index 2387a8d6c2..7f6f5b472a 100644 --- a/Documentation/git-am.txt +++ b/Documentation/git-am.txt @@ -153,4 +153,4 @@ Documentation by Petr Baudis, Junio C Hamano and the git-list <git@vger.kernel.o GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-annotate.txt b/Documentation/git-annotate.txt index 45a6a7251e..da15379ae5 100644 --- a/Documentation/git-annotate.txt +++ b/Documentation/git-annotate.txt @@ -28,4 +28,4 @@ Written by Ryan Anderson <ryan@michonline.com>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-apply.txt b/Documentation/git-apply.txt index 2dec2ec1cf..76277bd178 100644 --- a/Documentation/git-apply.txt +++ b/Documentation/git-apply.txt @@ -206,4 +206,4 @@ Documentation by Junio C Hamano GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-archimport.txt b/Documentation/git-archimport.txt index bd20fd8206..603117c796 100644 --- a/Documentation/git-archimport.txt +++ b/Documentation/git-archimport.txt @@ -117,4 +117,4 @@ Documentation by Junio C Hamano, Martin Langhoff and the git-list <git@vger.kern GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-archive.txt b/Documentation/git-archive.txt index d3eaa16af1..a3e36dbb0d 100644 --- a/Documentation/git-archive.txt +++ b/Documentation/git-archive.txt @@ -118,4 +118,4 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt index 0855b98b28..37c7acbe9f 100644 --- a/Documentation/git-bisect.txt +++ b/Documentation/git-bisect.txt @@ -15,6 +15,7 @@ DESCRIPTION The command takes various subcommands, and different options depending on the subcommand: + git bisect help git bisect start [<bad> [<good>...]] [--] [<paths>...] git bisect bad [<rev>] git bisect good [<rev>...] @@ -29,6 +30,12 @@ This command uses 'git-rev-list --bisect' option to help drive the binary search process to find which change introduced a bug, given an old "good" commit object name and a later "bad" commit object name. +Getting help +~~~~~~~~~~~~ + +Use "git bisect" to get a short usage description, and "git bisect +help" or "git bisect -h" to get a long usage description. + Basic bisect commands: start, bad, good ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -217,6 +224,55 @@ tree to the pristine state. Finally the "run" script can exit with the status of the real test to let "git bisect run" command loop to know the outcome. +EXAMPLES +-------- + +* Automatically bisect a broken build between v1.2 and HEAD: ++ +------------ +$ git bisect start HEAD v1.2 -- # HEAD is bad, v1.2 is good +$ git bisect run make # "make" builds the app +------------ + +* Automatically bisect a broken test suite: ++ +------------ +$ cat ~/test.sh +#!/bin/sh +make || exit 125 # this "skip"s broken builds +make test # "make test" runs the test suite +$ git bisect start v1.3 v1.1 -- # v1.3 is bad, v1.1 is good +$ git bisect run ~/test.sh +------------ ++ +Here we use a "test.sh" custom script. In this script, if "make" +fails, we "skip" the current commit. ++ +It's safer to use a custom script outside the repo to prevent +interactions between the bisect, make and test processes and the +script. ++ +And "make test" should "exit 0", if the test suite passes, and +"exit 1" (for example) otherwise. + +* Automatically bisect a broken test case: ++ +------------ +$ cat ~/test.sh +#!/bin/sh +make || exit 125 # this "skip"s broken builds +~/check_test_case.sh # does the test case passes ? +$ git bisect start HEAD HEAD~10 -- # culprit is among the last 10 +$ git bisect run ~/test.sh +------------ ++ +Here "check_test_case.sh" should "exit 0", if the test case passes, +and "exit 1" (for example) otherwise. ++ +It's safer if both "test.sh" and "check_test_case.sh" scripts are +outside the repo to prevent interactions between the bisect, make and +test processes and the scripts. + Author ------ Written by Linus Torvalds <torvalds@osdl.org> @@ -227,4 +283,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-blame.txt b/Documentation/git-blame.txt index 14163b65f9..7900f33d4b 100644 --- a/Documentation/git-blame.txt +++ b/Documentation/git-blame.txt @@ -192,4 +192,4 @@ Written by Junio C Hamano <junkio@cox.net> GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt index 6f07a17a2c..a70fa76f31 100644 --- a/Documentation/git-branch.txt +++ b/Documentation/git-branch.txt @@ -8,7 +8,7 @@ git-branch - List, create, or delete branches SYNOPSIS -------- [verse] -'git-branch' [--color | --no-color] [-r | -a] +'git-branch' [--color | --no-color] [-r | -a] [--merged | --no-merged] [-v [--abbrev=<length> | --no-abbrev]] [--contains <commit>] 'git-branch' [--track | --no-track] [-l] [-f] <branchname> [<start-point>] @@ -24,6 +24,8 @@ and option `-a` shows both. With `--contains <commit>`, shows only the branches that contains the named commit (in other words, the branches whose tip commits are descendant of the named commit). +With `--merged`, only branches merged into HEAD will be listed, and +with `--no-merged` only branches not merged into HEAD will be listed. In its second form, a new branch named <branchname> will be created. It will start out with a head equal to the one given as <start-point>. @@ -118,6 +120,15 @@ OPTIONS --no-track:: Ignore the branch.autosetupmerge configuration variable. +--contains <commit>:: + Only list branches which contain the specified commit. + +--merged:: + Only list branches which are fully contained by HEAD. + +--no-merged:: + Do not list branches which are fully contained by HEAD. + <branchname>:: The name of the branch to create or delete. The new branch name must pass all checks defined by @@ -175,6 +186,18 @@ If you are creating a branch that you want to immediately checkout, it's easier to use the git checkout command with its `-b` option to create a branch and check it out with a single command. +The options `--contains`, `--merged` and `--no-merged` serves three related +but different purposes: + +- `--contains <commit>` is used to find all branches which will need + special attention if <commit> were to be rebased or amended, since those + branches contain the specified <commit>. + +- `--merged` is used to find all branches which can be safely deleted, + since those branches are fully contained by HEAD. + +- `--no-merged` is used to find branches which are candidates for merging + into HEAD, since those branches are not fully contained by HEAD. Author ------ @@ -186,4 +209,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-bundle.txt b/Documentation/git-bundle.txt index 18330cdcd2..f6a06129ab 100644 --- a/Documentation/git-bundle.txt +++ b/Documentation/git-bundle.txt @@ -171,4 +171,4 @@ Written by Mark Levedahl <mdl123@verizon.net> GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-cat-file.txt b/Documentation/git-cat-file.txt index df42cb10f2..3f77dbd107 100644 --- a/Documentation/git-cat-file.txt +++ b/Documentation/git-cat-file.txt @@ -9,12 +9,16 @@ git-cat-file - Provide content or type/size information for repository objects SYNOPSIS -------- 'git-cat-file' [-t | -s | -e | -p | <type>] <object> +'git-cat-file' [--batch | --batch-check] < <list-of-objects> DESCRIPTION ----------- -Provides content or type of objects in the repository. The type -is required unless '-t' or '-p' is used to find the object type, -or '-s' is used to find the object size. +In the first form, provides content or type of objects in the repository. The +type is required unless '-t' or '-p' is used to find the object type, or '-s' +is used to find the object size. + +In the second form, a list of object (separated by LFs) is provided on stdin, +and the SHA1, type, and size of each object is printed on stdout. OPTIONS ------- @@ -46,6 +50,14 @@ OPTIONS or to ask for a "blob" with <object> being a tag object that points at it. +--batch:: + Print the SHA1, type, size, and contents of each object provided on + stdin. May not be combined with any other options or arguments. + +--batch-check:: + Print the SHA1, type, and size of each object provided on stdin. May not be + combined with any other options or arguments. + OUTPUT ------ If '-t' is specified, one of the <type>. @@ -56,9 +68,30 @@ If '-e' is specified, no output. If '-p' is specified, the contents of <object> are pretty-printed. -Otherwise the raw (though uncompressed) contents of the <object> will -be returned. +If <type> is specified, the raw (though uncompressed) contents of the <object> +will be returned. + +If '--batch' is specified, output of the following form is printed for each +object specified on stdin: + +------------ +<sha1> SP <type> SP <size> LF +<contents> LF +------------ + +If '--batch-check' is specified, output of the following form is printed for +each object specified fon stdin: + +------------ +<sha1> SP <type> SP <size> LF +------------ + +For both '--batch' and '--batch-check', output of the following form is printed +for each object specified on stdin that does not exist in the repository: +------------ +<object> SP missing LF +------------ Author ------ @@ -70,4 +103,4 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-check-attr.txt b/Documentation/git-check-attr.txt index 290f10f169..ef16b93982 100644 --- a/Documentation/git-check-attr.txt +++ b/Documentation/git-check-attr.txt @@ -38,4 +38,4 @@ Documentation by James Bowes. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-check-ref-format.txt b/Documentation/git-check-ref-format.txt index a676880429..c560c0aa6d 100644 --- a/Documentation/git-check-ref-format.txt +++ b/Documentation/git-check-ref-format.txt @@ -52,4 +52,4 @@ refname expressions (see linkgit:git-rev-parse[1]). Namely: GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-checkout-index.txt b/Documentation/git-checkout-index.txt index cbbb0b5099..a8cad9c21f 100644 --- a/Documentation/git-checkout-index.txt +++ b/Documentation/git-checkout-index.txt @@ -181,4 +181,4 @@ Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt index e11cddbfc9..a5bf9d6f89 100644 --- a/Documentation/git-checkout.txt +++ b/Documentation/git-checkout.txt @@ -47,7 +47,7 @@ OPTIONS by linkgit:git-check-ref-format[1]. Some of these checks may restrict the characters allowed in a branch name. ---track:: +-t, --track:: When creating a new branch, set up configuration so that git-pull will automatically retrieve data from the start point, which must be a branch. Use this if you always pull from the same upstream branch @@ -215,4 +215,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt index f0beb412e6..3762272b88 100644 --- a/Documentation/git-cherry-pick.txt +++ b/Documentation/git-cherry-pick.txt @@ -7,7 +7,7 @@ git-cherry-pick - Apply the change introduced by an existing commit SYNOPSIS -------- -'git-cherry-pick' [--edit] [-n] [-m parent-number] [-x] <commit> +'git-cherry-pick' [--edit] [-n] [-m parent-number] [-s] [-x] <commit> DESCRIPTION ----------- @@ -64,6 +64,9 @@ OPTIONS This is useful when cherry-picking more than one commits' effect to your working tree in a row. +-s|--signoff:: + Add Signed-off-by line at the end of the commit message. + Author ------ @@ -75,4 +78,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-cherry.txt b/Documentation/git-cherry.txt index b0468aa746..ef7caf61e1 100644 --- a/Documentation/git-cherry.txt +++ b/Documentation/git-cherry.txt @@ -13,6 +13,8 @@ DESCRIPTION ----------- The changeset (or "diff") of each commit between the fork-point and <head> is compared against each commit between the fork-point and <upstream>. +The commits are compared with their 'patch id', obtained from linkgit:git-patch-id[1] +program. Every commit that doesn't exist in the <upstream> branch has its id (sha1) reported, prefixed by a symbol. The ones that have @@ -56,6 +58,10 @@ OPTIONS <limit>:: Do not report commits up to (and including) limit. +SEE ALSO +-------- +linkgit:git-patch-id[1] + Author ------ Written by Junio C Hamano <junkio@cox.net> @@ -66,4 +72,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-citool.txt b/Documentation/git-citool.txt index aca1d75e50..09108d0e66 100644 --- a/Documentation/git-citool.txt +++ b/Documentation/git-citool.txt @@ -29,4 +29,4 @@ Documentation by Shawn O. Pearce <spearce@spearce.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-clean.txt b/Documentation/git-clean.txt index 5e9da036ba..deebf3b315 100644 --- a/Documentation/git-clean.txt +++ b/Documentation/git-clean.txt @@ -54,4 +54,4 @@ Written by Pavel Roskin <proski@gnu.org> GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt index 9b564420c5..7973e6af4c 100644 --- a/Documentation/git-clone.txt +++ b/Documentation/git-clone.txt @@ -205,4 +205,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-commit-tree.txt b/Documentation/git-commit-tree.txt index 170803a6d0..728c2fae89 100644 --- a/Documentation/git-commit-tree.txt +++ b/Documentation/git-commit-tree.txt @@ -88,7 +88,7 @@ Discussion include::i18n.txt[] -See Also +SEE ALSO -------- linkgit:git-write-tree[1] @@ -103,4 +103,4 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt index 4bb51cc06e..02d4baab6d 100644 --- a/Documentation/git-commit.txt +++ b/Documentation/git-commit.txt @@ -87,7 +87,7 @@ OPTIONS --no-verify:: This option bypasses the pre-commit and commit-msg hooks. - See also link:hooks.html[hooks]. + See also linkgit:githooks[5][hooks]. --allow-empty:: Usually recording a commit that has the exact same tree as its @@ -292,7 +292,7 @@ order). HOOKS ----- This command can run `commit-msg`, `prepare-commit-msg`, `pre-commit`, -and `post-commit` hooks. See link:hooks.html[hooks] for more +and `post-commit` hooks. See linkgit:githooks[5][hooks] for more information. @@ -312,4 +312,4 @@ Junio C Hamano <junkio@cox.net> GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt index fa161718dd..84b754f8d0 100644 --- a/Documentation/git-config.txt +++ b/Documentation/git-config.txt @@ -144,6 +144,8 @@ See also <<FILES>>. "auto". If `stdout-is-tty` is missing, then checks the standard output of the command itself, and exits with status 0 if color is to be used, or exits with status 1 otherwise. + When the color setting for `name` is undefined, the command uses + `color.ui` as fallback. --get-color name default:: @@ -332,4 +334,4 @@ Documentation by Johannes Schindelin, Petr Baudis and the git-list <git@vger.ker GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-count-objects.txt b/Documentation/git-count-objects.txt index 7fb08e9348..e1219b3167 100644 --- a/Documentation/git-count-objects.txt +++ b/Documentation/git-count-objects.txt @@ -34,4 +34,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-cvsexportcommit.txt b/Documentation/git-cvsexportcommit.txt index 9a47b4c397..5fa91e51ad 100644 --- a/Documentation/git-cvsexportcommit.txt +++ b/Documentation/git-cvsexportcommit.txt @@ -8,7 +8,7 @@ git-cvsexportcommit - Export a single commit to a CVS checkout SYNOPSIS -------- -'git-cvsexportcommit' [-h] [-u] [-v] [-c] [-P] [-p] [-a] [-d cvsroot] [-w cvsworkdir] [-f] [-m msgprefix] [PARENTCOMMIT] COMMITID +'git-cvsexportcommit' [-h] [-u] [-v] [-c] [-P] [-p] [-a] [-d cvsroot] [-w cvsworkdir] [-W] [-f] [-m msgprefix] [PARENTCOMMIT] COMMITID DESCRIPTION @@ -65,11 +65,22 @@ OPTIONS -w:: Specify the location of the CVS checkout to use for the export. This option does not require GIT_DIR to be set before execution if the - current directory is within a git repository. + current directory is within a git repository. The default is the + value of 'cvsexportcommit.cvsdir'. + +-W:: + Tell cvsexportcommit that the current working directory is not only + a Git checkout, but also the CVS checkout. Therefore, Git will + reset the working directory to the parent commit before proceeding. -v:: Verbose. +CONFIGURATION +------------- +cvsexportcommit.cvsdir:: + The default location of the CVS checkout to use for the export. + EXAMPLES -------- @@ -106,4 +117,4 @@ Documentation by Martin Langhoff <martin@catalyst.net.nz> and others. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-cvsimport.txt b/Documentation/git-cvsimport.txt index 58eefd42e5..2f9b35f622 100644 --- a/Documentation/git-cvsimport.txt +++ b/Documentation/git-cvsimport.txt @@ -170,4 +170,4 @@ Documentation by Matthias Urlichs <smurf@smurf.noris.de>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-cvsserver.txt b/Documentation/git-cvsserver.txt index b1106714b2..b7721131dd 100644 --- a/Documentation/git-cvsserver.txt +++ b/Documentation/git-cvsserver.txt @@ -301,11 +301,33 @@ checkout, diff, status, update, log, add, remove, commit. Legacy monitoring operations are not supported (edit, watch and related). Exports and tagging (tags and branches) are not supported at this stage. -The server should set the '-k' mode to binary when relevant, however, -this is not really implemented yet. For now, you can force the server -to set '-kb' for all files by setting the `gitcvs.allbinary` config -variable. In proper GIT tradition, the contents of the files are -always respected. No keyword expansion or newline munging is supported. +CRLF Line Ending Conversions +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +By default the server leaves the '-k' mode blank for all files, +which causes the cvs client to treat them as a text files, subject +to crlf conversion on some platforms. + +You can make the server use `crlf` attributes to set the '-k' modes +for files by setting the `gitcvs.usecrlfattr` config variable. +In this case, if `crlf` is explicitly unset ('-crlf'), then the +server will set '-kb' mode for binary files. If `crlf` is set, +then the '-k' mode will explicitly be left blank. See +also linkgit:gitattributes[5] for more information about the `crlf` +attribute. + +Alternatively, if `gitcvs.usecrlfattr` config is not enabled +or if the `crlf` attribute is unspecified for a filename, then +the server uses the `gitcvs.allbinary` config for the default setting. +If `gitcvs.allbinary` is set, then file not otherwise +specified will default to '-kb' mode. Otherwise the '-k' mode +is left blank. But if `gitcvs.allbinary` is set to "guess", then +the correct '-k' mode will be guessed based on the contents of +the file. + +For best consistency with cvs, it is probably best to override the +defaults by setting `gitcvs.usecrlfattr` to true, +and `gitcvs.allbinary` to "guess". Dependencies ------------ @@ -330,4 +352,4 @@ Documentation by Martyn Smith <martyn@catalyst.net.nz>, Martin Langhoff <martin@ GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-daemon.txt b/Documentation/git-daemon.txt index cf261dd40d..3fb71d683e 100644 --- a/Documentation/git-daemon.txt +++ b/Documentation/git-daemon.txt @@ -272,4 +272,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-describe.txt b/Documentation/git-describe.txt index 69e1ab750d..3f0b7b2f47 100644 --- a/Documentation/git-describe.txt +++ b/Documentation/git-describe.txt @@ -142,4 +142,4 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-diff-files.txt b/Documentation/git-diff-files.txt index 6d2ea16a25..ed9bd75b74 100644 --- a/Documentation/git-diff-files.txt +++ b/Documentation/git-diff-files.txt @@ -8,7 +8,7 @@ git-diff-files - Compares files in the working tree and the index SYNOPSIS -------- -'git-diff-files' [-q] [-0|-1|-2|-3|-c|--cc|--no-index] [<common diff options>] [<path>...] +'git-diff-files' [-q] [-0|-1|-2|-3|-c|--cc] [<common diff options>] [<path>...] DESCRIPTION ----------- @@ -36,9 +36,6 @@ omit diff output for unmerged entries and just show "Unmerged". diff, similar to the way 'diff-tree' shows a merge commit with these flags. ---no-index:: - Compare the two given files / directories. - -q:: Remain silent even on nonexistent files @@ -57,4 +54,4 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-diff-index.txt b/Documentation/git-diff-index.txt index e867778590..f6e844fe61 100644 --- a/Documentation/git-diff-index.txt +++ b/Documentation/git-diff-index.txt @@ -129,4 +129,4 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-diff-tree.txt b/Documentation/git-diff-tree.txt index 58d02c6a20..56caeb2d26 100644 --- a/Documentation/git-diff-tree.txt +++ b/Documentation/git-diff-tree.txt @@ -165,4 +165,4 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-diff.txt b/Documentation/git-diff.txt index 57c28628bb..7acd428964 100644 --- a/Documentation/git-diff.txt +++ b/Documentation/git-diff.txt @@ -168,4 +168,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-fast-export.txt b/Documentation/git-fast-export.txt index 6dac475a0b..332346cc5d 100644 --- a/Documentation/git-fast-export.txt +++ b/Documentation/git-fast-export.txt @@ -80,4 +80,4 @@ Documentation by Johannes E. Schindelin <johannes.schindelin@gmx.de>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-fast-import.txt b/Documentation/git-fast-import.txt index c29a4f8126..395c055f95 100644 --- a/Documentation/git-fast-import.txt +++ b/Documentation/git-fast-import.txt @@ -1119,4 +1119,4 @@ Documentation by Shawn O. Pearce <spearce@spearce.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-fetch-pack.txt b/Documentation/git-fetch-pack.txt index 57598eb056..6ee3dccc1f 100644 --- a/Documentation/git-fetch-pack.txt +++ b/Documentation/git-fetch-pack.txt @@ -99,4 +99,4 @@ Documentation by Junio C Hamano. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-fetch.txt b/Documentation/git-fetch.txt index d982f961fc..489b2b17e6 100644 --- a/Documentation/git-fetch.txt +++ b/Documentation/git-fetch.txt @@ -53,4 +53,4 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt index 4a530965ec..44060687ab 100644 --- a/Documentation/git-filter-branch.txt +++ b/Documentation/git-filter-branch.txt @@ -113,7 +113,7 @@ OPTIONS stdin. The commit id is expected on stdout. + As a special extension, the commit filter may emit multiple -commit ids; in that case, ancestors of the original commit will +commit ids; in that case, the rewritten children of the original commit will have all of them as parents. + You can use the 'map' convenience function in this filter, and other @@ -133,10 +133,16 @@ use "--tag-name-filter cat" to simply update the tags. In this case, be very careful and make sure you have the old tags backed up in case the conversion has run afoul. + -Note that there is currently no support for proper rewriting of -tag objects; in layman terms, if the tag has a message or signature -attached, the rewritten tag won't have it. Sorry. (It is by -definition impossible to preserve signatures at any rate.) +Nearly proper rewriting of tag objects is supported. If the tag has +a message attached, a new tag object will be created with the same message, +author, and timestamp. If the tag has a signature attached, the +signature will be stripped. It is by definition impossible to preserve +signatures. The reason this is "nearly" proper, is because ideally if +the tag did not change (points to the same object, has the same name, etc.) +it should retain any signature. That is not the case, signatures will always +be removed, buyer beware. There is also no support for changing the +author or timestamp (or the tag message for that matter). Tags which point +to other tags will be rewritten to point to the underlying commit. --subdirectory-filter <directory>:: Only look at the history which touches the given subdirectory. @@ -311,4 +317,4 @@ Documentation by Petr Baudis and the git list. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-fmt-merge-msg.txt b/Documentation/git-fmt-merge-msg.txt index 8615ae353e..328cc542dc 100644 --- a/Documentation/git-fmt-merge-msg.txt +++ b/Documentation/git-fmt-merge-msg.txt @@ -9,8 +9,8 @@ git-fmt-merge-msg - Produce a merge commit message SYNOPSIS -------- [verse] -git-fmt-merge-msg [--summary | --no-summary] <$GIT_DIR/FETCH_HEAD -git-fmt-merge-msg [--summary | --no-summary] -F <file> +git-fmt-merge-msg [--log | --no-log] <$GIT_DIR/FETCH_HEAD +git-fmt-merge-msg [--log | --no-log] -F <file> DESCRIPTION ----------- @@ -24,15 +24,19 @@ automatically invoking `git-merge`. OPTIONS ------- ---summary:: +--log:: In addition to branch names, populate the log message with one-line descriptions from the actual commits that are being merged. ---no-summary:: +--no-log:: Do not list one-line descriptions from the actual commits being merged. +--summary,--no-summary:: + Synonyms to --log and --no-log; these are deprecated and will be + removed in the future. + --file <file>, -F <file>:: Take the list of merged objects from <file> instead of stdin. @@ -40,10 +44,14 @@ OPTIONS CONFIGURATION ------------- -merge.summary:: +merge.log:: Whether to include summaries of merged commits in newly merge commit messages. False by default. +merge.summary:: + Synonym to `merge.log`; this is deprecated and will be removed in + the future. + SEE ALSO -------- linkgit:git-merge[1] @@ -59,4 +67,4 @@ Documentation by Petr Baudis, Junio C Hamano and the git-list <git@vger.kernel.o GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt index b5207b7604..cdee642060 100644 --- a/Documentation/git-format-patch.txt +++ b/Documentation/git-format-patch.txt @@ -156,6 +156,12 @@ want a filename like `0001-description-of-my-change.patch`, and the first letter does not have to be a dot. Leaving it empty would not add any suffix. +--no-binary:: + Don't output contents of changes in binary files, just take note + that they differ. Note that this disable the patch to be properly + applied. By default the contents of changes in those files are + encoded in the patch. + CONFIGURATION ------------- You can specify extra mail header lines to be added to each message @@ -168,40 +174,56 @@ and file suffix, and number patches when outputting more than one. subjectprefix = CHANGE suffix = .txt numbered = auto + cc = <email> ------------ EXAMPLES -------- -git-format-patch -k --stdout R1..R2 | git-am -3 -k:: - Extract commits between revisions R1 and R2, and apply - them on top of the current branch using `git-am` to - cherry-pick them. - -git-format-patch origin:: - Extract all commits which are in the current branch but - not in the origin branch. For each commit a separate file - is created in the current directory. - -git-format-patch \--root origin:: - Extract all commits that lead to 'origin' since the - inception of the project. - -git-format-patch -M -B origin:: - The same as the previous one. Additionally, it detects - and handles renames and complete rewrites intelligently to - produce a renaming patch. A renaming patch reduces the - amount of text output, and generally makes it easier to - review it. Note that the "patch" program does not - understand renaming patches, so use it only when you know - the recipient uses git to apply your patch. - -git-format-patch -3:: - Extract three topmost commits from the current branch - and format them as e-mailable patches. - -See Also +* Extract commits between revisions R1 and R2, and apply them on top of +the current branch using `git-am` to cherry-pick them: ++ +------------ +$ git format-patch -k --stdout R1..R2 | git-am -3 -k +------------ + +* Extract all commits which are in the current branch but not in the +origin branch: ++ +------------ +$ git format-patch origin +------------ ++ +For each commit a separate file is created in the current directory. + +* Extract all commits that lead to 'origin' since the inception of the +project: ++ +------------ +$ git format-patch \--root origin +------------ + +* The same as the previous one: ++ +------------ +$ git format-patch -M -B origin +------------ ++ +Additionally, it detects and handles renames and complete rewrites +intelligently to produce a renaming patch. A renaming patch reduces +the amount of text output, and generally makes it easier to review it. +Note that the "patch" program does not understand renaming patches, so +use it only when you know the recipient uses git to apply your patch. + +* Extract three topmost commits from the current branch and format them +as e-mailable patches: ++ +------------ +$ git format-patch -3 +------------ + +SEE ALSO -------- linkgit:git-am[1], linkgit:git-send-email[1] @@ -216,4 +238,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-fsck.txt b/Documentation/git-fsck.txt index f16cb98612..9846c859cf 100644 --- a/Documentation/git-fsck.txt +++ b/Documentation/git-fsck.txt @@ -22,7 +22,8 @@ OPTIONS An object to treat as the head of an unreachability trace. + If no objects are given, git-fsck defaults to using the -index file and all SHA1 references in .git/refs/* as heads. +index file, all SHA1 references in .git/refs/*, and all reflogs (unless +--no-reflogs is given) as heads. --unreachable:: Print out objects that exist but that aren't readable from any @@ -150,4 +151,4 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-gc.txt b/Documentation/git-gc.txt index b6b5ce1519..6ace615d80 100644 --- a/Documentation/git-gc.txt +++ b/Documentation/git-gc.txt @@ -119,7 +119,7 @@ If you are expecting some objects to be collected and they aren't, check all of those locations and decide whether it makes sense in your case to remove those references. -See Also +SEE ALSO -------- linkgit:git-prune[1] linkgit:git-reflog[1] @@ -132,4 +132,4 @@ Written by Shawn O. Pearce <spearce@spearce.org> GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-get-tar-commit-id.txt b/Documentation/git-get-tar-commit-id.txt index dea41490c4..c13bf98697 100644 --- a/Documentation/git-get-tar-commit-id.txt +++ b/Documentation/git-get-tar-commit-id.txt @@ -33,4 +33,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt index a97f0557f4..13b9cf770c 100644 --- a/Documentation/git-grep.txt +++ b/Documentation/git-grep.txt @@ -145,4 +145,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-gui.txt b/Documentation/git-gui.txt index 6d6cd5d87c..105397f2bd 100644 --- a/Documentation/git-gui.txt +++ b/Documentation/git-gui.txt @@ -79,9 +79,9 @@ git gui browser maint:: selected in the browser can be viewed with the internal blame viewer. -See Also +SEE ALSO -------- -'gitk(1)':: +linkgit:gitk[1]:: The git repository browser. Shows branches, commit history and file differences. gitk is the utility started by git-gui's Repository Visualize actions. @@ -112,4 +112,4 @@ Documentation by Shawn O. Pearce <spearce@spearce.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-hash-object.txt b/Documentation/git-hash-object.txt index 33030c022f..cf3dce8a4a 100644 --- a/Documentation/git-hash-object.txt +++ b/Documentation/git-hash-object.txt @@ -8,7 +8,7 @@ git-hash-object - Compute object ID and optionally creates a blob from a file SYNOPSIS -------- -'git-hash-object' [-t <type>] [-w] [--stdin] [--] <file>... +'git-hash-object' [-t <type>] [-w] [--stdin | --stdin-paths] [--] <file>... DESCRIPTION ----------- @@ -32,6 +32,9 @@ OPTIONS --stdin:: Read the object from standard input instead of from a file. +--stdin-paths:: + Read file names from stdin instead of from the command-line. + Author ------ Written by Junio C Hamano <junkio@cox.net> @@ -42,4 +45,4 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-help.txt b/Documentation/git-help.txt index be2ae53b90..8994c6d434 100644 --- a/Documentation/git-help.txt +++ b/Documentation/git-help.txt @@ -82,28 +82,75 @@ man.viewer ~~~~~~~~~~ The 'man.viewer' config variable will be checked if the 'man' format -is chosen. Only the following values are currently supported: +is chosen. The following values are currently supported: * "man": use the 'man' program as usual, * "woman": use 'emacsclient' to launch the "woman" mode in emacs (this only works starting with emacsclient versions 22), -* "konqueror": use a man KIO slave in konqueror. +* "konqueror": use 'kfmclient' to open the man page in a new konqueror +tab (see 'Note about konqueror' below). -Multiple values may be given to this configuration variable. Their -corresponding programs will be tried in the order listed in the -configuration file. +Values for other tools can be used if there is a corresponding +'man.<tool>.cmd' configuration entry (see below). + +Multiple values may be given to the 'man.viewer' configuration +variable. Their corresponding programs will be tried in the order +listed in the configuration file. For example, this configuration: +------------------------------------------------ [man] viewer = konqueror viewer = woman +------------------------------------------------ will try to use konqueror first. But this may fail (for example if DISPLAY is not set) and in that case emacs' woman mode will be tried. If everything fails the 'man' program will be tried anyway. +man.<tool>.path +~~~~~~~~~~~~~~~ + +You can explicitly provide a full path to your preferred man viewer by +setting the configuration variable 'man.<tool>.path'. For example, you +can configure the absolute path to konqueror by setting +'man.konqueror.path'. Otherwise, 'git help' assumes the tool is +available in PATH. + +man.<tool>.cmd +~~~~~~~~~~~~~~ + +When the man viewer, specified by the 'man.viewer' configuration +variables, is not among the supported ones, then the corresponding +'man.<tool>.cmd' configuration variable will be looked up. If this +variable exists then the specified tool will be treated as a custom +command and a shell eval will be used to run the command with the man +page passed as arguments. + +Note about konqueror +~~~~~~~~~~~~~~~~~~~~ + +When 'konqueror' is specified in the 'man.viewer' configuration +variable, we launch 'kfmclient' to try to open the man page on an +already opened konqueror in a new tab if possible. + +For consistency, we also try such a trick if 'man.konqueror.path' is +set to something like 'A_PATH_TO/konqueror'. That means we will try to +launch 'A_PATH_TO/kfmclient' instead. + +If you really want to use 'konqueror', then you can use something like +the following: + +------------------------------------------------ + [man] + viewer = konq + + [man "konq"] + cmd = A_PATH_TO/konqueror +------------------------------------------------ + Note about git config --global ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -125,10 +172,10 @@ Written by Junio C Hamano <gitster@pobox.com> and the git-list Documentation ------------- -Initial documentation was part of the linkgit:git[7] man page. +Initial documentation was part of the linkgit:git[1] man page. Christian Couder <chriscool@tuxfamily.org> extracted and rewrote it a little. Maintenance is done by the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-http-fetch.txt b/Documentation/git-http-fetch.txt index b784a9d07e..70fb635291 100644 --- a/Documentation/git-http-fetch.txt +++ b/Documentation/git-http-fetch.txt @@ -53,4 +53,4 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-http-push.txt b/Documentation/git-http-push.txt index 0b82722342..143291d126 100644 --- a/Documentation/git-http-push.txt +++ b/Documentation/git-http-push.txt @@ -101,4 +101,4 @@ Documentation by Nick Hengeveld GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-imap-send.txt b/Documentation/git-imap-send.txt index 522b73c12f..f4fdc24283 100644 --- a/Documentation/git-imap-send.txt +++ b/Documentation/git-imap-send.txt @@ -59,4 +59,4 @@ Documentation by Mike McCormack GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-index-pack.txt b/Documentation/git-index-pack.txt index a7825b6144..6409363ae5 100644 --- a/Documentation/git-index-pack.txt +++ b/Documentation/git-index-pack.txt @@ -100,4 +100,4 @@ Documentation by Sergey Vlasov GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-init.txt b/Documentation/git-init.txt index 62914da97b..c48b615da2 100644 --- a/Documentation/git-init.txt +++ b/Documentation/git-init.txt @@ -8,7 +8,7 @@ git-init - Create an empty git repository or reinitialize an existing one SYNOPSIS -------- -'git-init' [-q | --quiet] [--template=<template_directory>] [--shared[=<permissions>]] +'git-init' [-q | --quiet] [--bare] [--template=<template_directory>] [--shared[=<permissions>]] OPTIONS @@ -20,6 +20,11 @@ OPTIONS Only print error and warning messages, all other output will be suppressed. +--bare:: + +Create a bare repository. If GIT_DIR environment is not set, it is set to the +current working directory. + --template=<template_directory>:: Provide the directory from which templates will be used. The default template @@ -31,7 +36,7 @@ structure, some suggested "exclude patterns", and copies of non-executing "hook" files. The suggested patterns and hook files are all modifiable and extensible. ---shared[={false|true|umask|group|all|world|everybody}]:: +--shared[={false|true|umask|group|all|world|everybody|0xxx}]:: Specify that the git repository is to be shared amongst several users. This allows users belonging to the same group to push into that @@ -52,6 +57,12 @@ is given: - 'all' (or 'world' or 'everybody'): Same as 'group', but make the repository readable by all users. + - '0xxx': '0xxx' is an octal number and each file will have mode '0xxx' + Any option except 'umask' can be set using this option. '0xxx' will + override users umask(2) value, and thus, users with a safe umask (0077) + can use this option. '0640' will create a repository which is group-readable + but not writable. '0660' is equivalent to 'group'. + By default, the configuration flag receive.denyNonFastForwards is enabled in shared repositories, so that you cannot force a non fast-forwarding push into it. @@ -111,4 +122,4 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-instaweb.txt b/Documentation/git-instaweb.txt index 51f1532ef7..11e6a81779 100644 --- a/Documentation/git-instaweb.txt +++ b/Documentation/git-instaweb.txt @@ -86,4 +86,4 @@ Documentation by Eric Wong <normalperson@yhbt.net>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt index ebaee4b334..db61bc96c7 100644 --- a/Documentation/git-log.txt +++ b/Documentation/git-log.txt @@ -112,4 +112,4 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-lost-found.txt b/Documentation/git-lost-found.txt index b1c797f109..4dc475e0de 100644 --- a/Documentation/git-lost-found.txt +++ b/Documentation/git-lost-found.txt @@ -78,4 +78,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-ls-files.txt b/Documentation/git-ls-files.txt index da9ebf405c..1b0b212245 100644 --- a/Documentation/git-ls-files.txt +++ b/Documentation/git-ls-files.txt @@ -177,7 +177,7 @@ top of the directory tree. A pattern read from a file specified by --exclude-per-directory is relative to the directory that the pattern file appears in. -See Also +SEE ALSO -------- linkgit:git-read-tree[1], linkgit:gitignore[5] @@ -192,4 +192,4 @@ Documentation by David Greaves, Junio C Hamano, Josh Triplett, and the git-list GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-ls-remote.txt b/Documentation/git-ls-remote.txt index c5ba0aad13..8ad7a94f95 100644 --- a/Documentation/git-ls-remote.txt +++ b/Documentation/git-ls-remote.txt @@ -69,4 +69,4 @@ Written by Junio C Hamano <junkio@cox.net> GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-ls-tree.txt b/Documentation/git-ls-tree.txt index 360c0a1b98..d9881fbbbe 100644 --- a/Documentation/git-ls-tree.txt +++ b/Documentation/git-ls-tree.txt @@ -91,4 +91,4 @@ Documentation by David Greaves, Junio C Hamano and the git-list GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-mailinfo.txt b/Documentation/git-mailinfo.txt index 3846f0e6eb..183dc1dd75 100644 --- a/Documentation/git-mailinfo.txt +++ b/Documentation/git-mailinfo.txt @@ -66,4 +66,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-mailsplit.txt b/Documentation/git-mailsplit.txt index 8243f69113..9a2aedd480 100644 --- a/Documentation/git-mailsplit.txt +++ b/Documentation/git-mailsplit.txt @@ -27,7 +27,7 @@ OPTIONS Root of the Maildir to split. This directory should contain the cur, tmp and new subdirectories. -<directory>:: +-o<directory>:: Directory in which to place the individual messages. -b:: @@ -55,4 +55,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-merge-base.txt b/Documentation/git-merge-base.txt index 07f78b4ae0..bbe8512397 100644 --- a/Documentation/git-merge-base.txt +++ b/Documentation/git-merge-base.txt @@ -39,4 +39,4 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-merge-file.txt b/Documentation/git-merge-file.txt index c513184ba0..149f131051 100644 --- a/Documentation/git-merge-file.txt +++ b/Documentation/git-merge-file.txt @@ -89,4 +89,4 @@ with parts copied from the original documentation of RCS merge. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-merge-index.txt b/Documentation/git-merge-index.txt index 19ee017aed..a0ead2bbf3 100644 --- a/Documentation/git-merge-index.txt +++ b/Documentation/git-merge-index.txt @@ -84,4 +84,4 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-merge-one-file.txt b/Documentation/git-merge-one-file.txt index ee95df3bc0..5c9ce641ec 100644 --- a/Documentation/git-merge-one-file.txt +++ b/Documentation/git-merge-one-file.txt @@ -26,4 +26,4 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-merge-tree.txt b/Documentation/git-merge-tree.txt index 4cc0964e78..b785e0f6e0 100644 --- a/Documentation/git-merge-tree.txt +++ b/Documentation/git-merge-tree.txt @@ -33,4 +33,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt index c136b10692..55bc367479 100644 --- a/Documentation/git-merge.txt +++ b/Documentation/git-merge.txt @@ -9,7 +9,7 @@ git-merge - Join two or more development histories together SYNOPSIS -------- [verse] -'git-merge' [-n] [--summary] [--no-commit] [--squash] [-s <strategy>]... +'git-merge' [-n] [--stat] [--no-commit] [--squash] [-s <strategy>]... [-m <msg>] <remote> <remote>... 'git-merge' <msg> HEAD <remote>... @@ -46,18 +46,7 @@ linkgit:git-reset[1]. CONFIGURATION ------------- - -merge.summary:: - Whether to include summaries of merged commits in newly - created merge commit. False by default. - -merge.verbosity:: - Controls the amount of output shown by the recursive merge - strategy. Level 0 outputs nothing except a final error - message if conflicts were detected. Level 1 outputs only - conflicts, 2 outputs conflicts and file changes. Level 5 and - above outputs debugging information. The default is level 2. - Can be overridden by 'GIT_MERGE_VERBOSITY' environment variable. +include::merge-config.txt[] branch.<name>.mergeoptions:: Sets default options for merging into branch <name>. The syntax and @@ -179,4 +168,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt index 8ed44947ef..83525609c6 100644 --- a/Documentation/git-mergetool.txt +++ b/Documentation/git-mergetool.txt @@ -70,4 +70,4 @@ Documentation by Theodore Y Ts'o. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-mktag.txt b/Documentation/git-mktag.txt index 82db9f5d8f..232bc1a338 100644 --- a/Documentation/git-mktag.txt +++ b/Documentation/git-mktag.txt @@ -43,4 +43,4 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-mktree.txt b/Documentation/git-mktree.txt index f312036ab5..1ddbf00afc 100644 --- a/Documentation/git-mktree.txt +++ b/Documentation/git-mktree.txt @@ -31,4 +31,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-mv.txt b/Documentation/git-mv.txt index bff3fbe745..fb485de2c8 100644 --- a/Documentation/git-mv.txt +++ b/Documentation/git-mv.txt @@ -50,4 +50,4 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-name-rev.txt b/Documentation/git-name-rev.txt index efcabdc272..12784d7372 100644 --- a/Documentation/git-name-rev.txt +++ b/Documentation/git-name-rev.txt @@ -75,4 +75,4 @@ Documentation by Johannes Schindelin. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-pack-objects.txt b/Documentation/git-pack-objects.txt index 3a1be08186..d5a87effa4 100644 --- a/Documentation/git-pack-objects.txt +++ b/Documentation/git-pack-objects.txt @@ -200,7 +200,7 @@ Documentation ------------- Documentation by Junio C Hamano -See Also +SEE ALSO -------- linkgit:git-rev-list[1] linkgit:git-repack[1] @@ -208,4 +208,4 @@ linkgit:git-prune-packed[1] GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-pack-redundant.txt b/Documentation/git-pack-redundant.txt index af4aa4a2e5..6737326f0b 100644 --- a/Documentation/git-pack-redundant.txt +++ b/Documentation/git-pack-redundant.txt @@ -46,7 +46,7 @@ Documentation -------------- Documentation by Lukas Sandström <lukass@etek.chalmers.se> -See Also +SEE ALSO -------- linkgit:git-pack-objects[1] linkgit:git-repack[1] @@ -54,4 +54,4 @@ linkgit:git-prune-packed[1] GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-pack-refs.txt b/Documentation/git-pack-refs.txt index e4ff934711..fa48681374 100644 --- a/Documentation/git-pack-refs.txt +++ b/Documentation/git-pack-refs.txt @@ -63,4 +63,4 @@ Written by Linus Torvalds <torvalds@osdl.org> GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-parse-remote.txt b/Documentation/git-parse-remote.txt index deb8b2f01e..951dbd6c83 100644 --- a/Documentation/git-parse-remote.txt +++ b/Documentation/git-parse-remote.txt @@ -47,4 +47,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-patch-id.txt b/Documentation/git-patch-id.txt index 894852a78b..bb8a079254 100644 --- a/Documentation/git-patch-id.txt +++ b/Documentation/git-patch-id.txt @@ -39,4 +39,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-peek-remote.txt b/Documentation/git-peek-remote.txt index 0001710072..56be1b6118 100644 --- a/Documentation/git-peek-remote.txt +++ b/Documentation/git-peek-remote.txt @@ -47,4 +47,4 @@ Documentation by Junio C Hamano. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-prune-packed.txt b/Documentation/git-prune-packed.txt index 93ee82ae57..f330b8a5b9 100644 --- a/Documentation/git-prune-packed.txt +++ b/Documentation/git-prune-packed.txt @@ -42,11 +42,11 @@ Documentation -------------- Documentation by Ryan Anderson <ryan@michonline.com> -See Also +SEE ALSO -------- linkgit:git-pack-objects[1] linkgit:git-repack[1] GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-prune.txt b/Documentation/git-prune.txt index f151cff5d9..7283d07a0e 100644 --- a/Documentation/git-prune.txt +++ b/Documentation/git-prune.txt @@ -13,14 +13,20 @@ SYNOPSIS DESCRIPTION ----------- +NOTE: In most cases, users should run linkgit:git-gc[1], which calls +git-prune. See the section "NOTES", below. + This runs `git-fsck --unreachable` using all the refs available in `$GIT_DIR/refs`, optionally with additional set of -objects specified on the command line, and prunes all +objects specified on the command line, and prunes all unpacked objects unreachable from any of these head objects from the object database. In addition, it prunes the unpacked objects that are also found in packs by running `git prune-packed`. +Note that unreachable, packed objects will remain. If this is +not desired, see linkgit:git-repack[1]. + OPTIONS ------- @@ -50,6 +56,23 @@ borrows from your repository via its $ git prune $(cd ../another && $(git-rev-parse --all)) ------------ +Notes +----- + +In most cases, users will not need to call git-prune directly, but +should instead call linkgit:git-gc[1], which handles pruning along with +many other housekeeping tasks. + +For a description of which objects are considered for pruning, see +git-fsck's --unreachable option. + +SEE ALSO +-------- + +linkgit:git-fsck[1], +linkgit:git-gc[1], +linkgit:git-reflog[1] + Author ------ Written by Linus Torvalds <torvalds@osdl.org> @@ -60,4 +83,4 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt index 3405ca09e8..5c522ced98 100644 --- a/Documentation/git-pull.txt +++ b/Documentation/git-pull.txt @@ -111,40 +111,58 @@ rules apply: EXAMPLES -------- -git pull, git pull origin:: - Update the remote-tracking branches for the repository - you cloned from, then merge one of them into your - current branch. Normally the branch merged in is - the HEAD of the remote repository, but the choice is - determined by the branch.<name>.remote and - branch.<name>.merge options; see linkgit:git-config[1] - for details. - -git pull origin next:: - Merge into the current branch the remote branch `next`; - leaves a copy of `next` temporarily in FETCH_HEAD, but - does not update any remote-tracking branches. - -git pull . fixes enhancements:: - Bundle local branch `fixes` and `enhancements` on top of - the current branch, making an Octopus merge. This `git pull .` - syntax is equivalent to `git merge`. - -git pull -s ours . obsolete:: - Merge local branch `obsolete` into the current branch, - using `ours` merge strategy. - -git pull --no-commit . maint:: - Merge local branch `maint` into the current branch, but - do not make a commit automatically. This can be used - when you want to include further changes to the merge, - or want to write your own merge commit message. +* Update the remote-tracking branches for the repository + you cloned from, then merge one of them into your + current branch: ++ +------------------------------------------------ +$ git pull, git pull origin +------------------------------------------------ ++ +Normally the branch merged in is the HEAD of the remote repository, +but the choice is determined by the branch.<name>.remote and +branch.<name>.merge options; see linkgit:git-config[1] for details. + +* Merge into the current branch the remote branch `next`: ++ +------------------------------------------------ +$ git pull origin next +------------------------------------------------ ++ +This leaves a copy of `next` temporarily in FETCH_HEAD, but +does not update any remote-tracking branches. + +* Bundle local branch `fixes` and `enhancements` on top of + the current branch, making an Octopus merge: ++ +------------------------------------------------ +$ git pull . fixes enhancements +------------------------------------------------ ++ +This `git pull .` syntax is equivalent to `git merge`. + +* Merge local branch `obsolete` into the current branch, using `ours` + merge strategy: ++ +------------------------------------------------ +$ git pull -s ours . obsolete +------------------------------------------------ + +* Merge local branch `maint` into the current branch, but do not make + a commit automatically: ++ +------------------------------------------------ +$ git pull --no-commit . maint +------------------------------------------------ ++ +This can be used when you want to include further changes to the +merge, or want to write your own merge commit message. + You should refrain from abusing this option to sneak substantial changes into a merge commit. Small fixups like bumping release/version name would be acceptable. -Command line pull of multiple branches from one repository:: +* Command line pull of multiple branches from one repository: + ------------------------------------------------ $ git checkout master @@ -152,12 +170,12 @@ $ git fetch origin +pu:pu maint:tmp $ git pull . tmp ------------------------------------------------ + -This updates (or creates, as necessary) branches `pu` and `tmp` -in the local repository by fetching from the branches -(respectively) `pu` and `maint` from the remote repository. +This updates (or creates, as necessary) branches `pu` and `tmp` in +the local repository by fetching from the branches (respectively) +`pu` and `maint` from the remote repository. + -The `pu` branch will be updated even if it is does not -fast-forward; the others will not be. +The `pu` branch will be updated even if it is does not fast-forward; +the others will not be. + The final command then merges the newly fetched `tmp` into master. @@ -185,4 +203,4 @@ Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt index 0585949137..9d8c379717 100644 --- a/Documentation/git-push.txt +++ b/Documentation/git-push.txt @@ -46,12 +46,6 @@ specified, the same ref that <src> referred to locally). If the optional leading plus `+` is used, the remote ref is updated even if it does not result in a fast forward update. + -Note: If no explicit refspec is found, (that is neither -on the command line nor in any Push line of the -corresponding remotes file---see below), then "matching" heads are -pushed: for every head that exists on the local side, the remote side is -updated if a head of the same name already exists on the remote side. -+ `tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`. + A parameter <ref> without a colon pushes the <ref> from the source @@ -59,6 +53,13 @@ repository to the destination repository under the same name. + Pushing an empty <src> allows you to delete the <dst> ref from the remote repository. ++ +The special refspec `:` (or `+:` to allow non-fast forward updates) +directs git to push "matching" heads: for every head that exists on +the local side, the remote side is updated if a head of the same name +already exists on the remote side. This is the default operation mode +if no explicit refspec is found (that is neither on the command line +nor in any Push line of the corresponding remotes file---see below). \--all:: Instead of naming each ref to push, specifies that all @@ -70,7 +71,9 @@ the remote repository. be mirrored to the remote repository. Newly created local refs will be pushed to the remote end, locally updated refs will be force updated on the remote end, and deleted refs - will be removed from the remote end. + will be removed from the remote end. This is the default + if the configuration option `remote.<remote>.mirror` is + set. \--dry-run:: Do everything except actually send the updates. @@ -197,4 +200,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-quiltimport.txt b/Documentation/git-quiltimport.txt index 0fc2b56c12..d0bc182c74 100644 --- a/Documentation/git-quiltimport.txt +++ b/Documentation/git-quiltimport.txt @@ -57,4 +57,4 @@ Documentation by Eric Biederman <ebiederm@lnxi.com> GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-read-tree.txt b/Documentation/git-read-tree.txt index 8421d1fd78..cbe68352bf 100644 --- a/Documentation/git-read-tree.txt +++ b/Documentation/git-read-tree.txt @@ -345,7 +345,7 @@ middle of doing, and when your working tree is ready (i.e. you have finished your work-in-progress), attempt the merge again. -See Also +SEE ALSO -------- linkgit:git-write-tree[1]; linkgit:git-ls-files[1]; linkgit:gitignore[5] @@ -361,4 +361,4 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt index e0412e0866..cc48beec75 100644 --- a/Documentation/git-rebase.txt +++ b/Documentation/git-rebase.txt @@ -401,4 +401,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-receive-pack.txt b/Documentation/git-receive-pack.txt index 4111434bb6..a70c7168f6 100644 --- a/Documentation/git-receive-pack.txt +++ b/Documentation/git-receive-pack.txt @@ -162,4 +162,4 @@ Documentation by Junio C Hamano. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-reflog.txt b/Documentation/git-reflog.txt index 047e3ce14d..8492aeacf1 100644 --- a/Documentation/git-reflog.txt +++ b/Documentation/git-reflog.txt @@ -102,4 +102,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-relink.txt b/Documentation/git-relink.txt index 1b024ded33..f6dafd4495 100644 --- a/Documentation/git-relink.txt +++ b/Documentation/git-relink.txt @@ -34,4 +34,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-remote.txt b/Documentation/git-remote.txt index 2cbd1f764b..e97dc09296 100644 --- a/Documentation/git-remote.txt +++ b/Documentation/git-remote.txt @@ -47,9 +47,11 @@ With `-m <master>` option, `$GIT_DIR/remotes/<name>/HEAD` is set up to point at remote's `<master>` branch instead of whatever branch the `HEAD` at the remote repository actually points at. + -In mirror mode, enabled with `--mirror`, the refs will not be stored +In mirror mode, enabled with `\--mirror`, the refs will not be stored in the 'refs/remotes/' namespace, but in 'refs/heads/'. This option -only makes sense in bare repositories. +only makes sense in bare repositories. If a remote uses mirror +mode, furthermore, `git push` will always behave as if `\--mirror` +was passed. 'rm':: @@ -126,7 +128,7 @@ $ git merge origin ------------ -See Also +SEE ALSO -------- linkgit:git-fetch[1] linkgit:git-branch[1] @@ -144,4 +146,4 @@ Documentation by J. Bruce Fields and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-repack.txt b/Documentation/git-repack.txt index d14ab5154f..793dccaa9d 100644 --- a/Documentation/git-repack.txt +++ b/Documentation/git-repack.txt @@ -8,7 +8,7 @@ git-repack - Pack unpacked objects in a repository SYNOPSIS -------- -'git-repack' [-a] [-d] [-f] [-l] [-n] [-q] [--window=N] [--depth=N] +'git-repack' [-a] [-A] [-d] [-f] [-l] [-n] [-q] [--window=N] [--depth=N] DESCRIPTION ----------- @@ -37,6 +37,18 @@ OPTIONS leaves behind, but `git fsck --full` shows as dangling. +-A:: + Same as `-a`, but any unreachable objects in a previous + pack become loose, unpacked objects, instead of being + left in the old pack. Unreachable objects are never + intentionally added to a pack, even when repacking. + When used with '-d', this option + prevents unreachable objects from being immediately + deleted by way of being left in the old pack and then + removed. Instead, the loose unreachable objects + will be pruned according to normal expiry rules + with the next linkgit:git-gc[1]. + -d:: After packing, if the newly created packs make some existing packs redundant, remove the redundant packs. @@ -110,11 +122,11 @@ Documentation -------------- Documentation by Ryan Anderson <ryan@michonline.com> -See Also +SEE ALSO -------- linkgit:git-pack-objects[1] linkgit:git-prune-packed[1] GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-request-pull.txt b/Documentation/git-request-pull.txt index 9a14c04e39..c71d86985e 100644 --- a/Documentation/git-request-pull.txt +++ b/Documentation/git-request-pull.txt @@ -36,4 +36,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-rerere.txt b/Documentation/git-rerere.txt index a53858e250..8030ec4d01 100644 --- a/Documentation/git-rerere.txt +++ b/Documentation/git-rerere.txt @@ -208,4 +208,4 @@ Written by Junio C Hamano <junkio@cox.net> GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt index fac59c9726..12ea9b23c5 100644 --- a/Documentation/git-reset.txt +++ b/Documentation/git-reset.txt @@ -203,4 +203,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-rev-list.txt b/Documentation/git-rev-list.txt index d80cdf5502..c9b0950321 100644 --- a/Documentation/git-rev-list.txt +++ b/Documentation/git-rev-list.txt @@ -109,4 +109,4 @@ and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt index 5981c79f6a..a0ef1fd550 100644 --- a/Documentation/git-rev-parse.txt +++ b/Documentation/git-rev-parse.txt @@ -52,6 +52,11 @@ OPTIONS The parameter given must be usable as a single, valid object name. Otherwise barf and abort. +-q, --quiet:: + Only meaningful in `--verify` mode. Do not output an error + message if the first argument is not a valid object name; + instead exit with non-zero status silently. + --sq:: Usually the output is made one line per flag and parameter. This option makes output a single line, @@ -344,7 +349,7 @@ Each line of options has this format: * Use `*` to mean that this option should not be listed in the usage generated for the `-h` argument. It's shown for `--help-all` as - documented in linkgit:gitcli[5]. + documented in linkgit:gitcli[7]. * Use `!` to not make the corresponding negated long option available. @@ -375,6 +380,31 @@ C? option C with an optional argument" eval `echo "$OPTS_SPEC" | git-rev-parse --parseopt -- "$@" || echo exit $?` ------------ +EXAMPLES +-------- + +* Print the object name of the current commit: ++ +------------ +$ git rev-parse --verify HEAD +------------ + +* Print the commit object name from the revision in the $REV shell variable: ++ +------------ +$ git rev-parse --verify $REV +------------ ++ +This will error out if $REV is empty or not a valid revision. + +* Same as above: ++ +------------ +$ git rev-parse --default master --verify $REV +------------ ++ +but if $REV is empty, the commit object name from master will be printed. + Author ------ @@ -387,4 +417,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-revert.txt b/Documentation/git-revert.txt index 93e20f7752..5e6adfcea3 100644 --- a/Documentation/git-revert.txt +++ b/Documentation/git-revert.txt @@ -7,7 +7,7 @@ git-revert - Revert an existing commit SYNOPSIS -------- -'git-revert' [--edit | --no-edit] [-n] [-m parent-number] <commit> +'git-revert' [--edit | --no-edit] [-n] [-m parent-number] [-s] <commit> DESCRIPTION ----------- @@ -51,6 +51,9 @@ OPTIONS This is useful when reverting more than one commits' effect to your working tree in a row. +-s|--signoff:: + Add Signed-off-by line at the end of the commit message. + Author ------ @@ -62,4 +65,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-rm.txt b/Documentation/git-rm.txt index 9c81b72dbe..da3fe59135 100644 --- a/Documentation/git-rm.txt +++ b/Documentation/git-rm.txt @@ -93,7 +93,7 @@ git-rm -f git-*.sh:: (i.e. you are listing the files explicitly), it does not remove `subdir/git-foo.sh`. -See Also +SEE ALSO -------- linkgit:git-add[1] @@ -107,4 +107,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt index 9d0a10c562..a29583796d 100644 --- a/Documentation/git-send-email.txt +++ b/Documentation/git-send-email.txt @@ -241,4 +241,4 @@ Documentation by Ryan Anderson GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-send-pack.txt b/Documentation/git-send-pack.txt index 777515b12e..850c351dcd 100644 --- a/Documentation/git-send-pack.txt +++ b/Documentation/git-send-pack.txt @@ -125,4 +125,4 @@ Documentation by Junio C Hamano. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-sh-setup.txt b/Documentation/git-sh-setup.txt index 16b8b75146..c543170342 100644 --- a/Documentation/git-sh-setup.txt +++ b/Documentation/git-sh-setup.txt @@ -77,4 +77,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-shell.txt b/Documentation/git-shell.txt index bc031e0cc2..bd09196acc 100644 --- a/Documentation/git-shell.txt +++ b/Documentation/git-shell.txt @@ -31,4 +31,4 @@ Documentation by Petr Baudis and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-shortlog.txt b/Documentation/git-shortlog.txt index d7cb4c0468..5079b568e6 100644 --- a/Documentation/git-shortlog.txt +++ b/Documentation/git-shortlog.txt @@ -65,4 +65,4 @@ Documentation by Junio C Hamano. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-show-branch.txt b/Documentation/git-show-branch.txt index 0bb8250b20..32595ad549 100644 --- a/Documentation/git-show-branch.txt +++ b/Documentation/git-show-branch.txt @@ -190,4 +190,4 @@ Documentation by Junio C Hamano. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-show-index.txt b/Documentation/git-show-index.txt index 535a884642..891f0eff27 100644 --- a/Documentation/git-show-index.txt +++ b/Documentation/git-show-index.txt @@ -31,4 +31,4 @@ Documentation by Junio C Hamano GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-show-ref.txt b/Documentation/git-show-ref.txt index ce0e643fbe..a85332c363 100644 --- a/Documentation/git-show-ref.txt +++ b/Documentation/git-show-ref.txt @@ -169,4 +169,4 @@ Man page by Jonas Fonseca <fonseca@diku.dk>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-show.txt b/Documentation/git-show.txt index 29ed0acc62..baaf2bc8fe 100644 --- a/Documentation/git-show.txt +++ b/Documentation/git-show.txt @@ -81,4 +81,4 @@ Documentation by David Greaves, Petr Baudis and the git-list <git@vger.kernel.or GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt index 8dc35d493e..baa4f55b48 100644 --- a/Documentation/git-stash.txt +++ b/Documentation/git-stash.txt @@ -182,4 +182,4 @@ Written by Nanako Shiraishi <nanako3@bluebottle.com> GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt index 3ea269aa7a..fef62b16df 100644 --- a/Documentation/git-status.txt +++ b/Documentation/git-status.txt @@ -52,7 +52,12 @@ If the config variable `status.relativePaths` is set to false, then all paths shown are relative to the repository root, not to the current directory. -See Also +If `status.submodulesummary` is set to a non zero number or true (identical +to -1 or an unlimited number), the submodule summary will be enabled and a +summary of commits for modified submodules will be shown (see --summary-limit +option of linkgit:git-submodule[1]). + +SEE ALSO -------- linkgit:gitignore[5] @@ -67,4 +72,4 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-stripspace.txt b/Documentation/git-stripspace.txt index fc5687502e..4883834a14 100644 --- a/Documentation/git-stripspace.txt +++ b/Documentation/git-stripspace.txt @@ -32,4 +32,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt index 6ffd896fbc..139206f014 100644 --- a/Documentation/git-submodule.txt +++ b/Documentation/git-submodule.txt @@ -11,7 +11,8 @@ SYNOPSIS [verse] 'git-submodule' [--quiet] add [-b branch] [--] <repository> [<path>] 'git-submodule' [--quiet] status [--cached] [--] [<path>...] -'git-submodule' [--quiet] [init|update] [--] [<path>...] +'git-submodule' [--quiet] init [--] [<path>...] +'git-submodule' [--quiet] update [--init] [--] [<path>...] 'git-submodule' [--quiet] summary [--summary-limit <n>] [commit] [--] [<path>...] @@ -47,6 +48,10 @@ update:: Update the registered submodules, i.e. clone missing submodules and checkout the commit specified in the index of the containing repository. This will make the submodules HEAD be detached. ++ +If the submodule is not yet initialized, and you just want to use the +setting as stored in .gitmodules, you can automatically initialize the +submodule with the --init option. summary:: Show commit summary between the given commit (defaults to HEAD) and @@ -93,4 +98,4 @@ Written by Lars Hjemli <hjemli@gmail.com> GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt index bec9accc89..f4cbd2f212 100644 --- a/Documentation/git-svn.txt +++ b/Documentation/git-svn.txt @@ -61,6 +61,16 @@ COMMANDS Set the 'useSvnsyncProps' option in the [svn-remote] config. --rewrite-root=<URL>;; Set the 'rewriteRoot' option in the [svn-remote] config. +--use-log-author;; + When retrieving svn commits into git (as part of fetch, rebase, or + dcommit operations), look for the first From: or Signed-off-by: line + in the log message and use that as the author string. +--add-author-from;; + When committing to svn from git (as part of commit or dcommit + operations), if the existing log message doesn't already have a + From: or Signed-off-by: line, append a From: line based on the + git commit's author string. If you use this, then --use-log-author + will retrieve a valid author string for all commits. --username=<USER>;; For transports that SVN handles authentication for (http, https, and plain svn), specify the username. For other @@ -166,11 +176,18 @@ environment). This command has the same behaviour. Any other arguments are passed directly to `git log' 'blame':: - Show what revision and author last modified each line of a file. This is - identical to `git blame', but SVN revision numbers are shown instead of git - commit hashes. + Show what revision and author last modified each line of a file. The + output of this mode is format-compatible with the output of + `svn blame' by default. Like the SVN blame command, + local uncommitted changes in the working copy are ignored; + the version of the file in the HEAD revision is annotated. Unknown + arguments are passed directly to git-blame. + -All arguments are passed directly to `git blame'. +--git-format;; + Produce output in the same format as `git blame', but with + SVN revision numbers instead of git commit hashes. In this mode, + changes that haven't been committed to SVN (including local + working-copy edits) are shown as revision 0. -- 'find-rev':: @@ -188,6 +205,12 @@ All arguments are passed directly to `git blame'. commit. All merging is assumed to have taken place independently of git-svn functions. +'create-ignore':: + Recursively finds the svn:ignore property on directories and + creates matching .gitignore files. The resulting files are staged to + be committed, but are not committed. Use -r/--revision to refer to a + specfic revision. + 'show-ignore':: Recursively finds and lists the svn:ignore property on directories. The output is suitable for appending to @@ -210,6 +233,19 @@ All arguments are passed directly to `git blame'. argument. Use the --url option to output only the value of the 'URL:' field. +'proplist':: + Lists the properties stored in the Subversion repository about a + given file or directory. Use -r/--revision to refer to a specific + Subversion revision. + +'propget':: + Gets the Subversion property given as the first argument, for a + file. A specific revision can be specified with -r/--revision. + +'show-externals':: + Shows the Subversion externals. Use -r/--revision to specify a + specific revision. + -- OPTIONS @@ -329,11 +365,15 @@ Passed directly to git-rebase when using 'dcommit' if a -n:: --dry-run:: -This is only used with the 'dcommit' command. +This can be used with the 'dcommit' and 'rebase' commands. -Print out the series of git arguments that would show +For 'dcommit', print out the series of git arguments that would show which diffs would be committed to SVN. +For 'rebase', display the local branch associated with the upstream svn +repository associated with the current branch and the URL of svn +repository that will be fetched from. + -- ADVANCED OPTIONS diff --git a/Documentation/git-symbolic-ref.txt b/Documentation/git-symbolic-ref.txt index a5b40f3e85..e9b996baa8 100644 --- a/Documentation/git-symbolic-ref.txt +++ b/Documentation/git-symbolic-ref.txt @@ -58,4 +58,4 @@ Written by Junio C Hamano <junkio@cox.net> GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-tag.txt b/Documentation/git-tag.txt index 9712392f79..8f40f4bf0d 100644 --- a/Documentation/git-tag.txt +++ b/Documentation/git-tag.txt @@ -255,4 +255,4 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-tar-tree.txt b/Documentation/git-tar-tree.txt index 65c68176e5..74ed06525e 100644 --- a/Documentation/git-tar-tree.txt +++ b/Documentation/git-tar-tree.txt @@ -86,4 +86,4 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-unpack-file.txt b/Documentation/git-unpack-file.txt index 1864d13ed8..d0552b2c74 100644 --- a/Documentation/git-unpack-file.txt +++ b/Documentation/git-unpack-file.txt @@ -32,4 +32,4 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-unpack-objects.txt b/Documentation/git-unpack-objects.txt index b79be3fd4c..b9c4279a88 100644 --- a/Documentation/git-unpack-objects.txt +++ b/Documentation/git-unpack-objects.txt @@ -8,7 +8,7 @@ git-unpack-objects - Unpack objects from a packed archive SYNOPSIS -------- -'git-unpack-objects' [-n] [-q] [-r] <pack-file +'git-unpack-objects' [-n] [-q] [-r] [--strict] <pack-file DESCRIPTION @@ -40,6 +40,9 @@ OPTIONS and make the best effort to recover as many objects as possible. +--strict:: + Don't write objects with broken content or links. + Author ------ @@ -51,4 +54,4 @@ Documentation by Junio C Hamano GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt index 66be18ef36..c703365186 100644 --- a/Documentation/git-update-index.txt +++ b/Documentation/git-update-index.txt @@ -15,6 +15,7 @@ SYNOPSIS [--cacheinfo <mode> <object> <file>]\* [--chmod=(+|-)x] [--assume-unchanged | --no-assume-unchanged] + [--ignore-submodules] [--really-refresh] [--unresolve] [--again | -g] [--info-only] [--index-info] [-z] [--stdin] @@ -54,6 +55,10 @@ OPTIONS default behavior is to error out. This option makes git-update-index continue anyway. +--ignore-submodules: + Do not try to update submodules. This option is only respected + when passed before --refresh. + --unmerged:: If --refresh finds unmerged changes in the index, the default behavior is to error out. This option makes git-update-index @@ -307,7 +312,7 @@ The command looks at `core.ignorestat` configuration variable. See 'Using "assume unchanged" bit' section above. -See Also +SEE ALSO -------- linkgit:git-config[1], linkgit:git-add[1] @@ -323,4 +328,4 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-update-ref.txt b/Documentation/git-update-ref.txt index 4dc475992e..7f7e3d197b 100644 --- a/Documentation/git-update-ref.txt +++ b/Documentation/git-update-ref.txt @@ -90,4 +90,4 @@ Written by Linus Torvalds <torvalds@osdl.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-update-server-info.txt b/Documentation/git-update-server-info.txt index 1cf89fd79e..aa1ee67cbb 100644 --- a/Documentation/git-update-server-info.txt +++ b/Documentation/git-update-server-info.txt @@ -30,8 +30,8 @@ OUTPUT ------ Currently the command updates the following files. Please see -link:repository-layout.html[repository-layout] for description -of what they are for: +linkgit:gitrepository-layout[5][repository-layout] for description of +what they are for: * objects/info/packs @@ -54,4 +54,4 @@ Documentation by Junio C Hamano. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-upload-archive.txt b/Documentation/git-upload-archive.txt index c1ef1440bc..e49f68f68e 100644 --- a/Documentation/git-upload-archive.txt +++ b/Documentation/git-upload-archive.txt @@ -34,4 +34,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-upload-pack.txt b/Documentation/git-upload-pack.txt index 2330d13814..521da5b200 100644 --- a/Documentation/git-upload-pack.txt +++ b/Documentation/git-upload-pack.txt @@ -43,4 +43,4 @@ Documentation by Junio C Hamano. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-var.txt b/Documentation/git-var.txt index 2980283905..67e8e1f93a 100644 --- a/Documentation/git-var.txt +++ b/Documentation/git-var.txt @@ -45,7 +45,7 @@ Your parents must have hated you!:: Your sysadmin must hate you!:: The password(5) name field is longer than a giant static buffer. -See Also +SEE ALSO -------- linkgit:git-commit-tree[1] linkgit:git-tag[1] @@ -61,4 +61,4 @@ Documentation by Eric Biederman and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-verify-pack.txt b/Documentation/git-verify-pack.txt index ba2a157299..478f236996 100644 --- a/Documentation/git-verify-pack.txt +++ b/Documentation/git-verify-pack.txt @@ -50,4 +50,4 @@ Documentation by Junio C Hamano GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-verify-tag.txt b/Documentation/git-verify-tag.txt index 7e9c1ed15b..dffba8906a 100644 --- a/Documentation/git-verify-tag.txt +++ b/Documentation/git-verify-tag.txt @@ -28,4 +28,4 @@ Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-web--browse.txt b/Documentation/git-web--browse.txt index ddbae5b194..f8d5fb11d1 100644 --- a/Documentation/git-web--browse.txt +++ b/Documentation/git-web--browse.txt @@ -20,7 +20,7 @@ The following browsers (or commands) are currently supported: * firefox (this is the default under X Window when not using KDE) * iceweasel -* konqueror (this is the default under KDE) +* konqueror (this is the default under KDE, see 'Note about konqueror' below) * w3m (this is the default outside graphical environments) * links * lynx @@ -71,6 +71,28 @@ variable exists then "git web--browse" will treat the specified tool as a custom command and will use a shell eval to run the command with the URLs passed as arguments. +Note about konqueror +-------------------- + +When 'konqueror' is specified by the a command line option or a +configuration variable, we launch 'kfmclient' to try to open the HTML +man page on an already opened konqueror in a new tab if possible. + +For consistency, we also try such a trick if 'browser.konqueror.path' is +set to something like 'A_PATH_TO/konqueror'. That means we will try to +launch 'A_PATH_TO/kfmclient' instead. + +If you really want to use 'konqueror', then you can use something like +the following: + +------------------------------------------------ + [web] + browser = konq + + [browser "konq"] + cmd = A_PATH_TO/konqueror +------------------------------------------------ + Note about git config --global ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -96,4 +118,4 @@ git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-whatchanged.txt b/Documentation/git-whatchanged.txt index a6e7bd4c8b..f5d39c7870 100644 --- a/Documentation/git-whatchanged.txt +++ b/Documentation/git-whatchanged.txt @@ -76,4 +76,4 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git-write-tree.txt b/Documentation/git-write-tree.txt index 461c813f5a..8744f6535d 100644 --- a/Documentation/git-write-tree.txt +++ b/Documentation/git-write-tree.txt @@ -46,4 +46,4 @@ Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/git.txt b/Documentation/git.txt index 615c307cbc..cf67110a91 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -1,4 +1,4 @@ -git(7) +git(1) ====== NAME @@ -20,10 +20,10 @@ Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals. -See this link:tutorial.html[tutorial] to get started, then see +See this linkgit:gittutorial[7][tutorial] to get started, then see link:everyday.html[Everyday Git] for a useful minimum set of commands, and "man git-commandname" for documentation of each command. CVS users may -also want to read link:cvs-migration.html[CVS migration]. See +also want to read linkgit:gitcvs-migration[7][CVS migration]. See link:user-manual.html[Git User's Manual] for a more in-depth introduction. @@ -146,7 +146,8 @@ help ...'. --git-dir=<path>:: Set the path to the repository. This can also be controlled by - setting the GIT_DIR environment variable. + setting the GIT_DIR environment variable. It can be an absolute + path or relative path to current working directory. --work-tree=<path>:: Set the path to the working tree. The value will not be @@ -154,7 +155,12 @@ help ...'. a .git directory (i.e. $GIT_DIR is not set). This can also be controlled by setting the GIT_WORK_TREE environment variable and the core.worktree configuration - variable. + variable. It can be an absolute path or relative path to + the directory specified by --git-dir or GIT_DIR. + Note: If --git-dir or GIT_DIR are specified but none of + --work-tree, GIT_WORK_TREE and core.worktree is specified, + the current working directory is regarded as the top directory + of your working tree. --bare:: Treat the repository as a bare repository. If GIT_DIR @@ -169,7 +175,7 @@ See the references above to get started using git. The following is probably more detail than necessary for a first-time user. The link:user-manual.html#git-concepts[git concepts chapter of the -user-manual] and the link:core-tutorial.html[Core tutorial] both provide +user-manual] and the linkgit:gitcore-tutorial[7][Core tutorial] both provide introductions to the underlying git architecture. See also the link:howto-index.html[howto] documents for some useful @@ -359,9 +365,10 @@ For a more complete list of ways to spell object names, see File/Directory Structure ------------------------ -Please see the link:repository-layout.html[repository layout] document. +Please see the linkgit:gitrepository-layout[5][repository layout] +document. -Read link:hooks.html[hooks] for more details about each hook. +Read linkgit:githooks[5][hooks] for more details about each hook. Higher level SCMs may provide and manage additional information in the `$GIT_DIR`. @@ -369,7 +376,7 @@ Higher level SCMs may provide and manage additional information in the Terminology ----------- -Please see the link:glossary.html[glossary] document. +Please see the linkgit:gitglossary[7][glossary] document. Environment Variables @@ -513,7 +520,7 @@ Discussion[[Discussion]] More detail on the following is available from the link:user-manual.html#git-concepts[git concepts chapter of the -user-manual] and the link:core-tutorial.html[Core tutorial]. +user-manual] and the linkgit:gitcore-tutorial[7][Core tutorial]. A git project normally consists of a working directory with a ".git" subdirectory at the top level. The .git directory contains, among other @@ -574,6 +581,13 @@ The documentation for git suite was started by David Greaves <david@dgreaves.com>, and later enhanced greatly by the contributors on the git-list <git@vger.kernel.org>. +SEE ALSO +-------- +linkgit:gittutorial[7], linkgit:gittutorial-2[7], +linkgit:giteveryday[7], linkgit:gitcvs-migration[7], +linkgit:gitglossary[7], linkgit:gitcore-tutorial[7], +link:user-manual.html[The Git User's Manual] + GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt index 04ca63ca3d..471754eb12 100644 --- a/Documentation/gitattributes.txt +++ b/Documentation/gitattributes.txt @@ -265,7 +265,7 @@ When git needs to show you a diff for the path with `diff` attribute set to `jcdiff`, it calls the command you specified with the above configuration, i.e. `j-c-diff`, with 7 parameters, just like `GIT_EXTERNAL_DIFF` program is called. -See linkgit:git[7] for details. +See linkgit:git[1] for details. Defining a custom hunk-header @@ -518,4 +518,4 @@ commit hash. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/gitcli.txt b/Documentation/gitcli.txt index 7ee5ce386f..8fb5d889e5 100644 --- a/Documentation/gitcli.txt +++ b/Documentation/gitcli.txt @@ -1,4 +1,4 @@ -gitcli(5) +gitcli(7) ========= NAME @@ -110,4 +110,4 @@ Documentation by Pierre Habouzit. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/core-tutorial.txt b/Documentation/gitcore-tutorial.txt index 5a5531222d..cb4ec40440 100644 --- a/Documentation/core-tutorial.txt +++ b/Documentation/gitcore-tutorial.txt @@ -1,14 +1,22 @@ -A git core tutorial for developers -================================== +gitcore-tutorial(7) +=================== -Introduction ------------- +NAME +---- +gitcore-tutorial - A git core tutorial for developers + +SYNOPSIS +-------- +git * + +DESCRIPTION +----------- This tutorial explains how to use the "core" git programs to set up and work with a git repository. If you just need to use git as a revision control system you may prefer -to start with link:tutorial.html[a tutorial introduction to git] or +to start with linkgit:gittutorial[7][a tutorial introduction to git] or link:user-manual.html[the git user manual]. However, an understanding of these low-level tools can be helpful if @@ -101,7 +109,7 @@ populating your tree. [NOTE] An advanced user may want to take a look at the -link:repository-layout.html[repository layout] document +linkgit:gitrepository-layout[5][repository layout] document after finishing this tutorial. You have now created your first git repository. Of course, since it's @@ -1581,7 +1589,7 @@ suggested in the previous section may be new to you. You do not have to worry. git supports "shared public repository" style of cooperation you are probably more familiar with as well. -See link:cvs-migration.html[git for CVS users] for the details. +See linkgit:gitcvs-migration[7][git for CVS users] for the details. Bundling your work together --------------------------- @@ -1679,3 +1687,13 @@ merge two at a time, documenting how you resolved the conflicts, and the reason why you preferred changes made in one side over the other. Otherwise it would make the project history harder to follow, not easier. + +SEE ALSO +-------- +linkgit:gittutorial[7], linkgit:gittutorial-2[7], +linkgit:giteveryday[7], linkgit:gitcvs-migration[7], +link:user-manual.html[The Git User's Manual] + +GIT +--- +Part of the linkgit:git[1] suite. diff --git a/Documentation/cvs-migration.txt b/Documentation/gitcvs-migration.txt index 00f2e36b2e..1db3f52945 100644 --- a/Documentation/cvs-migration.txt +++ b/Documentation/gitcvs-migration.txt @@ -1,5 +1,16 @@ -git for CVS users -================= +gitcvs-migration(7) +=================== + +NAME +---- +gitcvs-migration - git for CVS users + +SYNOPSIS +-------- +git cvsimport * + +DESCRIPTION +----------- Git differs from CVS in that every working tree contains a repository with a full copy of the project history, and no repository is inherently more @@ -8,8 +19,8 @@ designating a single shared repository which people can synchronize with; this document explains how to do that. Some basic familiarity with git is required. This -link:tutorial.html[tutorial introduction to git] and the -link:glossary.html[git glossary] should be sufficient. +linkgit:gittutorial[7][tutorial introduction to git] and the +linkgit:gitglossary[7][git glossary] should be sufficient. Developing against a shared repository -------------------------------------- @@ -71,7 +82,7 @@ Setting Up a Shared Repository We assume you have already created a git repository for your project, possibly created from scratch or from a tarball (see the -link:tutorial.html[tutorial]), or imported from an already existing CVS +linkgit:gittutorial[7][tutorial]), or imported from an already existing CVS repository (see the next section). Assume your existing repo is at /home/alice/myproject. Create a new "bare" @@ -137,7 +148,7 @@ Advanced Shared Repository Management Git allows you to specify scripts called "hooks" to be run at certain points. You can use these, for example, to send all commits to the shared -repository to a mailing list. See link:hooks.html[Hooks used by git]. +repository to a mailing list. See linkgit:githooks[5][Hooks used by git]. You can enforce finer grained permissions using update hooks. See link:howto/update-hook-example.txt[Controlling access to branches using @@ -170,3 +181,16 @@ variants of this model. With a small group, developers may just pull changes from each other's repositories without the need for a central maintainer. + +SEE ALSO +-------- +linkgit:gittutorial[7], +linkgit:gittutorial-2[7], +linkgit:gitcore-tutorial[7], +linkgit:gitglossary[7], +link:everyday.html[Everyday Git], +link:user-manual.html[The Git User's Manual] + +GIT +--- +Part of the linkgit:git[1] suite. diff --git a/Documentation/diffcore.txt b/Documentation/gitdiffcore.txt index c6a983a5d5..4d56c85260 100644 --- a/Documentation/diffcore.txt +++ b/Documentation/gitdiffcore.txt @@ -1,10 +1,16 @@ -Tweaking diff output -==================== -June 2005 +gitdiffcore(7) +============== +NAME +---- +gitdiffcore - Tweaking diff output (June 2005) -Introduction ------------- +SYNOPSIS +-------- +git diff * + +DESCRIPTION +----------- The diff commands git-diff-index, git-diff-files, and git-diff-tree can be told to manipulate differences they find in @@ -269,3 +275,18 @@ Documentation *.c t ------------------------------------------------ + +SEE ALSO +-------- +linkgit:git-diff[1], +linkgit:git-diff-files[1], +linkgit:git-diff-index[1], +linkgit:git-diff-tree[1], +linkgit:git-format-patch[1], +linkgit:git-log[1], +linkgit:gitglossary[7], +link:user-manual.html[The Git User's Manual] + +GIT +--- +Part of the linkgit:git[1] suite. diff --git a/Documentation/gitglossary.txt b/Documentation/gitglossary.txt new file mode 100644 index 0000000000..5c5c31d31c --- /dev/null +++ b/Documentation/gitglossary.txt @@ -0,0 +1,25 @@ +gitglossary(7) +============== + +NAME +---- +gitglossary - A GIT Glossary + +SYNOPSIS +-------- +* + +DESCRIPTION +----------- + +include::glossary-content.txt[] + +SEE ALSO +-------- +linkgit:gittutorial[7], linkgit:gittutorial-2[7], +linkgit:giteveryday[7], linkgit:gitcvs-migration[7], +link:user-manual.html[The Git User's Manual] + +GIT +--- +Part of the linkgit:git[1] suite. diff --git a/Documentation/hooks.txt b/Documentation/githooks.txt index 76b8d77460..4f06ae0ed4 100644 --- a/Documentation/hooks.txt +++ b/Documentation/githooks.txt @@ -1,5 +1,17 @@ -Hooks used by git -================= +githooks(5) +=========== + +NAME +---- +githooks - Hooks used by git + +SYNOPSIS +-------- +$GIT_DIR/hooks/* + + +DESCRIPTION +----------- Hooks are little scripts you can place in `$GIT_DIR/hooks` directory to trigger action at certain points. When @@ -28,10 +40,11 @@ The default 'applypatch-msg' hook, when enabled, runs the pre-applypatch -------------- -This hook is invoked by `git-am`. It takes no parameter, -and is invoked after the patch is applied, but before a commit -is made. Exiting with non-zero status causes the working tree -after application of the patch not committed. +This hook is invoked by `git-am`. It takes no parameter, and is +invoked after the patch is applied, but before a commit is made. + +If it exits with non-zero status, then the working tree will not be +committed after applying the patch. It can be used to inspect the current working tree and refuse to make a commit if it does not pass certain test. @@ -136,7 +149,8 @@ post-merge This hook is invoked by `git-merge`, which happens when a `git pull` is done on a local repository. The hook takes a single parameter, a status flag specifying whether or not the merge being done was a squash merge. -This hook cannot affect the outcome of `git-merge`. +This hook cannot affect the outcome of `git-merge` and is not executed, +if the merge failed due to conflicts. This hook can be used in conjunction with a corresponding pre-commit hook to save and restore any form of metadata associated with the working tree @@ -276,3 +290,14 @@ probably enable this hook. Both standard output and standard error output are forwarded to `git-send-pack` on the other end, so you can simply `echo` messages for the user. + +pre-auto-gc +----------- + +This hook is invoked by `git-gc --auto`. It takes no parameter, and +exiting with non-zero status from this script causes the `git-gc --auto` +to abort. + +GIT +--- +Part of the linkgit:git[1] suite diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt index 613dca006f..2881c9cb92 100644 --- a/Documentation/gitignore.txt +++ b/Documentation/gitignore.txt @@ -138,4 +138,4 @@ Frank Lichtenheld, and the git-list <git@vger.kernel.org>. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/gitk.txt b/Documentation/gitk.txt index ed3ba83c53..14bcf91f40 100644 --- a/Documentation/gitk.txt +++ b/Documentation/gitk.txt @@ -41,6 +41,12 @@ frequently used options. Show all branches. +--merge:: + + After an attempt to merge stops with conflicts, show the commits on + the history between two branches (i.e. the HEAD and the MERGE_HEAD) + that modify the conflicted files. + <revs>:: Limit the revisions to show. This can be either a single revision @@ -79,7 +85,7 @@ Files Gitk creates the .gitk file in your $HOME directory to store preferences such as display options, font, and colors. -See Also +SEE ALSO -------- 'qgit(1)':: A repository browser written in C++ using Qt. @@ -103,4 +109,4 @@ Documentation by Junio C Hamano, Jonas Fonseca, and the git-list GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/gitmodules.txt b/Documentation/gitmodules.txt index cc95b69f27..f8d122a8b9 100644 --- a/Documentation/gitmodules.txt +++ b/Documentation/gitmodules.txt @@ -59,4 +59,4 @@ Documentation by Lars Hjemli <hjemli@gmail.com> GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite diff --git a/Documentation/repository-layout.txt b/Documentation/gitrepository-layout.txt index 6939130094..03c52ff526 100644 --- a/Documentation/repository-layout.txt +++ b/Documentation/gitrepository-layout.txt @@ -1,9 +1,23 @@ -git repository layout -===================== +gitrepository-layout(5) +======================= + +NAME +---- +gitrepository-layout - Git Repository Layout + +SYNOPSIS +-------- +$GIT_DIR/* + +DESCRIPTION +----------- You may find these things in your git repository (`.git` directory for a repository associated with your working tree, or -`'project'.git` directory for a public 'bare' repository). +`<project>.git` directory for a public 'bare' repository. It is +also possible to have a working tree where `.git` is a plain +ascii file containing `gitdir: <path>`, i.e. the path to the +real git repository). objects:: Object store associated with this repository. Usually @@ -112,7 +126,7 @@ details. branches:: A slightly deprecated way to store shorthands to be used to specify URL to `git fetch`, `git pull` and `git push` - commands is to store a file in `branches/'name'` and + commands is to store a file in `branches/<name>` and give 'name' to these commands in place of 'repository' argument. @@ -121,7 +135,7 @@ hooks:: commands. A handful of sample hooks are installed when `git init` is run, but all of them are disabled by default. To enable, they need to be made executable. - Read link:hooks.html[hooks] for more details about + Read linkgit:githooks[5][hooks] for more details about each hook. index:: @@ -177,3 +191,18 @@ shallow:: This is similar to `info/grafts` but is internally used and maintained by shallow clone mechanism. See `--depth` option to linkgit:git-clone[1] and linkgit:git-fetch[1]. + +SEE ALSO +-------- +linkgit:git-init[1], +linkgit:git-clone[1], +linkgit:git-fetch[1], +linkgit:git-pack-refs[1], +linkgit:git-gc[1], +linkgit:git-checkout[1], +linkgit:gitglossary[7], +link:user-manual.html[The Git User's Manual] + +GIT +--- +Part of the linkgit:git[1] suite. diff --git a/Documentation/tutorial-2.txt b/Documentation/gittutorial-2.txt index 7fac47de8b..e3d5c1fbf0 100644 --- a/Documentation/tutorial-2.txt +++ b/Documentation/gittutorial-2.txt @@ -1,7 +1,18 @@ -A tutorial introduction to git: part two -======================================== +gittutorial-2(7) +================ -You should work through link:tutorial.html[A tutorial introduction to +NAME +---- +gittutorial-2 - A tutorial introduction to git: part two + +SYNOPSIS +-------- +git * + +DESCRIPTION +----------- + +You should work through linkgit:gittutorial[7][A tutorial introduction to git] before reading this tutorial. The goal of this tutorial is to introduce two fundamental pieces of @@ -379,7 +390,7 @@ in the index file is identical to the one in the working directory. In addition to being the staging area for new commits, the index file is also populated from the object database when checking out a branch, and is used to hold the trees involved in a merge operation. -See the link:core-tutorial.html[core tutorial] and the relevant man +See the linkgit:gitcore-tutorial[7][core tutorial] and the relevant man pages for details. What next? @@ -389,18 +400,31 @@ At this point you should know everything necessary to read the man pages for any of the git commands; one good place to start would be with the commands mentioned in link:everyday.html[Everyday git]. You should be able to find any unknown jargon in the -link:glossary.html[Glossary]. +linkgit:gitglossary[7][Glossary]. The link:user-manual.html[Git User's Manual] provides a more comprehensive introduction to git. -The link:cvs-migration.html[CVS migration] document explains how to +The linkgit:gitcvs-migration[7][CVS migration] document explains how to import a CVS repository into git, and shows how to use git in a CVS-like way. For some interesting examples of git use, see the link:howto-index.html[howtos]. -For git developers, the link:core-tutorial.html[Core tutorial] goes +For git developers, the linkgit:gitcore-tutorial[7][Core tutorial] goes into detail on the lower-level git mechanisms involved in, for example, creating a new commit. + +SEE ALSO +-------- +linkgit:gittutorial[7], +linkgit:gitcvs-migration[7], +linkgit:gitcore-tutorial[7], +linkgit:gitglossary[7], +link:everyday.html[Everyday git], +link:user-manual.html[The Git User's Manual] + +GIT +--- +Part of the linkgit:git[1] suite. diff --git a/Documentation/tutorial.txt b/Documentation/gittutorial.txt index e2bbda53f0..9563a632eb 100644 --- a/Documentation/tutorial.txt +++ b/Documentation/gittutorial.txt @@ -1,5 +1,16 @@ -A tutorial introduction to git (for version 1.5.1 or newer) -=========================================================== +gittutorial(7) +============== + +NAME +---- +gittutorial - A tutorial introduction to git (for version 1.5.1 or newer) + +SYNOPSIS +-------- +git * + +DESCRIPTION +----------- This tutorial explains how to import a new project into git, make changes to it, and share changes with other developers. @@ -381,7 +392,7 @@ see linkgit:git-pull[1] for details. Git can also be used in a CVS-like mode, with a central repository that various users push changes to; see linkgit:git-push[1] and -link:cvs-migration.html[git for CVS users]. +linkgit:gitcvs-migration[7][git for CVS users]. Exploring history ----------------- @@ -560,7 +571,7 @@ is based: used to create commits, check out working directories, and hold the various trees involved in a merge. -link:tutorial-2.html[Part two of this tutorial] explains the object +linkgit:gittutorial-2[7][Part two of this tutorial] explains the object database, the index file, and a few other odds and ends that you'll need to make the most of git. @@ -581,4 +592,17 @@ digressions that may be interesting at this point are: * link:everyday.html[Everyday GIT with 20 Commands Or So] - * link:cvs-migration.html[git for CVS users]. + * linkgit:gitcvs-migration[7][git for CVS users]. + +SEE ALSO +-------- +linkgit:gittutorial-2[7], +linkgit:gitcvs-migration[7], +linkgit:gitcore-tutorial[7], +linkgit:gitglossary[7], +link:everyday.html[Everyday git], +link:user-manual.html[The Git User's Manual] + +GIT +--- +Part of the linkgit:git[1] suite. diff --git a/Documentation/glossary.txt b/Documentation/glossary-content.txt index 51b63532b6..9b4a4f45e9 100644 --- a/Documentation/glossary.txt +++ b/Documentation/glossary-content.txt @@ -1,6 +1,3 @@ -GIT Glossary -============ - [[def_alternate_object_database]]alternate object database:: Via the alternates mechanism, a <<def_repository,repository>> can inherit part of its <<def_object_database,object database>> @@ -90,11 +87,10 @@ to point at the new commit. source code management tools. [[def_DAG]]DAG:: - Directed acyclic graph. The <<def_commit,commit>> objects form a + Directed acyclic graph. The <<def_commit_object,commit objects>> form a directed acyclic graph, because they have parents (directed), and the - graph of commit objects is acyclic (there is no - <<def_chain,chain>> which begins and ends with the same - <<def_object,object>>). + graph of commit objects is acyclic (there is no <<def_chain,chain>> + which begins and ends with the same <<def_object,object>>). [[def_dangling_object]]dangling object:: An <<def_unreachable_object,unreachable object>> which is not @@ -250,9 +246,10 @@ This commit is referred to as a "merge commit", or sometimes just a the <<def_hash,hash>> of the object. [[def_object_type]]object type:: - One of the identifiers - "<<def_commit,commit>>","<<def_tree,tree>>","<<def_tag,tag>>" or "<<def_blob_object,blob>>" - describing the type of an <<def_object,object>>. + One of the identifiers "<<def_commit_object,commit>>", + "<<def_tree_object,tree>>", "<<def_tag_object,tag>>" or + "<<def_blob_object,blob>>" describing the type of an + <<def_object,object>>. [[def_octopus]]octopus:: To <<def_merge,merge>> more than two <<def_branch,branches>>. Also denotes an diff --git a/Documentation/merge-config.txt b/Documentation/merge-config.txt new file mode 100644 index 0000000000..48ce747cf4 --- /dev/null +++ b/Documentation/merge-config.txt @@ -0,0 +1,40 @@ +merge.stat:: + Whether to print the diffstat berween ORIG_HEAD and merge result + at the end of the merge. True by default. + +merge.log:: + Whether to include summaries of merged commits in newly created + merge commit messages. False by default. + +merge.renameLimit:: + The number of files to consider when performing rename detection + during a merge; if not specified, defaults to the value of + diff.renameLimit. + +merge.tool:: + Controls which merge resolution program is used by + linkgit:git-mergetool[1]. Valid built-in values are: "kdiff3", + "tkdiff", "meld", "xxdiff", "emerge", "vimdiff", "gvimdiff", and + "opendiff". Any other value is treated is custom merge tool + and there must be a corresponing mergetool.<tool>.cmd option. + +merge.verbosity:: + Controls the amount of output shown by the recursive merge + strategy. Level 0 outputs nothing except a final error + message if conflicts were detected. Level 1 outputs only + conflicts, 2 outputs conflicts and file changes. Level 5 and + above outputs debugging information. The default is level 2. + Can be overridden by 'GIT_MERGE_VERBOSITY' environment variable. + +merge.<driver>.name:: + Defines a human readable name for a custom low-level + merge driver. See linkgit:gitattributes[5] for details. + +merge.<driver>.driver:: + Defines the command that implements a custom low-level + merge driver. See linkgit:gitattributes[5] for details. + +merge.<driver>.recursive:: + Names a low-level merge driver to be used when + performing an internal merge between common ancestors. + See linkgit:gitattributes[5] for details. diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt index 9f1fc82550..f37a776489 100644 --- a/Documentation/merge-options.txt +++ b/Documentation/merge-options.txt @@ -1,10 +1,23 @@ ---summary:: +--stat:: Show a diffstat at the end of the merge. The diffstat is also - controlled by the configuration option merge.diffstat. + controlled by the configuration option merge.stat. --n, \--no-summary:: +-n, \--no-stat:: Do not show diffstat at the end of the merge. +--summary, \--no-summary:: + Synonyms to --stat and --no-stat; these are deprecated and will be + removed in the future. + +--log:: + In addition to branch names, populate the log message with + one-line descriptions from the actual commits that are being + merged. + +--no-log:: + Do not list one-line descriptions from the actual commits being + merged. + --no-commit:: Perform the merge but pretend the merge failed and do not autocommit, to give the user a chance to inspect and diff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt index 0193c3ce58..e8bea3e18e 100644 --- a/Documentation/pretty-formats.txt +++ b/Documentation/pretty-formats.txt @@ -123,3 +123,4 @@ The placeholders are: - '%Creset': reset color - '%m': left, right or boundary mark - '%n': newline +- '%x00': print a byte from a hex code diff --git a/Documentation/pull-fetch-param.txt b/Documentation/pull-fetch-param.txt index b6eb7fc618..cbee369947 100644 --- a/Documentation/pull-fetch-param.txt +++ b/Documentation/pull-fetch-param.txt @@ -1,6 +1,8 @@ <repository>:: The "remote" repository that is the source of a fetch - or pull operation. See the section <<URLS,GIT URLS>> below. + or pull operation. This parameter can be either a URL + (see the section <<URLS,GIT URLS>> below) or the name + of a remote (see the section <<REMOTES,REMOTES>> below). <refspec>:: The canonical format of a <refspec> parameter is diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt index 9cd677105d..05d5abec25 100644 --- a/Documentation/rev-list-options.txt +++ b/Documentation/rev-list-options.txt @@ -16,7 +16,8 @@ include::pretty-options.txt[] --date={relative,local,default,iso,rfc,short}:: Only takes effect for dates shown in human-readable format, such - as when using "--pretty". + as when using "--pretty". `log.date` config variable sets a default + value for log command's --date option. + `--date=relative` shows dates relative to the current time, e.g. "2 hours ago". @@ -33,17 +34,21 @@ format, often found in E-mail messages. `--date=default` shows timestamps in the original timezone (either committer's or author's). +ifdef::git-rev-list[] --header:: Print the contents of the commit in raw-format; each record is separated with a NUL character. +endif::git-rev-list[] --parents:: Print the parents of the commit. +ifdef::git-rev-list[] --timestamp:: Print the raw commit timestamp. +endif::git-rev-list[] --left-right:: @@ -75,6 +80,16 @@ you would get an output line this: -xxxxxxx... 1st on a ----------------------------------------------------------------------- +--graph:: + + Draw a text-based graphical representation of the commit history + on the left hand side of the output. This may cause extra lines + to be printed in between commits, in order for the graph history + to be drawn properly. ++ +This implies the '--topo-order' option by default, but the +'--date-order' option may also be specified. + Diff Formatting ~~~~~~~~~~~~~~~ @@ -195,6 +210,7 @@ endif::git-rev-list[] Pretend as if all the refs in `$GIT_DIR/refs/` are listed on the command line as '<commit>'. +ifdef::git-rev-list[] --stdin:: In addition to the '<commit>' listed on the command @@ -207,6 +223,7 @@ endif::git-rev-list[] test the exit status to see if a range of objects is fully connected (or not). It is faster than redirecting stdout to /dev/null as the output does not have to be formatted. +endif::git-rev-list[] --cherry-pick:: diff --git a/Documentation/technical/api-history-graph.txt b/Documentation/technical/api-history-graph.txt new file mode 100644 index 0000000000..e9559790a3 --- /dev/null +++ b/Documentation/technical/api-history-graph.txt @@ -0,0 +1,179 @@ +history graph API +================= + +The graph API is used to draw a text-based representation of the commit +history. The API generates the graph in a line-by-line fashion. + +Functions +--------- + +Core functions: + +* `graph_init()` creates a new `struct git_graph` + +* `graph_release()` destroys a `struct git_graph`, and frees the memory + associated with it. + +* `graph_update()` moves the graph to a new commit. + +* `graph_next_line()` outputs the next line of the graph into a strbuf. It + does not add a terminating newline. + +* `graph_padding_line()` outputs a line of vertical padding in the graph. It + is similar to `graph_next_line()`, but is guaranteed to never print the line + containing the current commit. Where `graph_next_line()` would print the + commit line next, `graph_padding_line()` prints a line that simply extends + all branch lines downwards one row, leaving their positions unchanged. + +* `graph_is_commit_finished()` determines if the graph has output all lines + necessary for the current commit. If `graph_update()` is called before all + lines for the current commit have been printed, the next call to + `graph_next_line()` will output an ellipsis, to indicate that a portion of + the graph was omitted. + +The following utility functions are wrappers around `graph_next_line()` and +`graph_is_commit_finished()`. They always print the output to stdout. +They can all be called with a NULL graph argument, in which case no graph +output will be printed. + +* `graph_show_commit()` calls `graph_next_line()` until it returns non-zero. + This prints all graph lines up to, and including, the line containing this + commit. Output is printed to stdout. The last line printed does not contain + a terminating newline. This should not be called if the commit line has + already been printed, or it will loop forever. + +* `graph_show_oneline()` calls `graph_next_line()` and prints the result to + stdout. The line printed does not contain a terminating newline. + +* `graph_show_padding()` calls `graph_padding_line()` and prints the result to + stdout. The line printed does not contain a terminating newline. + +* `graph_show_remainder()` calls `graph_next_line()` until + `graph_is_commit_finished()` returns non-zero. Output is printed to stdout. + The last line printed does not contain a terminating newline. Returns 1 if + output was printed, and 0 if no output was necessary. + +* `graph_show_strbuf()` prints the specified strbuf to stdout, prefixing all + lines but the first with a graph line. The caller is responsible for + ensuring graph output for the first line has already been printed to stdout. + (This can be done with `graph_show_commit()` or `graph_show_oneline()`.) If + a NULL graph is supplied, the strbuf is printed as-is. + +* `graph_show_commit_msg()` is similar to `graph_show_strbuf()`, but it also + prints the remainder of the graph, if more lines are needed after the strbuf + ends. It is better than directly calling `graph_show_strbuf()` followed by + `graph_show_remainder()` since it properly handles buffers that do not end in + a terminating newline. The output printed by `graph_show_commit_msg()` will + end in a newline if and only if the strbuf ends in a newline. + +Data structure +-------------- +`struct git_graph` is an opaque data type used to store the current graph +state. + +Calling sequence +---------------- + +* Create a `struct git_graph` by calling `graph_init()`. When using the + revision walking API, this is done automatically by `setup_revisions()` if + the '--graph' option is supplied. + +* Use the revision walking API to walk through a group of contiguous commits. + The `get_revision()` function automatically calls `graph_update()` each time + it is invoked. + +* For each commit, call `graph_next_line()` repeatedly, until + `graph_is_commit_finished()` returns non-zero. Each call go + `graph_next_line()` will output a single line of the graph. The resulting + lines will not contain any newlines. `graph_next_line()` returns 1 if the + resulting line contains the current commit, or 0 if this is merely a line + needed to adjust the graph before or after the current commit. This return + value can be used to determine where to print the commit summary information + alongside the graph output. + +Limitations +----------- + +* `graph_update()` must be called with commits in topological order. It should + not be called on a commit if it has already been invoked with an ancestor of + that commit, or the graph output will be incorrect. + +* `graph_update()` must be called on a contiguous group of commits. If + `graph_update()` is called on a particular commit, it should later be called + on all parents of that commit. Parents must not be skipped, or the graph + output will appear incorrect. ++ +`graph_update()` may be used on a pruned set of commits only if the parent list +has been rewritten so as to include only ancestors from the pruned set. + +* The graph API does not currently support reverse commit ordering. In + order to implement reverse ordering, the graphing API needs an + (efficient) mechanism to find the children of a commit. + +Sample usage +------------ + +------------ +struct commit *commit; +struct git_graph *graph = graph_init(opts); + +while ((commit = get_revision(opts)) != NULL) { + graph_update(graph, commit); + while (!graph_is_commit_finished(graph)) + { + struct strbuf sb; + int is_commit_line; + + strbuf_init(&sb, 0); + is_commit_line = graph_next_line(graph, &sb); + fputs(sb.buf, stdout); + + if (is_commit_line) + log_tree_commit(opts, commit); + else + putchar(opts->diffopt.line_termination); + } +} + +graph_release(graph); +------------ + +Sample output +------------- + +The following is an example of the output from the graph API. This output does +not include any commit summary information--callers are responsible for +outputting that information, if desired. + +------------ +* +* +M +|\ +* | +| | * +| \ \ +| \ \ +M-. \ \ +|\ \ \ \ +| | * | | +| | | | | * +| | | | | * +| | | | | M +| | | | | |\ +| | | | | | * +| * | | | | | +| | | | | M \ +| | | | | |\ | +| | | | * | | | +| | | | * | | | +* | | | | | | | +| |/ / / / / / +|/| / / / / / +* | | | | | | +|/ / / / / / +* | | | | | +| | | | | * +| | | | |/ +| | | | * +------------ diff --git a/Documentation/technical/api-revision-walking.txt b/Documentation/technical/api-revision-walking.txt index 01a24551af..996da0503a 100644 --- a/Documentation/technical/api-revision-walking.txt +++ b/Documentation/technical/api-revision-walking.txt @@ -1,9 +1,67 @@ revision walking API ==================== +The revision walking API offers functions to build a list of revisions +and then iterate over that list. + +Calling sequence +---------------- + +The walking API has a given calling sequence: first you need to +initialize a rev_info structure, then add revisions to control what kind +of revision list do you want to get, finally you can iterate over the +revision list. + +Functions +--------- + +`init_revisions`:: + + Initialize a rev_info structure with default values. The second + parameter may be NULL or can be prefix path, and then the `.prefix` + variable will be set to it. This is typically the first function you + want to call when you want to deal with a revision list. After calling + this function, you are free to customize options, like set + `.ignore_merges` to 0 if you don't want to ignore merges, and so on. See + `revision.h` for a complete list of available options. + +`add_pending_object`:: + + This function can be used if you want to add commit objects as revision + information. You can use the `UNINTERESTING` object flag to indicate if + you want to include or exclude the given commit (and commits reachable + from the given commit) from the revision list. ++ +NOTE: If you have the commits as a string list then you probably want to +use setup_revisions(), instead of parsing each string and using this +function. + +`setup_revisions`:: + + Parse revision information, filling in the `rev_info` structure, and + removing the used arguments from the argument list. Returns the number + of arguments left that weren't recognized, which are also moved to the + head of the argument list. The last parameter is used in case no + parameter given by the first two arguments. + +`prepare_revision_walk`:: + + Prepares the rev_info structure for a walk. You should check if it + returns any error (non-zero return code) and if it does not, you can + start using get_revision() to do the iteration. + +`get_revision`:: + + Takes a pointer to a `rev_info` structure and iterates over it, + returning a `struct commit *` each time you call it. The end of the + revision list is indicated by returning a NULL pointer. + +Data structures +--------------- + Talk about <revision.h>, things like: * two diff_options, one for path limiting, another for output; -* calling sequence: init_revisions(), setup_revsions(), get_revision(); +* remaining functions; (Linus, JC, Dscho) diff --git a/Documentation/technical/api-strbuf.txt b/Documentation/technical/api-strbuf.txt index a52e4f36d5..a9668e5f2d 100644 --- a/Documentation/technical/api-strbuf.txt +++ b/Documentation/technical/api-strbuf.txt @@ -1,6 +1,241 @@ strbuf API ========== -Talk about <strbuf.h> +strbuf's are meant to be used with all the usual C string and memory +APIs. Given that the length of the buffer is known, it's often better to +use the mem* functions than a str* one (memchr vs. strchr e.g.). +Though, one has to be careful about the fact that str* functions often +stop on NULs and that strbufs may have embedded NULs. -(Pierre, JC) +An strbuf is NUL terminated for convenience, but no function in the +strbuf API actually relies on the string being free of NULs. + +strbufs has some invariants that are very important to keep in mind: + +. The `buf` member is never NULL, so you it can be used in any usual C +string operations safely. strbuf's _have_ to be initialized either by +`strbuf_init()` or by `= STRBUF_INIT` before the invariants, though. ++ +Do *not* assume anything on what `buf` really is (e.g. if it is +allocated memory or not), use `strbuf_detach()` to unwrap a memory +buffer from its strbuf shell in a safe way. That is the sole supported +way. This will give you a malloced buffer that you can later `free()`. ++ +However, it it totally safe to modify anything in the string pointed by +the `buf` member, between the indices `0` and `len-1` (inclusive). + +. The `buf` member is a byte array that has at least `len + 1` bytes + allocated. The extra byte is used to store a `'\0'`, allowing the + `buf` member to be a valid C-string. Every strbuf function ensure this + invariant is preserved. ++ +NOTE: It is OK to "play" with the buffer directly if you work it this + way: ++ +---- +strbuf_grow(sb, SOME_SIZE); <1> +strbuf_setlen(sb, sb->len + SOME_OTHER_SIZE); +---- +<1> Here, the memory array starting at `sb->buf`, and of length +`strbuf_avail(sb)` is all yours, and you can be sure that +`strbuf_avail(sb)` is at least `SOME_SIZE`. ++ +NOTE: `SOME_OTHER_SIZE` must be smaller or equal to `strbuf_avail(sb)`. ++ +Doing so is safe, though if it has to be done in many places, adding the +missing API to the strbuf module is the way to go. ++ +WARNING: Do _not_ assume that the area that is yours is of size `alloc +- 1` even if it's true in the current implementation. Alloc is somehow a +"private" member that should not be messed with. Use `strbuf_avail()` +instead. + +Data structures +--------------- + +* `struct strbuf` + +This is string buffer structure. The `len` member can be used to +determine the current length of the string, and `buf` member provides access to +the string itself. + +Functions +--------- + +* Life cycle + +`strbuf_init`:: + + Initialize the structure. The second parameter can be zero or a bigger + number to allocate memory, in case you want to prevent further reallocs. + +`strbuf_release`:: + + Release a string buffer and the memory it used. You should not use the + string buffer after using this function, unless you initialize it again. + +`strbuf_detach`:: + + Detach the string from the strbuf and returns it; you now own the + storage the string occupies and it is your responsibility from then on + to release it with `free(3)` when you are done with it. + +`strbuf_attach`:: + + Attach a string to a buffer. You should specify the string to attach, + the current length of the string and the amount of allocated memory. + The amount must be larger than the string length, because the string you + pass is supposed to be a NUL-terminated string. This string _must_ be + malloc()ed, and after attaching, the pointer cannot be relied upon + anymore, and neither be free()d directly. + +`strbuf_swap`:: + + Swap the contents of two string buffers. + +* Related to the size of the buffer + +`strbuf_avail`:: + + Determine the amount of allocated but unused memory. + +`strbuf_grow`:: + + Ensure that at least this amount of unused memory is available after + `len`. This is used when you know a typical size for what you will add + and want to avoid repetitive automatic resizing of the underlying buffer. + This is never a needed operation, but can be critical for performance in + some cases. + +`strbuf_setlen`:: + + Set the length of the buffer to a given value. This function does *not* + allocate new memory, so you should not perform a `strbuf_setlen()` to a + length that is larger than `len + strbuf_avail()`. `strbuf_setlen()` is + just meant as a 'please fix invariants from this strbuf I just messed + with'. + +`strbuf_reset`:: + + Empty the buffer by setting the size of it to zero. + +* Related to the contents of the buffer + +`strbuf_rtrim`:: + + Strip whitespace from the end of a string. + +`strbuf_cmp`:: + + Compare two buffers. Returns an integer less than, equal to, or greater + than zero if the first buffer is found, respectively, to be less than, + to match, or be greater than the second buffer. + +* Adding data to the buffer + +NOTE: All of these functions in this section will grow the buffer as + necessary. + +`strbuf_addch`:: + + Add a single character to the buffer. + +`strbuf_insert`:: + + Insert data to the given position of the buffer. The remaining contents + will be shifted, not overwritten. + +`strbuf_remove`:: + + Remove given amount of data from a given position of the buffer. + +`strbuf_splice`:: + + Remove the bytes between `pos..pos+len` and replace it with the given + data. + +`strbuf_add`:: + + Add data of given length to the buffer. + +`strbuf_addstr`:: + +Add a NUL-terminated string to the buffer. ++ +NOTE: This function will *always* be implemented as an inline or a macro +that expands to: ++ +---- +strbuf_add(..., s, strlen(s)); +---- ++ +Meaning that this is efficient to write things like: ++ +---- +strbuf_addstr(sb, "immediate string"); +---- + +`strbuf_addbuf`:: + + Copy the contents of an other buffer at the end of the current one. + +`strbuf_adddup`:: + + Copy part of the buffer from a given position till a given length to the + end of the buffer. + +`strbuf_expand`:: + + This function can be used to expand a format string containing + placeholders. To that end, it parses the string and calls the specified + function for every percent sign found. ++ +The callback function is given a pointer to the character after the `%` +and a pointer to the struct strbuf. It is expected to add the expanded +version of the placeholder to the strbuf, e.g. to add a newline +character if the letter `n` appears after a `%`. The function returns +the length of the placeholder recognized and `strbuf_expand()` skips +over it. ++ +All other characters (non-percent and not skipped ones) are copied +verbatim to the strbuf. If the callback returned zero, meaning that the +placeholder is unknown, then the percent sign is copied, too. ++ +In order to facilitate caching and to make it possible to give +parameters to the callback, `strbuf_expand()` passes a context pointer, +which can be used by the programmer of the callback as she sees fit. + +`strbuf_addf`:: + + Add a formatted string to the buffer. + +`strbuf_fread`:: + + Read a given size of data from a FILE* pointer to the buffer. ++ +NOTE: The buffer is rewinded if the read fails. If -1 is returned, +`errno` must be consulted, like you would do for `read(3)`. +`strbuf_read()`, `strbuf_read_file()` and `strbuf_getline()` has the +same behaviour as well. + +`strbuf_read`:: + + Read the contents of a given file descriptor. The third argument can be + used to give a hint about the file size, to avoid reallocs. + +`strbuf_read_file`:: + + Read the contents of a file, specified by its path. The third argument + can be used to give a hint about the file size, to avoid reallocs. + +`strbuf_getline`:: + + Read a line from a FILE* pointer. The second argument specifies the line + terminator character, typically `'\n'`. + +`stripspace`:: + + Strip whitespace from a buffer. The second parameter controls if + comments are considered contents to be removed or not. + +`launch_editor`:: diff --git a/Documentation/urls-remotes.txt b/Documentation/urls-remotes.txt index 5dd1f836c6..99753006e2 100644 --- a/Documentation/urls-remotes.txt +++ b/Documentation/urls-remotes.txt @@ -1,55 +1,82 @@ include::urls.txt[] -REMOTES -------- +REMOTES[[REMOTES]] +------------------ -In addition to the above, as a short-hand, the name of a -file in `$GIT_DIR/remotes` directory can be given; the -named file should be in the following format: +The name of one of the following can be used instead +of a URL as `<repository>` argument: ------------- - URL: one of the above URL format - Push: <refspec> - Pull: <refspec> +* a remote in the git configuration file: `$GIT_DIR/config`, +* a file in the `$GIT_DIR/remotes` directory, or +* a file in the `$GIT_DIR/branches` directory. ------------- +All of these also allow you to omit the refspec from the command line +because they each contain a refspec which git will use by default. -Then such a short-hand is specified in place of -<repository> without <refspec> parameters on the command -line, <refspec> specified on `Push:` lines or `Pull:` -lines are used for `git-push` and `git-fetch`/`git-pull`, -respectively. Multiple `Push:` and `Pull:` lines may -be specified for additional branch mappings. +Named remote in configuration file +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Or, equivalently, in the `$GIT_DIR/config` (note the use -of `fetch` instead of `Pull:`): +You can choose to provide the name of a remote which you had previously +configured using linkgit:git-remote[1], linkgit:git-config[1] +or even by a manual edit to the `$GIT_DIR/config` file. The URL of +this remote will be used to access the repository. The refspec +of this remote will be used by default when you do +not provide a refspec on the command line. The entry in the +config file would appear like this: ------------ - [remote "<remote>"] + [remote "<name>"] url = <url> push = <refspec> fetch = <refspec> - ------------ -The name of a file in `$GIT_DIR/branches` directory can be -specified as an older notation short-hand; the named -file should contain a single line, a URL in one of the -above formats, optionally followed by a hash `#` and the -name of remote head (URL fragment notation). -`$GIT_DIR/branches/<remote>` file that stores a <url> -without the fragment is equivalent to have this in the -corresponding file in the `$GIT_DIR/remotes/` directory. + +Named file in `$GIT_DIR/remotes` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can choose to provide the name of a +file in `$GIT_DIR/remotes`. The URL +in this file will be used to access the repository. The refspec +in this file will be used as default when you do not +provide a refspec on the command line. This file should have the +following format: + +------------ + URL: one of the above URL format + Push: <refspec> + Pull: <refspec> ------------ - URL: <url> - Pull: refs/heads/master:<remote> +`Push:` lines are used by `git-push` and +`Pull:` lines are used by `git-pull` and `git-fetch`. +Multiple `Push:` and `Pull:` lines may +be specified for additional branch mappings. + +Named file in `$GIT_DIR/branches` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can choose to provide the name of a +file in `$GIT_DIR/branches`. +The URL in this file will be used to access the repository. +This file should have the following format: + + +------------ + <url>#<head> ------------ -while having `<url>#<head>` is equivalent to +`<url>` is required; `#<head>` is optional. +When you do not provide a refspec on the command line, +git will use the following refspec, where `<head>` defaults to `master`, +and `<repository>` is the name of this file +you provided in the command line. ------------ - URL: <url> - Pull: refs/heads/<head>:<remote> + refs/heads/<head>:<repository> ------------ + + + + diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt index 86b91a53e5..bfde507e0e 100644 --- a/Documentation/user-manual.txt +++ b/Documentation/user-manual.txt @@ -1881,7 +1881,7 @@ $ chmod a+x hooks/post-update (For an explanation of the last two lines, see linkgit:git-update-server-info[1], and the documentation -link:hooks.html[Hooks used by git].) +linkgit:githooks[5][Hooks used by git].) Advertise the URL of proj.git. Anybody else should then be able to clone or pull from that URL, for example with a command line like: @@ -1993,7 +1993,7 @@ the right to push to the same repository. In that case, the correct solution is to retry the push after first updating your work by either a pull or a fetch followed by a rebase; see the <<setting-up-a-shared-repository,next section>> and -link:cvs-migration.html[git for CVS users] for more. +linkgit:gitcvs-migration[7][git for CVS users] for more. [[setting-up-a-shared-repository]] Setting up a shared repository @@ -2002,7 +2002,7 @@ Setting up a shared repository Another way to collaborate is by using a model similar to that commonly used in CVS, where several developers with special rights all push to and pull from a single shared repository. See -link:cvs-migration.html[git for CVS users] for instructions on how to +linkgit:gitcvs-migration[7][git for CVS users] for instructions on how to set this up. However, while there is nothing wrong with git's support for shared @@ -4252,7 +4252,10 @@ You see, Git is actually the best tool to find out about the source of Git itself! [[glossary]] -include::glossary.txt[] +GIT Glossary +============ + +include::glossary-content.txt[] [[git-quick-start]] Appendix A: Git Quick Reference |