Merge branch 'maint-1.7.6' into maint

* maint-1.7.6:
  make the sample pre-commit hook script reject names with newlines, too
  git-read-tree.txt: update sparse checkout examples
  git-read-tree.txt: correct sparse-checkout and skip-worktree description
  git-read-tree.txt: language and typography fixes
  unpack-trees: print "Aborting" to stderr
  Documentation/git-update-index: refer to 'ls-files'
  Documentation: basic configuration of notes.rewriteRef
This commit is contained in:
Junio C Hamano 2011-10-26 16:09:28 -07:00
commit 411e6cf197
7 changed files with 46 additions and 32 deletions

View File

@ -1453,7 +1453,8 @@ notes.rewriteRef::
You may also specify this configuration several times. You may also specify this configuration several times.
+ +
Does not have a default value; you must configure this variable to Does not have a default value; you must configure this variable to
enable note rewriting. enable note rewriting. Set it to `refs/notes/commits` to enable
rewriting for the default commit notes.
+ +
This setting can be overridden with the `GIT_NOTES_REWRITE_REF` This setting can be overridden with the `GIT_NOTES_REWRITE_REF`
environment variable, which must be a colon separated list of refs or environment variable, which must be a colon separated list of refs or

View File

@ -47,7 +47,7 @@ OPTIONS
-i:: -i::
Usually a merge requires the index file as well as the Usually a merge requires the index file as well as the
files in the working tree are up to date with the files in the working tree to be up to date with the
current head commit, in order not to lose local current head commit, in order not to lose local
changes. This flag disables the check with the working changes. This flag disables the check with the working
tree and is meant to be used when creating a merge of tree and is meant to be used when creating a merge of
@ -71,21 +71,21 @@ OPTIONS
--aggressive:: --aggressive::
Usually a three-way merge by 'git read-tree' resolves Usually a three-way merge by 'git read-tree' resolves
the merge for really trivial cases and leaves other the merge for really trivial cases and leaves other
cases unresolved in the index, so that Porcelains can cases unresolved in the index, so that porcelains can
implement different merge policies. This flag makes the implement different merge policies. This flag makes the
command to resolve a few more cases internally: command resolve a few more cases internally:
+ +
* when one side removes a path and the other side leaves the path * when one side removes a path and the other side leaves the path
unmodified. The resolution is to remove that path. unmodified. The resolution is to remove that path.
* when both sides remove a path. The resolution is to remove that path. * when both sides remove a path. The resolution is to remove that path.
* when both sides adds a path identically. The resolution * when both sides add a path identically. The resolution
is to add that path. is to add that path.
--prefix=<prefix>/:: --prefix=<prefix>/::
Keep the current index contents, and read the contents Keep the current index contents, and read the contents
of named tree-ish under directory at `<prefix>`. The of the named tree-ish under the directory at `<prefix>`. The
original index file cannot have anything at the path original index file cannot have anything at the path
`<prefix>` itself, and have nothing in `<prefix>/` `<prefix>` itself, nor anything in the `<prefix>/`
directory. Note that the `<prefix>/` value must end directory. Note that the `<prefix>/` value must end
with a slash. with a slash.
@ -379,45 +379,45 @@ have finished your work-in-progress), attempt the merge again.
Sparse checkout Sparse checkout
--------------- ---------------
"Sparse checkout" allows to sparsely populate working directory. "Sparse checkout" allows populating the working directory sparsely.
It uses skip-worktree bit (see linkgit:git-update-index[1]) to tell It uses the skip-worktree bit (see linkgit:git-update-index[1]) to tell
Git whether a file on working directory is worth looking at. Git whether a file in the working directory is worth looking at.
"git read-tree" and other merge-based commands ("git merge", "git 'git read-tree' and other merge-based commands ('git merge', 'git
checkout"...) can help maintaining skip-worktree bitmap and working checkout'...) can help maintaining the skip-worktree bitmap and working
directory update. `$GIT_DIR/info/sparse-checkout` is used to directory update. `$GIT_DIR/info/sparse-checkout` is used to
define the skip-worktree reference bitmap. When "git read-tree" needs define the skip-worktree reference bitmap. When 'git read-tree' needs
to update working directory, it will reset skip-worktree bit in index to update the working directory, it resets the skip-worktree bit in the index
based on this file, which uses the same syntax as .gitignore files. based on this file, which uses the same syntax as .gitignore files.
If an entry matches a pattern in this file, skip-worktree will be If an entry matches a pattern in this file, skip-worktree will not be
set on that entry. Otherwise, skip-worktree will be unset. set on that entry. Otherwise, skip-worktree will be set.
Then it compares the new skip-worktree value with the previous one. If Then it compares the new skip-worktree value with the previous one. If
skip-worktree turns from unset to set, it will add the corresponding skip-worktree turns from set to unset, it will add the corresponding
file back. If it turns from set to unset, that file will be removed. file back. If it turns from unset to set, that file will be removed.
While `$GIT_DIR/info/sparse-checkout` is usually used to specify what While `$GIT_DIR/info/sparse-checkout` is usually used to specify what
files are in. You can also specify what files are _not_ in, using files are in, you can also specify what files are _not_ in, using
negate patterns. For example, to remove file "unwanted": negate patterns. For example, to remove the file `unwanted`:
---------------- ----------------
* /*
!unwanted !unwanted
---------------- ----------------
Another tricky thing is fully repopulating working directory when you Another tricky thing is fully repopulating the working directory when you
no longer want sparse checkout. You cannot just disable "sparse no longer want sparse checkout. You cannot just disable "sparse
checkout" because skip-worktree are still in the index and you working checkout" because skip-worktree bits are still in the index and your working
directory is still sparsely populated. You should re-populate working directory is still sparsely populated. You should re-populate the working
directory with the `$GIT_DIR/info/sparse-checkout` file content as directory with the `$GIT_DIR/info/sparse-checkout` file content as
follows: follows:
---------------- ----------------
* /*
---------------- ----------------
Then you can disable sparse checkout. Sparse checkout support in "git Then you can disable sparse checkout. Sparse checkout support in 'git
read-tree" and similar commands is disabled by default. You need to read-tree' and similar commands is disabled by default. You need to
turn `core.sparseCheckout` on in order to have sparse checkout turn `core.sparseCheckout` on in order to have sparse checkout
support. support.

View File

@ -264,7 +264,9 @@ tree files, you have to explicitly tell git about it by dropping
"assume unchanged" bit, either before or after you modify them. "assume unchanged" bit, either before or after you modify them.
In order to set "assume unchanged" bit, use `--assume-unchanged` In order to set "assume unchanged" bit, use `--assume-unchanged`
option. To unset, use `--no-assume-unchanged`. option. To unset, use `--no-assume-unchanged`. To see which files
have the "assume unchanged" bit set, use `git ls-files -v`
(see linkgit:git-ls-files[1]).
The command looks at `core.ignorestat` configuration variable. When The command looks at `core.ignorestat` configuration variable. When
this is true, paths updated with `git update-index paths...` and this is true, paths updated with `git update-index paths...` and
@ -363,7 +365,8 @@ ctime for marking files processed) (see linkgit:git-config[1]).
SEE ALSO SEE ALSO
-------- --------
linkgit:git-config[1], linkgit:git-config[1],
linkgit:git-add[1] linkgit:git-add[1],
linkgit:git-ls-files[1]
GIT GIT
--- ---

View File

@ -107,6 +107,7 @@ error: The following untracked working tree files would be overwritten by merge:
sub sub
sub2 sub2
Please move or remove them before you can merge. Please move or remove them before you can merge.
Aborting
EOF EOF
test_expect_success 'will not overwrite untracked file in leading path' ' test_expect_success 'will not overwrite untracked file in leading path' '

View File

@ -32,6 +32,7 @@ error: The following untracked working tree files would be overwritten by merge:
three three
two two
Please move or remove them before you can merge. Please move or remove them before you can merge.
Aborting
EOF EOF
test_expect_success 'untracked files overwritten by merge (fast and non-fast forward)' ' test_expect_success 'untracked files overwritten by merge (fast and non-fast forward)' '
@ -56,6 +57,7 @@ Please, commit your changes or stash them before you can merge.
error: The following untracked working tree files would be overwritten by merge: error: The following untracked working tree files would be overwritten by merge:
five five
Please move or remove them before you can merge. Please move or remove them before you can merge.
Aborting
EOF EOF
test_expect_success 'untracked files or local changes ovewritten by merge' ' test_expect_success 'untracked files or local changes ovewritten by merge' '
@ -71,6 +73,7 @@ error: Your local changes to the following files would be overwritten by checkou
rep/one rep/one
rep/two rep/two
Please, commit your changes or stash them before you can switch branches. Please, commit your changes or stash them before you can switch branches.
Aborting
EOF EOF
test_expect_success 'cannot switch branches because of local changes' ' test_expect_success 'cannot switch branches because of local changes' '
@ -92,6 +95,7 @@ error: Your local changes to the following files would be overwritten by checkou
rep/one rep/one
rep/two rep/two
Please, commit your changes or stash them before you can switch branches. Please, commit your changes or stash them before you can switch branches.
Aborting
EOF EOF
test_expect_success 'not uptodate file porcelain checkout error' ' test_expect_success 'not uptodate file porcelain checkout error' '
@ -105,6 +109,7 @@ error: Updating the following directories would lose untracked files in it:
rep rep
rep2 rep2
Aborting
EOF EOF
test_expect_success 'not_uptodate_dir porcelain checkout error' ' test_expect_success 'not_uptodate_dir porcelain checkout error' '

View File

@ -18,6 +18,9 @@ fi
# If you want to allow non-ascii filenames set this variable to true. # If you want to allow non-ascii filenames set this variable to true.
allownonascii=$(git config hooks.allownonascii) allownonascii=$(git config hooks.allownonascii)
# Redirect output to stderr.
exec 1>&2
# Cross platform projects tend to avoid non-ascii filenames; prevent # Cross platform projects tend to avoid non-ascii filenames; prevent
# them from being added to the repository. We exploit the fact that the # them from being added to the repository. We exploit the fact that the
# printable range starts at the space character and ends with tilde. # printable range starts at the space character and ends with tilde.
@ -25,8 +28,8 @@ if [ "$allownonascii" != "true" ] &&
# Note that the use of brackets around a tr range is ok here, (it's # Note that the use of brackets around a tr range is ok here, (it's
# even required, for portability to Solaris 10's /usr/bin/tr), since # even required, for portability to Solaris 10's /usr/bin/tr), since
# the square bracket bytes happen to fall in the designated range. # the square bracket bytes happen to fall in the designated range.
test "$(git diff --cached --name-only --diff-filter=A -z $against | test $(git diff --cached --name-only --diff-filter=A -z $against |
LC_ALL=C tr -d '[ -~]\0')" LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
then then
echo "Error: Attempt to add a non-ascii file name." echo "Error: Attempt to add a non-ascii file name."
echo echo
@ -43,4 +46,5 @@ then
exit 1 exit 1
fi fi
# If there are whitespace errors, print the offending file names and fail.
exec git diff-index --check --cached $against -- exec git diff-index --check --cached $against --

View File

@ -159,7 +159,7 @@ static void display_error_msgs(struct unpack_trees_options *o)
string_list_clear(rejects, 0); string_list_clear(rejects, 0);
} }
if (something_displayed) if (something_displayed)
printf("Aborting\n"); fprintf(stderr, "Aborting\n");
} }
/* /*