summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Documentation/RelNotes/1.8.1.2.txt12
-rw-r--r--Documentation/RelNotes/1.8.2.txt117
-rw-r--r--Documentation/git-check-ignore.txt89
-rw-r--r--Documentation/git-cvsserver.txt37
-rw-r--r--Documentation/git-for-each-ref.txt2
-rw-r--r--Documentation/git-p4.txt22
-rw-r--r--Documentation/git-reset.txt18
-rw-r--r--Documentation/githooks.txt29
-rw-r--r--Documentation/gitignore.txt6
-rw-r--r--Documentation/howto/maintain-git.txt347
-rw-r--r--Documentation/technical/api-directory-listing.txt14
-rw-r--r--Makefile16
-rw-r--r--README15
-rw-r--r--attr.c38
-rw-r--r--builtin.h1
-rw-r--r--builtin/add.c78
-rw-r--r--builtin/check-ignore.c173
-rw-r--r--builtin/clean.c159
-rw-r--r--builtin/clone.c2
-rw-r--r--builtin/commit.c6
-rw-r--r--builtin/help.c18
-rw-r--r--builtin/ls-files.c15
-rw-r--r--builtin/push.c1
-rw-r--r--builtin/receive-pack.c25
-rw-r--r--builtin/reset.c287
-rw-r--r--cache.h3
-rw-r--r--command-list.txt1
-rw-r--r--contrib/completion/git-completion.bash3
-rwxr-xr-xcontrib/hooks/post-receive-email1
-rwxr-xr-xcontrib/remote-helpers/git-remote-hg13
-rwxr-xr-xcontrib/remote-helpers/test-hg-hg-git.sh68
-rw-r--r--dir.c155
-rw-r--r--dir.h62
-rwxr-xr-xgit-am.sh2
-rw-r--r--git-compat-util.h15
-rwxr-xr-xgit-cvsserver.perl1927
-rwxr-xr-xgit-p4.py152
-rw-r--r--git-rebase--interactive.sh7
-rwxr-xr-xgit-svn.perl37
-rw-r--r--git.c1
-rwxr-xr-xgitk-git/gitk196
-rw-r--r--gitk-git/po/sv.po673
-rw-r--r--help.c17
-rw-r--r--imap-send.c318
-rw-r--r--parse-options.h2
-rw-r--r--pathspec.c101
-rw-r--r--pathspec.h9
-rw-r--r--perl/Git/SVN.pm4
-rw-r--r--perl/Git/SVN/Editor.pm2
-rw-r--r--refs.c10
-rw-r--r--remote.c43
-rw-r--r--run-command.c15
-rw-r--r--run-command.h1
-rw-r--r--setup.c19
-rwxr-xr-xt/t0008-ignores.sh637
-rwxr-xr-xt/t0050-filesystem.sh52
-rwxr-xr-xt/t2013-checkout-submodule.sh2
-rwxr-xr-xt/t3070-wildmatch.sh43
-rwxr-xr-xt/t5516-fetch-push.sh21
-rwxr-xr-xt/t5571-pre-push-hook.sh131
-rwxr-xr-xt/t7102-reset.sh26
-rwxr-xr-xt/t7106-reset-unborn-branch.sh52
-rwxr-xr-xt/t9100-git-svn-basic.sh8
-rwxr-xr-xt/t9402-git-cvsserver-refs.sh551
-rwxr-xr-xt/t9800-git-p4-basic.sh9
-rwxr-xr-xt/t9806-git-p4-options.sh128
-rw-r--r--templates/hooks--pre-push.sample53
-rw-r--r--test-wildmatch.c82
-rw-r--r--transport.c60
-rw-r--r--transport.h1
-rw-r--r--unpack-trees.c2
-rw-r--r--wildmatch.c141
-rw-r--r--wildmatch.h23
74 files changed, 5707 insertions, 1700 deletions
diff --git a/.gitignore b/.gitignore
index aa258a6bcf..6669bf0c6c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,6 +22,7 @@
/git-bundle
/git-cat-file
/git-check-attr
+/git-check-ignore
/git-check-ref-format
/git-checkout
/git-checkout-index
diff --git a/Documentation/RelNotes/1.8.1.2.txt b/Documentation/RelNotes/1.8.1.2.txt
index 76ad0b3d01..5ab7b18906 100644
--- a/Documentation/RelNotes/1.8.1.2.txt
+++ b/Documentation/RelNotes/1.8.1.2.txt
@@ -4,6 +4,16 @@ Git 1.8.1.2 Release Notes
Fixes since v1.8.1.1
--------------------
+ * An element on GIT_CEILING_DIRECTORIES list that does not name the
+ real path to a directory (i.e. a symbolic link) could have caused
+ the GIT_DIR discovery logic to escape the ceiling.
+
+ * Command line completion for "tcsh" emitted an unwanted space
+ after completing a single directory name.
+
+ * Command line completion leaked an unnecessary error message while
+ looking for possible matches with paths in <tree-ish>.
+
* "git archive" did not record uncompressed size in the header when
streaming a zip archive, which confused some implementations of unzip.
@@ -11,3 +21,5 @@ Fixes since v1.8.1.1
trailer part, "git send-email" failed to pick up the addresses from
there. As e-mail headers field names are case insensitive, this
script should follow suit and treat "cc:" and "Cc:" the same way.
+
+Also contains various documentation fixes.
diff --git a/Documentation/RelNotes/1.8.2.txt b/Documentation/RelNotes/1.8.2.txt
index f6d15059dc..5c93f32779 100644
--- a/Documentation/RelNotes/1.8.2.txt
+++ b/Documentation/RelNotes/1.8.2.txt
@@ -15,6 +15,13 @@ current branch to the branch with the same name, only when the current
branch is set to integrate with that remote branch. There is a user
preference configuration variable "push.default" to change this.
+"git push $there tag v1.2.3" used to allow replacing a tag v1.2.3
+that already exists in the repository $there, if the rewritten tag
+you are pushing points at a commit that is a decendant of a commit
+that the old tag v1.2.3 points at. This was found to be error prone
+and starting with this release, any attempt to update an existing
+ref under refs/tags/ hierarchy will fail, without "--force".
+
Updates since v1.8.1
--------------------
@@ -38,11 +45,16 @@ UI, Workflows & Features
* Scripts can ask Git that wildcard patterns in pathspecs they give do
not have any significance, i.e. take them as literal strings.
- * The pathspec code learned to grok "foo/**/bar" as a pattern that
- matches "bar" in 0-or-more levels of subdirectory in "foo".
+ * The patterns in .gitignore and .gitattributes files can have **/,
+ as a pattern that matches 0 or more levels of subdirectory.
+ E.g. "foo/**/bar" matches "bar" in "foo" itself or in a
+ subdirectory of "foo".
* "git blame" (and "git diff") learned the "--no-follow" option.
+ * "git check-ignore" command to help debugging .gitignore files has
+ been added.
+
* "git cherry-pick" can be used to replay a root commit to an unborn
branch.
@@ -72,12 +84,22 @@ UI, Workflows & Features
* "git push" now requires "-f" to update a tag, even if it is a
fast-forward, as tags are meant to be fixed points.
+ * "git push" will stop without doing anything if the new "pre-push"
+ hook exists and exits with a failure.
+
* When "git rebase" fails to generate patches to be applied (e.g. due
to oom), it failed to detect the failure and instead behaved as if
there were nothing to do. A workaround to use a temporary file has
been applied, but we probably would want to revisit this later, as
it hurts the common case of not failing at all.
+ * Input and preconditions to "git reset" has been loosened where
+ appropriate. "git reset $fromtree Makefile" requires $fromtree to
+ be any tree (it used to require it to be a commit), for example.
+ "git reset" (without options or parameters) used to error out when
+ you do not have any commits in your history, but it now gives you
+ an empty index (to match non-existent commit you are not even on).
+
* "git submodule" started learning a new mode to integrate with the
tip of the remote branch (as opposed to integrating with the commit
recorded in the superproject's gitlink).
@@ -90,6 +112,11 @@ Foreign Interface
* A new remote helper to interact with bzr has been added to contrib/.
+ * "git p4" got various bugfixes around its branch handling.
+
+ * The remote helper to interact with Hg in contrib/ has seen a few
+ fixes.
+
Performance, Internal Implementation, etc.
@@ -99,13 +126,33 @@ Performance, Internal Implementation, etc.
* Matching paths with common forms of pathspecs that contain wildcard
characters has been optimized further.
+ * "git reset" internals has been reworked and should be faster in
+ general. We tried to be careful not to break any behaviour but
+ there could be corner cases, especially when running the command
+ from a conflicted state, that we may have missed.
+
* The implementation of "imap-send" has been updated to reuse xml
- quoting code from http-push codepath.
+ quoting code from http-push codepath, and lost a lot of unused
+ code.
* There is a simple-minded checker for the test scripts in t/
directory to catch most common mistakes (it is not enabled by
default).
+ * You can build with USE_WILDMATCH=YesPlease to use a replacement
+ implementation of pattern matching logic used for pathname-like
+ things, e.g. refnames and paths in the repository. This new
+ implementation is not expected change the existing behaviour of Git
+ in this release, except for "git for-each-ref" where you can now
+ say "refs/**/master" and match with both refs/heads/master and
+ refs/remotes/origin/master. We plan to use this new implementation
+ in wider places (e.g. "git ls-files '**/Makefile' may find Makefile
+ at the top-level, and "git log '**/t*.sh'" may find commits that
+ touch a shell script whose name begins with "t" at any level) in
+ future versions of Git, but we are not there yet. By building with
+ USE_WILDMATCH, using the resulting Git daily and reporting when you
+ find breakages, you can help us get closer to that goal.
+
Also contains minor documentation updates and code clean-ups.
@@ -120,13 +167,11 @@ details).
* An element on GIT_CEILING_DIRECTORIES list that does not name the
real path to a directory (i.e. a symbolic link) could have caused
the GIT_DIR discovery logic to escape the ceiling.
- (merge 059b379 mh/ceiling later to maint).
* When attempting to read the XDG-style $HOME/.config/git/config and
finding that $HOME/.config/git is a file, we gave a wrong error
message, instead of treating the case as "a custom config file does
not exist there" and moving on.
- (merge 8f2bbe4 jn/warn-on-inaccessible-loosen later to maint).
* The behaviour visible to the end users was confusing, when they
attempt to kill a process spawned in the editor that was in turn
@@ -137,100 +182,105 @@ details).
* A child process that was killed by a signal (e.g. SIGINT) was
reported in an inconsistent way depending on how the process was
spawned by us, with or without a shell in between.
- (merge 709ca73 jk/unify-exit-code-by-receiving-signal later to maint).
* After failing to create a temporary file using mkstemp(), failing
pathname was not reported correctly on some platforms.
- (merge f7be59b jc/mkstemp-more-careful-error-reporting later to maint).
* The attribute mechanism didn't allow limiting attributes to be
applied to only a single directory itself with "path/" like the
- exclude mechanism does.
- (merge 94bc671 ja/directory-attrs later to maint).
+ exclude mechanism does. The initial implementation of this that
+ was merged to 'maint' and 1.8.1.2 was with a severe performance
+ degradations and needs to merge a fix-up topic.
+ (merge 9db9eec nd/fix-directory-attrs-off-by-one later to maint).
+
+ * "git am" did not parse datestamp correctly from Hg generated patch,
+ when it is run in a locale outside C (or en).
+ (merge 5185b97 dl/am-hg-locale later to maint).
* "git apply" misbehaved when fixing whitespace breakages by removing
excess trailing blank lines.
- (merge 5de7166 jc/apply-trailing-blank-removal later to maint).
* A tar archive created by "git archive" recorded a directory in a
way that made NetBSD's implementation of "tar" sometimes unhappy.
- (merge 22f0dcd rs/leave-base-name-in-name-field-of-tar later to maint).
* "git archive" did not record uncompressed size in the header when
streaming a zip archive, which confused some implementations of unzip.
- (merge 5ea2c84 rs/zip-with-uncompressed-size-in-the-header later to maint).
+
+ * "git clean" showed what it was going to do, but sometimes end up
+ finding that it was not allowed to do so, which resulted in a
+ confusing output (e.g. after saying that it will remove an
+ untracked directory, it found an embedded git repository there
+ which it is not allowed to remove). It now performs the actions
+ and then reports the outcome more faithfully.
+ (merge f538a91 zk/clean-report-failure later to maint).
* When "git clone --separate-git-dir=$over_there" is interrupted, it
failed to remove the real location of the $GIT_DIR it created.
This was most visible when interrupting a submodule update.
- (merge 9be1980 jl/interrupt-clone-remove-separate-git-dir later to maint).
* The way "git svn" asked for password using SSH_ASKPASS and
GIT_ASKPASS was not in line with the rest of the system.
- (merge e9263e4 ss/svn-prompt later to maint).
* The --graph code fell into infinite loop when asked to do what the
code did not expect.
- (merge 656197a mk/maint-graph-infinity-loop later to maint).
* http transport was wrong to ask for the username when the
authentication is done by certificate identity.
- (merge 75e9a40 rb/http-cert-cred-no-username-prompt later to maint).
* "git pack-refs" that ran in parallel to another process that
created new refs had a nasty race.
- (merge b3f1280 jk/repack-ref-racefix later to maint).
* After "git add -N" and then writing a tree object out of the
index, the cache-tree data structure got corrupted.
- (merge eec3e7e nd/invalidate-i-t-a-cache-tree later to maint).
+
+ * "git clone" used to allow --bare and --separate-git-dir=$there
+ options at the same time, which was nonsensical.
+ (merge 95b63f1 nd/clone-no-separate-git-dir-with-bare later to maint).
+
+ * "git rebase --preserve-merges" lost empty merges in recent versions
+ of Git.
+ (merge 9869778 ph/rebase-preserve-all-merges later to maint).
* "git merge --no-edit" computed who were involved in the work done
on the side branch, even though that information is to be discarded
without getting seen in the editor.
- (merge 9bcbb1c jc/maint-fmt-merge-msg-no-edit-lose-credit later to maint).
* "git merge" started calling prepare-commit-msg hook like "git
commit" does some time ago, but forgot to pay attention to the exit
status of the hook.
- (merge 3e4141d ap/merge-stop-at-prepare-commit-msg-failure later to maint).
* When users spell "cc:" in lowercase in the fake "header" in the
trailer part, "git send-email" failed to pick up the addresses from
there. As e-mail headers field names are case insensitive, this
script should follow suit and treat "cc:" and "Cc:" the same way.
- (merge 6310071 nz/send-email-headers-are-case-insensitive later to maint).
* Output from "git status --ignored" showed an unexpected interaction
with "--untracked".
- (merge a45fb69 ap/status-ignored-in-ignored-directory later to maint).
* "gitweb", when sorting by age to show repositories with new
activities first, used to sort repositories with absolutely
nothing in it early, which was not very useful.
- (merge 28dae18 md/gitweb-sort-by-age later to maint).
* "gitweb"'s code to sanitize control characters before passing it to
"highlight" filter lost known-to-be-safe control characters by
mistake.
- (merge 0e901d2 os/gitweb-highlight-uncaptured later to maint).
* When a line to be wrapped has a solid run of non space characters
whose length exactly is the wrap width, "git shortlog -w" failed
to add a newline after such a line.
- (merge e0db176 sp/shortlog-missing-lf later to maint).
* Command line completion leaked an unnecessary error message while
looking for possible matches with paths in <tree-ish>.
- (merge ca87dd6 ds/completion-silence-in-tree-path-probe later to maint).
* Command line completion for "tcsh" emitted an unwanted space
after completing a single directory name.
- (merge 92f1c04 mk/complete-tcsh later to maint).
+
+ * Command line completion code was inadvertently made incompatible with
+ older versions of bash by using a newer array notation.
+ (merge 50c5885 bc/fix-array-syntax-for-3.0-in-completion-bash later to maint).
* Some shells do not behave correctly when IFS is unset; work it
around by explicitly setting it to the default value.
- (merge 393050c jc/maint-fbsd-sh-ifs-workaround later to maint).
* Some scripted programs written in Python did not get updated when
PYTHON_PATH changed.
@@ -238,24 +288,21 @@ details).
* When autoconf is used, any build on a different commit always ran
"config.status --recheck" even when unnecessary.
- (merge 1226504 jn/less-reconfigure later to maint).
* We have been carrying a translated and long-unmaintained copy of an
old version of the tutorial; removed.
- (merge 0a85441 ta/remove-stale-translated-tut later to maint).
+
+ * t0050 had tests expecting failures from a bug that was fixed some
+ time ago.
+ (merge 336e2e2 tb/t0050-maint later to maint).
* t4014, t9502 and t0200 tests had various portability issues that
broke on OpenBSD.
- (merge 27f6342 jc/maint-test-portability later to maint).
* t9020 and t3600 tests had various portability issues.
- (merge 5a02966 jc/test-portability later to maint).
* t9200 runs "cvs init" on a directory that already exists, but a
platform can configure this fail for the current user (e.g. you
need to be in the cvsadmin group on NetBSD 6.0).
- (merge 8666df0 jc/test-cvs-no-init-in-existing-dir later to maint).
* t9020 and t9810 had a few non-portable shell script construct.
- (merge 2797914 tb/test-t9020-no-which later to maint).
- (merge 6f4e505 tb/test-t9810-no-sed-i later to maint).
diff --git a/Documentation/git-check-ignore.txt b/Documentation/git-check-ignore.txt
new file mode 100644
index 0000000000..854e4d0c42
--- /dev/null
+++ b/Documentation/git-check-ignore.txt
@@ -0,0 +1,89 @@
+git-check-ignore(1)
+===================
+
+NAME
+----
+git-check-ignore - Debug gitignore / exclude files
+
+
+SYNOPSIS
+--------
+[verse]
+'git check-ignore' [options] pathname...
+'git check-ignore' [options] --stdin < <list-of-paths>
+
+DESCRIPTION
+-----------
+
+For each pathname given via the command-line or from a file via
+`--stdin`, show the pattern from .gitignore (or other input files to
+the exclude mechanism) that decides if the pathname is excluded or
+included. Later patterns within a file take precedence over earlier
+ones.
+
+OPTIONS
+-------
+-q, --quiet::
+ Don't output anything, just set exit status. This is only
+ valid with a single pathname.
+
+-v, --verbose::
+ Also output details about the matching pattern (if any)
+ for each given pathname.
+
+--stdin::
+ Read file names from stdin instead of from the command-line.
+
+-z::
+ The output format is modified to be machine-parseable (see
+ below). If `--stdin` is also given, input paths are separated
+ with a NUL character instead of a linefeed character.
+
+OUTPUT
+------
+
+By default, any of the given pathnames which match an ignore pattern
+will be output, one per line. If no pattern matches a given path,
+nothing will be output for that path; this means that path will not be
+ignored.
+
+If `--verbose` is specified, the output is a series of lines of the form:
+
+<source> <COLON> <linenum> <COLON> <pattern> <HT> <pathname>
+
+<pathname> is the path of a file being queried, <pattern> is the
+matching pattern, <source> is the pattern's source file, and <linenum>
+is the line number of the pattern within that source. If the pattern
+contained a `!` prefix or `/` suffix, it will be preserved in the
+output. <source> will be an absolute path when referring to the file
+configured by `core.excludesfile`, or relative to the repository root
+when referring to `.git/info/exclude` or a per-directory exclude file.
+
+If `-z` is specified, the pathnames in the output are delimited by the
+null character; if `--verbose` is also specified then null characters
+are also used instead of colons and hard tabs:
+
+<source> <NULL> <linenum> <NULL> <pattern> <NULL> <pathname> <NULL>
+
+
+EXIT STATUS
+-----------
+
+0::
+ One or more of the provided paths is ignored.
+
+1::
+ None of the provided paths are ignored.
+
+128::
+ A fatal error was encountered.
+
+SEE ALSO
+--------
+linkgit:gitignore[5]