From: Junio C Hamano Date: Wed, 8 Apr 2009 06:05:14 +0000 (-0700) Subject: Merge branch 'maint-1.6.1' into maint X-Git-Tag: v1.6.2.3~8 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/747f9d30ed706ebd930ef888971fff5638334831?ds=inline;hp=-c Merge branch 'maint-1.6.1' into maint * maint-1.6.1: Documentation: clarify .gitattributes search git-checkout.txt: clarify that applies when no path is given. git-checkout.txt: fix incorrect statement about HEAD and index --- 747f9d30ed706ebd930ef888971fff5638334831 diff --combined Documentation/git-checkout.txt index 3bccffae62,5ece6cc805..132fc4faa5 --- a/Documentation/git-checkout.txt +++ b/Documentation/git-checkout.txt @@@ -127,16 -127,16 +127,20 @@@ the conflicted merge in the specified p :: Name for the new branch. + :: + Tree to checkout from (when paths are given). If not specified, + the index will be used. + :: - Branch to checkout; may be any object ID that resolves to a - commit. Defaults to HEAD. + Branch to checkout (when no paths are given); may be any object + ID that resolves to a commit. Defaults to HEAD. + When this parameter names a non-branch (but still a valid commit object), your HEAD becomes 'detached'. ++ +As a special case, the "`@\{-N\}`" syntax for the N-th last branch +checks out the branch (instead of detaching). You may also specify +"`-`" which is synonymous with "`@\{-1\}`". Detached HEAD @@@ -191,8 -191,8 +195,8 @@@ $ git checkout hello.c <3 ------------ + <1> switch branch - <2> take out a file out of other commit - <3> restore hello.c from HEAD of current branch + <2> take a file out of another commit + <3> restore hello.c from the index + If you have an unfortunate branch that is named `hello.c`, this step would be confused as an instruction to switch to that branch. diff --combined Documentation/gitattributes.txt index 55668e345f,82c10fa0fd..b762bba759 --- a/Documentation/gitattributes.txt +++ b/Documentation/gitattributes.txt @@@ -18,10 -18,10 +18,10 @@@ A `gitattributes` file is a simple tex Each line in `gitattributes` file is of form: - glob attr1 attr2 ... + pattern attr1 attr2 ... -That is, a glob pattern followed by an attributes list, -separated by whitespaces. When the glob pattern matches the +That is, a pattern followed by an attributes list, +separated by whitespaces. When the pattern matches the path in question, the attributes listed on the line are given to the path. @@@ -48,21 -48,20 +48,21 @@@ Set to a value: Unspecified:: - No glob pattern matches the path, and nothing says if + No pattern matches the path, and nothing says if the path has or does not have the attribute, the attribute for the path is said to be Unspecified. -When more than one glob pattern matches the path, a later line +When more than one pattern matches the path, a later line overrides an earlier line. This overriding is done per -attribute. +attribute. The rules how the pattern matches paths are the +same as in `.gitignore` files; see linkgit:gitignore[5]. When deciding what attributes are assigned to a path, git consults `$GIT_DIR/info/attributes` file (which has the highest precedence), `.gitattributes` file in the same directory as the - path in question, and its parent directories (the further the - directory that contains `.gitattributes` is from the path in - question, the lower its precedence). + path in question, and its parent directories up to the toplevel of the + work tree (the further the directory that contains `.gitattributes` + is from the path in question, the lower its precedence). If you wish to affect only a single repository (i.e., to assign attributes to files that are particular to one user's workflow), then @@@ -318,8 -317,6 +318,8 @@@ patterns are available - `bibtex` suitable for files with BibTeX coded references. +- `cpp` suitable for source code in the C and C++ languages. + - `html` suitable for HTML/XHTML documents. - `java` suitable for source code in the Java language. @@@ -337,25 -334,6 +337,25 @@@ - `tex` suitable for source code for LaTeX documents. +Customizing word diff +^^^^^^^^^^^^^^^^^^^^^ + +You can customize the rules that `git diff --color-words` uses to +split words in a line, by specifying an appropriate regular expression +in the "diff.*.wordRegex" configuration variable. For example, in TeX +a backslash followed by a sequence of letters forms a command, but +several such commands can be run together without intervening +whitespace. To separate them, use a regular expression such as + +------------------------ +[diff "tex"] + wordRegex = "\\\\[a-zA-Z]+|[{}]|\\\\.|[^\\{}[:space:]]+" +------------------------ + +A built-in pattern is provided for all languages listed in the +previous section. + + Performing text diffs of binary files ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^