Merge branch 'mo/status-untracked'
authorJunio C Hamano <gitster@pobox.com>
Sun, 22 Jun 2008 21:32:27 +0000 (14:32 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 22 Jun 2008 21:32:27 +0000 (14:32 -0700)
* mo/status-untracked:
Add configuration option for default untracked files mode
Add argument 'no' commit/status option -u|--untracked-files
Add an optional <mode> argument to commit/status -u|--untracked-files option

Conflicts:

Documentation/git-commit.txt

132 files changed:
Documentation/.gitignore
Documentation/RelNotes-1.5.5.4.txt [new file with mode: 0644]
Documentation/RelNotes-1.5.6.txt
Documentation/SubmittingPatches
Documentation/blame-options.txt
Documentation/cat-texi.perl
Documentation/fetch-options.txt
Documentation/git-add.txt
Documentation/git-am.txt
Documentation/git-apply.txt
Documentation/git-archive.txt
Documentation/git-bisect.txt
Documentation/git-blame.txt
Documentation/git-branch.txt
Documentation/git-cat-file.txt
Documentation/git-checkout-index.txt
Documentation/git-checkout.txt
Documentation/git-cherry-pick.txt
Documentation/git-clean.txt
Documentation/git-commit.txt
Documentation/git-config.txt
Documentation/git-count-objects.txt
Documentation/git-cvsserver.txt
Documentation/git-daemon.txt
Documentation/git-describe.txt
Documentation/git-diff-files.txt
Documentation/git-fetch-pack.txt
Documentation/git-filter-branch.txt
Documentation/git-fmt-merge-msg.txt
Documentation/git-for-each-ref.txt
Documentation/git-format-patch.txt
Documentation/git-grep.txt
Documentation/git-help.txt
Documentation/git-http-push.txt
Documentation/git-init.txt
Documentation/git-instaweb.txt
Documentation/git-ls-files.txt
Documentation/git-ls-remote.txt
Documentation/git-mv.txt
Documentation/git-name-rev.txt
Documentation/git-pack-objects.txt
Documentation/git-pack-refs.txt
Documentation/git-peek-remote.txt
Documentation/git-prune.txt
Documentation/git-pull.txt
Documentation/git-push.txt
Documentation/git-quiltimport.txt
Documentation/git-read-tree.txt
Documentation/git-rebase.txt
Documentation/git-remote.txt
Documentation/git-repack.txt
Documentation/git-rev-parse.txt
Documentation/git-revert.txt
Documentation/git-rm.txt
Documentation/git-send-email.txt
Documentation/git-send-pack.txt
Documentation/git-shortlog.txt
Documentation/git-show-branch.txt
Documentation/git-show-ref.txt
Documentation/git-stripspace.txt
Documentation/git-submodule.txt
Documentation/git-svn.txt
Documentation/git-symbolic-ref.txt
Documentation/git-update-index.txt
Documentation/git-update-ref.txt
Documentation/git-update-server-info.txt
Documentation/git-upload-pack.txt
Documentation/git-web--browse.txt
Documentation/git.txt
Documentation/gitk.txt
Documentation/gittutorial.txt
Documentation/howto/setup-git-server-over-http.txt
Documentation/merge-options.txt
Documentation/pretty-formats.txt
Documentation/rev-list-options.txt
Documentation/technical/api-path-list.txt
Documentation/technical/api-run-command.txt
Documentation/user-manual.txt
GIT-VERSION-GEN
INSTALL
Makefile
attr.c
builtin-add.c
builtin-cat-file.c
builtin-commit.c
builtin-fast-export.c [changed mode: 0755->0644]
builtin-merge-recursive.c
builtin-reflog.c
builtin-remote.c
builtin-rerere.c
builtin-update-ref.c
cache.h
commit.c
configure.ac
contrib/completion/git-completion.bash
contrib/thunderbird-patch-inline/README [new file with mode: 0644]
contrib/thunderbird-patch-inline/appp.sh [new file with mode: 0755]
date.c
diff.c
git-am.sh
git-compat-util.h
git-cvsimport.perl
git-instaweb.sh
git-merge.sh
git-rebase--interactive.sh
git-send-email.perl
git-submodule.sh
git-svn.perl
git.c
git.spec.in
gitk-git/gitk
gitweb/README
gitweb/gitweb.perl
http-push.c
http.c
path.c
progress.c
remote.c
sha1_file.c
t/.gitattributes
t/README
t/t0003-attributes.sh
t/t1006-cat-file.sh
t/t1301-shared-repo.sh
t/t1400-update-ref.sh
t/t4126-apply-empty.sh
t/t5505-remote.sh
t/t5510-fetch.sh
t/t6033-merge-crlf.sh [new file with mode: 0755]
t/t7502-commit.sh
t/t9122-git-svn-author.sh
t/test-lib.sh
index 2f938f471a647f387355290695d54433def16e46..d8edd904065fbc4bd06365ce378f57d4cd8f9f0d 100644 (file)
@@ -2,7 +2,9 @@
 *.html
 *.[1-8]
 *.made
+*.texi
 git.info
+gitman.info
 howto-index.txt
 doc.dep
 cmds-*.txt
diff --git a/Documentation/RelNotes-1.5.5.4.txt b/Documentation/RelNotes-1.5.5.4.txt
new file mode 100644 (file)
index 0000000..2d0279e
--- /dev/null
@@ -0,0 +1,7 @@
+GIT v1.5.5.4 Release Notes
+==========================
+
+Fixes since v1.5.5.4
+--------------------
+
+ * "git name-rev --all" used to segfault.
index 1855cf39231a7b8139b5a1c9fb7d3a2543abdf28..e143d8d61be1bb2fac024b5d5f270b33f4f898d4 100644 (file)
@@ -18,6 +18,16 @@ Updates since v1.5.5
 * "git init" now autodetects the case sensitivity of the filesystem and
   sets core.ignorecase accordingly.
 
+* cpio is no longer used; neither "curl" binary (libcurl is still used).
+
+(documentation)
+
+* Many freestanding documentation pages have been converted and made
+  available to "git help" (aka "man git<something>") as section 7 of
+  the manual pages. This means bookmarks to some HTML documentation
+  files may need to be updated (eg "tutorial.html" became
+  "gittutorial.html").
+
 (performance)
 
 * "git clone" was rewritten in C.  This will hopefully help cloning a
@@ -64,7 +74,7 @@ Updates since v1.5.5
 
 * "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 gc --auto" honors a new pre-auto-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
@@ -102,9 +112,4 @@ 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
+And there are too numerous small fixes to otherwise note here ;-)
index 0e155c936c25255706bc6d47651c2b336c628417..b1164753e13dbe015d073346bc0b7c992532efe8 100644 (file)
@@ -419,6 +419,11 @@ settings but I haven't tried, yet.
        mail.identity.default.compose_html      => false
        mail.identity.id?.compose_html          => false
 
+(Lukas Sandström)
+
+There is a script in contrib/thunderbird-patch-inline which can help
+you include patches with Thunderbird in an easy way. To use it, do the
+steps above and then use the script as the external editor.
 
 Gnus
 ----
index c11bb7d36c39899d782f8c2d3f87b5a59178840a..5428111d732cb38dbb257ddfa860ebd04088b4e9 100644 (file)
@@ -41,7 +41,8 @@ of lines before or after the line given by <start>.
 -S <revs-file>::
        Use revs from revs-file instead of calling linkgit:git-rev-list[1].
 
--p, --porcelain::
+-p::
+--porcelain::
        Show in a format designed for machine consumption.
 
 --incremental::
@@ -83,5 +84,6 @@ alphanumeric characters that git must detect as moving
 between files for it to associate those lines with the parent
 commit.
 
--h, --help::
+-h::
+--help::
        Show help message.
index e3d8e9faa8c4b64c757080b89f304f78d30fbc17..dbc133cd3c1f19dd507014477e68b8ada78eab5e 100755 (executable)
@@ -11,7 +11,7 @@
        if (s/^\@top (.*)/\@node $1,,,Top/) {
                push @menu, $1;
        }
-       s/\(\@pxref{\[URLS\]}\)//;
+       s/\(\@pxref{\[(URLS|REMOTES)\]}\)//;
        print TMP;
 }
 close TMP;
index b6759114804e89d6f92e48b8dfe4d93b1f8202d0..85c87180db59906f5401eafbe6460f49a60ee9dc 100644 (file)
@@ -1,22 +1,26 @@
--q, \--quiet::
+-q::
+--quiet::
        Pass --quiet to git-fetch-pack and silence any other internally
        used programs.
 
--v, \--verbose::
+-v::
+--verbose::
        Be verbose.
 
--a, \--append::
+-a::
+--append::
        Append ref names and object names of fetched refs to the
        existing contents of `.git/FETCH_HEAD`.  Without this
        option old data in `.git/FETCH_HEAD` will be overwritten.
 
-\--upload-pack <upload-pack>::
+--upload-pack <upload-pack>::
        When given, and the repository to fetch from is handled
        by 'git-fetch-pack', '--exec=<upload-pack>' is passed to
        the command to specify non-default path for the command
        run on the other end.
 
--f, \--force::
+-f::
+--force::
        When `git-fetch` is used with `<rbranch>:<lbranch>`
        refspec, it refuses to update the local branch
        `<lbranch>` unless the remote branch `<rbranch>` it
        overrides that check.
 
 ifdef::git-pull[]
-\--no-tags::
+--no-tags::
 endif::git-pull[]
 ifndef::git-pull[]
--n, \--no-tags::
+-n::
+--no-tags::
 endif::git-pull[]
        By default, tags that point at objects that are downloaded
        from the remote repository are fetched and stored locally.
        This option disables this automatic tag following.
 
--t, \--tags::
+-t::
+--tags::
        Most of the tags are fetched automatically as branch
        heads are downloaded, but tags that do not point at
        objects reachable from the branch heads that are being
@@ -41,10 +47,12 @@ endif::git-pull[]
        flag lets all tags and their associated objects be
        downloaded.
 
--k, \--keep::
+-k::
+--keep::
        Keep downloaded pack.
 
--u, \--update-head-ok::
+-u::
+--update-head-ok::
        By default `git-fetch` refuses to update the head which
        corresponds to the current branch.  This flag disables the
        check.  This is purely for the internal use for `git-pull`
@@ -52,7 +60,7 @@ endif::git-pull[]
        implementing your own Porcelain you are not supposed to
        use it.
 
-\--depth=<depth>::
+--depth=<depth>::
        Deepen the history of a 'shallow' repository created by
        `git clone` with `--depth=<depth>` option (see linkgit:git-clone[1])
        by the specified number of commits.
index 88165da38fb7616ecfc7413917c8906b5bbdfeb1..b8e3fa67598037bc5d0de30818b977048bbada72 100644 (file)
@@ -8,8 +8,9 @@ git-add - Add file contents to the index
 SYNOPSIS
 --------
 [verse]
-'git-add' [-n] [-v] [-f] [--interactive | -i] [--patch | -p] [-u] [--refresh]
-         [--ignore-errors] [--] <filepattern>...
+'git-add' [-n] [-v] [--force | -f] [--interactive | -i] [--patch | -p]
+         [--update | -u] [--refresh] [--ignore-errors] [--]
+         <filepattern>...
 
 DESCRIPTION
 -----------
@@ -50,27 +51,33 @@ OPTIONS
        and `dir/file2`) can be given to add all files in the
        directory, recursively.
 
--n, \--dry-run::
+-n::
+--dry-run::
         Don't actually add the file(s), just show if they exist.
 
--v, \--verbose::
+-v::
+--verbose::
         Be verbose.
 
 -f::
+--force::
        Allow adding otherwise ignored files.
 
--i, \--interactive::
+-i::
+--interactive::
        Add modified contents in the working tree interactively to
        the index. Optional path arguments may be supplied to limit
        operation to a subset of the working tree. See ``Interactive
        mode'' for details.
 
--p, \--patch::
+-p::
+--patch::
        Similar to Interactive mode but the initial command loop is
        bypassed and the 'patch' subcommand is invoked using each of
        the specified filepatterns before exiting.
 
 -u::
+--update::
        Update only files that git already knows about, staging modified
        content for commit and marking deleted files for removal. This
        is similar
@@ -79,11 +86,11 @@ OPTIONS
        command line. If no paths are specified, all tracked files in the
        current directory and its subdirectories are updated.
 
-\--refresh::
+--refresh::
        Don't add the file(s), but only refresh their stat()
        information in the index.
 
-\--ignore-errors::
+--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.
index 7f6f5b472a8800e4ad04b6a93a7a92b40a415281..46544a07694a90db908729b6badf92370f37226b 100644 (file)
@@ -28,14 +28,17 @@ OPTIONS
        supply this argument, reads from the standard input. If you supply
        directories, they'll be treated as Maildirs.
 
--s, --signoff::
+-s::
+--signoff::
        Add `Signed-off-by:` line to the commit message, using
        the committer identity of yourself.
 
--k, --keep::
+-k::
+--keep::
        Pass `-k` flag to `git-mailinfo` (see linkgit:git-mailinfo[1]).
 
--u, --utf8::
+-u::
+--utf8::
        Pass `-u` flag to `git-mailinfo` (see linkgit:git-mailinfo[1]).
        The proposed commit log message taken from the e-mail
        is re-coded into UTF-8 encoding (configuration variable
@@ -49,13 +52,15 @@ default.   You could use `--no-utf8` to override this.
        Pass `-n` flag to `git-mailinfo` (see
        linkgit:git-mailinfo[1]).
 
--3, --3way::
+-3::
+--3way::
        When the patch does not apply cleanly, fall back on
        3-way merge, if the patch records the identity of blobs
        it is supposed to apply to, and we have those blobs
        available locally.
 
--b, --binary::
+-b::
+--binary::
        Pass `--allow-binary-replacement` flag to `git-apply`
        (see linkgit:git-apply[1]).
 
@@ -64,19 +69,22 @@ default.   You could use `--no-utf8` to override this.
        program that applies
        the patch.
 
--C<n>, -p<n>::
+-C<n>::
+-p<n>::
        These flags are passed to the `git-apply` (see linkgit:git-apply[1])
        program that applies
        the patch.
 
--i, --interactive::
+-i::
+--interactive::
        Run interactively.
 
 --skip::
        Skip the current patch.  This is only meaningful when
        restarting an aborted patch.
 
--r, --resolved::
+-r::
+--resolved::
        After a patch failure (e.g. attempting to apply
        conflicting patch), the user has applied it by hand and
        the index file stores the result of the application.
index 76277bd178b17c5b1630ea2bae3cb727ca194bc5..c8347637da55e32ec4c637280d7027dc8883c264 100644 (file)
@@ -73,7 +73,8 @@ OPTIONS
 When a pure mode change is encountered (which has no index information),
 the information is read from the current index instead.
 
--R, --reverse::
+-R::
+--reverse::
        Apply the patch in reverse.
 
 --reject::
@@ -124,7 +125,8 @@ discouraged.
        the result with this option, which would apply the
        deletion part but not addition part.
 
---allow-binary-replacement, --binary::
+--allow-binary-replacement::
+--binary::
        Historically we did not allow binary patch applied
        without an explicit permission from the user, and this
        flag was the way to do so.  Currently we always allow binary
@@ -169,7 +171,8 @@ behavior:
        correctly. This option adds support for applying such patches by
        working around this bug.
 
--v, --verbose::
+-v::
+--verbose::
        Report progress to stderr. By default, only a message about the
        current patch being applied will be printed. This option will cause
        additional information to be reported.
index a3e36dbb0d16541baf2fe51dd053803ff9aa8cbf..9b5f3ae5ed8cf6b79545f09d68797490c69f6596 100644 (file)
@@ -36,10 +36,12 @@ OPTIONS
        Format of the resulting archive: 'tar' or 'zip'.  The default
        is 'tar'.
 
---list, -l::
+-l::
+--list::
        Show all available formats.
 
---verbose, -v::
+-v::
+--verbose::
        Report progress to stderr.
 
 --prefix=<prefix>/::
index 37c7acbe9f88c7feae0f7f3936ae823b3a7a78a0..3ca0d330ad06e76d73657189c5f90e0994ba4505 100644 (file)
@@ -85,10 +85,9 @@ Oh, and then after you want to reset to the original head, do a
 $ git bisect reset
 ------------------------------------------------
 
-to get back to the original branch, instead of being in one of the
-bisection branches ("git bisect start" will do that for you too,
-actually: it will reset the bisection state, and before it does that
-it checks that you're not using some old bisection branch).
+to get back to the original branch, instead of being on the bisection
+commit ("git bisect start" will do that for you too, actually: it will
+reset the bisection state).
 
 Bisect visualize
 ~~~~~~~~~~~~~~~~
index 7900f33d4ba77c5ddf5e53869045e624105920cb..8f4fb46685624d07f5940eb973a7fd03aefb5aa0 100644 (file)
@@ -52,12 +52,14 @@ include::blame-options.txt[]
        a certain threshold for git-blame to consider those lines
        of code to have been moved.
 
--f, --show-name::
+-f::
+--show-name::
        Show filename in the original commit.  By default
        filename is shown if there is any line that came from a
        file with different name, due to rename detection.
 
--n, --show-number::
+-n::
+--show-number::
        Show line number in the original commit (Default: off).
 
 -s::
index a70fa76f3128f61bf784ad84d1f43fa4fcff6572..0fd58083eb2afdb7fed7ebf01bab3b5e1cae1421 100644 (file)
@@ -95,7 +95,8 @@ OPTIONS
 -a::
        List both remote-tracking branches and local branches.
 
--v, --verbose::
+-v::
+--verbose::
        Show sha1 and commit subject line for each head.
 
 --abbrev=<length>::
index 3f77dbd107e8dba3eadcb7698d91627f28f7fe1e..f58013ca605631437e5a4806cdd07dba18d8a982 100644 (file)
@@ -8,6 +8,7 @@ git-cat-file - Provide content or type/size information for repository objects
 
 SYNOPSIS
 --------
+[verse]
 'git-cat-file' [-t | -s | -e | -p | <type>] <object>
 'git-cat-file' [--batch | --batch-check] < <list-of-objects>
 
index a8cad9c21f53c09ffccf875b64c043e4dfcf8224..676203b2ebcc1261dc5ad8d0ab8caa0bc730112c 100644 (file)
@@ -22,21 +22,26 @@ Will copy all files listed from the index to the working directory
 
 OPTIONS
 -------
--u|--index::
+-u::
+--index::
        update stat information for the checked out entries in
        the index file.
 
--q|--quiet::
+-q::
+--quiet::
        be quiet if files exist or are not in the index
 
--f|--force::
+-f::
+--force::
        forces overwrite of existing files
 
--a|--all::
+-a::
+--all::
        checks out all files in the index.  Cannot be used
        together with explicit filenames.
 
--n|--no-create::
+-n::
+--no-create::
        Don't checkout new files, only refresh files already checked
        out.
 
index a5bf9d6f897e6fd7325059689250518e6fe10eab..3ad9760a4d6949837c1e186402c9810b59a0138d 100644 (file)
@@ -47,7 +47,8 @@ OPTIONS
        by linkgit:git-check-ref-format[1].  Some of these checks
        may restrict the characters allowed in a branch name.
 
--t, --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
index 3762272b884604e6c15458c30a1b5e475ed39565..5ac9cfb0ef2e2eb26ebe5cce6a5c7ed54d4e39ec 100644 (file)
@@ -22,7 +22,8 @@ OPTIONS
        For a more complete list of ways to spell commits, see
        "SPECIFYING REVISIONS" section in linkgit:git-rev-parse[1].
 
--e|--edit::
+-e::
+--edit::
        With this option, `git-cherry-pick` will let you edit the commit
        message prior to committing.
 
@@ -44,14 +45,16 @@ OPTIONS
        described above, and `-r` was to disable it.  Now the
        default is not to do `-x` so this option is a no-op.
 
--m parent-number|--mainline parent-number::
+-m parent-number::
+--mainline parent-number::
        Usually you cannot cherry-pick a merge because you do not know which
        side of the merge should be considered the mainline.  This
        option specifies the parent number (starting from 1) of
        the mainline and allows cherry-pick to replay the change
        relative to the specified parent.
 
--n|--no-commit::
+-n::
+--no-commit::
        Usually the command automatically creates a commit with
        a commit log message stating which commit was
        cherry-picked.  This flag applies the change necessary
@@ -64,7 +67,8 @@ OPTIONS
 This is useful when cherry-picking more than one commits'
 effect to your working tree in a row.
 
--s|--signoff::
+-s::
+--signoff::
        Add Signed-off-by line at the end of the commit message.
 
 
index deebf3b315cd7e119fd70c500400181137843652..37a82ee4b8ed2dc939e56140821a42d452e1b4b5 100644 (file)
@@ -30,9 +30,11 @@ OPTIONS
        git-clean will refuse to run unless given -f or -n.
 
 -n::
+--dry-run::
        Don't actually remove anything, just show what would be done.
 
 -q::
+--quiet::
        Be quiet, only report errors, but not the files that are
        successfully removed.
 
index 2e5ea22a40fd64f3b949099006b54ef493a4993b..d0fe192fb315e62d0daa2d468bd5709601abbe5d 100644 (file)
@@ -8,9 +8,9 @@ git-commit - Record changes to the repository
 SYNOPSIS
 --------
 [verse]
-'git-commit' [-a | --interactive] [-s] [-v] [-u[<mode>]]
-          [(-c | -C) <commit> | -F <file> | -m <msg> | --amend]
-          [--allow-empty] [--no-verify] [-e] [--author <author>]
+'git-commit' [-a | --interactive] [-s] [-v] [-u<mode>] [--amend]
+          [(-c | -C) <commit>] [-F <file> | -m <msg>]
+          [--allow-empty] [--no-verify] [-e] [--author=<author>]
           [--cleanup=<mode>] [--] [[-i | -o ]<file>...]
 
 DESCRIPTION
@@ -52,39 +52,49 @@ that, you can recover from it with linkgit:git-reset[1].
 
 OPTIONS
 -------
--a|--all::
+-a::
+--all::
        Tell the command to automatically stage files that have
        been modified and deleted, but new files you have not
        told git about are not affected.
 
--c or -C <commit>::
-       Take existing commit object, and reuse the log message
+-C <commit>::
+--reuse-message=<commit>::
+       Take an existing commit object, and reuse the log message
        and the authorship information (including the timestamp)
-       when creating the commit.  With '-C', the editor is not
-       invoked; with '-c' the user can further edit the commit
-       message.
+       when creating the commit.
+
+-c <commit>::
+--reedit-message=<commit>::
+       Like '-C', but with '-c' the editor is invoked, so that
+       the user can further edit the commit message.
 
 -F <file>::
+--file=<file>::
        Take the commit message from the given file.  Use '-' to
        read the message from the standard input.
 
---author <author>::
+--author=<author>::
        Override the author name used in the commit.  Use
        `A U Thor <author@example.com>` format.
 
--m <msg>|--message=<msg>::
+-m <msg>::
+--message=<msg>::
        Use the given <msg> as the commit message.
 
--t <file>|--template=<file>::
+-t <file>::
+--template=<file>::
        Use the contents of the given file as the initial version
        of the commit message. The editor is invoked and you can
        make subsequent changes. If a message is specified using
        the `-m` or `-F` options, this option has no effect. This
        overrides the `commit.template` configuration variable.
 
--s|--signoff::
+-s::
+--signoff::
        Add Signed-off-by line at the end of the commit message.
 
+-n::
 --no-verify::
        This option bypasses the pre-commit and commit-msg hooks.
        See also linkgit:githooks[5][hooks].
@@ -105,14 +115,14 @@ OPTIONS
        'whitespace' removes just leading/trailing whitespace lines
        and 'strip' removes both whitespace and commentary.
 
--e|--edit::
+-e::
+--edit::
        The message taken from file with `-F`, command line with
        `-m`, and from file with `-C` are usually used as the
        commit log message unmodified.  This option lets you
        further edit the message taken from these sources.
 
 --amend::
-
        Used to amend the tip of the current branch. Prepare the tree
        object you would want to replace the latest commit as usual
        (this includes the usual -i/-o and explicit paths), and the
@@ -133,13 +143,15 @@ It is a rough equivalent for:
 but can be used to amend a merge commit.
 --
 
--i|--include::
+-i::
+--include::
        Before making a commit out of staged contents so far,
        stage the contents of paths given on the command line
        as well.  This is usually not what you want unless you
        are concluding a conflicted merge.
 
--o|--only::
+-o::
+--only::
        Make a commit only from the paths specified on the
        command line, disregarding any contents that have been
        staged so far. This is the default mode of operation of
@@ -150,7 +162,8 @@ but can be used to amend a merge commit.
        the last commit without committing changes that have
        already been staged.
 
--u[<mode>]|--untracked-files[=<mode>]::
+-u[<mode>]::
+--untracked-files[=<mode>]::
        Show untracked files (Default: 'all').
 +
 The mode parameter is optional, and is used to specify
@@ -166,13 +179,15 @@ See linkgit:git-config[1] for configuration variable
 used to change the default for when the option is not
 specified.
 
--v|--verbose::
+-v::
+--verbose::
        Show unified diff between the HEAD commit and what
        would be committed at the bottom of the commit message
        template.  Note that this diff output doesn't have its
        lines prefixed with '#'.
 
--q|--quiet::
+-q::
+--quiet::
        Suppress commit summary message.
 
 \--::
index 84b754f8d0d4213ece2a9fbb4440bb765994723e..c90421ee7f3b6a3fe1f08c4868b5652d4d7db569 100644 (file)
@@ -101,7 +101,8 @@ rather than from all available files.
 +
 See also <<FILES>>.
 
--f config-file, --file config-file::
+-f config-file::
+--file config-file::
        Use the given config file instead of the one specified by GIT_CONFIG.
 
 --remove-section::
@@ -116,7 +117,8 @@ See also <<FILES>>.
 --unset-all::
        Remove all lines matching the key from config file.
 
--l, --list::
+-l::
+--list::
        List all variables set in config file.
 
 --bool::
@@ -128,7 +130,8 @@ See also <<FILES>>.
        in the config file will cause the value to be multiplied
        by 1024, 1048576, or 1073741824 prior to output.
 
--z, --null::
+-z::
+--null::
        For all options that output values and/or keys, always
        end values with the null character (instead of a
        newline). Use newline instead as a delimiter between
index e1219b3167a791062ba56c057a9a2e92c840b649..1ba85a259a2d8896b5634f3496542b5561dbf2de 100644 (file)
@@ -18,6 +18,7 @@ them, to help you decide when it is a good time to repack.
 OPTIONS
 -------
 -v::
+--verbose::
        In addition to the number of loose objects and disk
        space consumed, it reports the number of in-pack
        objects, number of packs, and number of objects that can be
index b7721131ddff1d409cb70e842767e03cf0df7a2a..3310ae25ff75c302e6b9088a0807aee340ad69c7 100644 (file)
@@ -41,10 +41,13 @@ Don't allow recursing into subdirectories
 Don't check for `gitcvs.enabled` in config. You also have to specify a list
 of allowed directories (see below) if you want to use this option.
 
---version, -V::
+-V::
+--version::
 Print version information and exit
 
---help, -h, -H::
+-h::
+-H::
+--help::
 Print usage information and exit
 
 <directory>::
index 3fb71d683e4f63cd7971a95d11125d61d812bbf2..344f24ea59a7f85473da4e865219bcdc0fb9db33 100644 (file)
@@ -103,7 +103,8 @@ OPTIONS
        Log to syslog instead of stderr. Note that this option does not imply
        --verbose, thus by default only error conditions will be logged.
 
---user-path, --user-path=path::
+--user-path::
+--user-path=path::
        Allow ~user notation to be used in requests.  When
        specified with no parameter, requests to
        git://host/~alice/foo is taken as a request to access
@@ -127,7 +128,8 @@ OPTIONS
        Save the process id in 'file'.  Ignored when the daemon
        is run under `--inetd`.
 
---user=user, --group=group::
+--user=user::
+--group=group::
        Change daemon's uid and gid before entering the service loop.
        When only `--user` is given without `--group`, the
        primary group ID for the user is used.  The values of
@@ -138,14 +140,16 @@ Giving these options is an error when used with `--inetd`; use
 the facility of inet daemon to achieve the same before spawning
 `git-daemon` if needed.
 
---enable=service, --disable=service::
+--enable=service::
+--disable=service::
        Enable/disable the service site-wide per default.  Note
        that a service disabled site-wide can still be enabled
        per repository if it is marked overridable and the
        repository enables the service with an configuration
        item.
 
---allow-override=service, --forbid-override=service::
+--allow-override=service::
+--forbid-override=service::
        Allow/forbid overriding the site-wide default with per
        repository configuration.  By default, all the services
        are overridable.
index 3f0b7b2f47567183ab4db3f9c71c4a27ee1b45ae..9f6f4831864a3112119bc7d7fec22aa7a72225e5 100644 (file)
@@ -70,6 +70,9 @@ OPTIONS
        Only consider tags matching the given pattern (can be used to avoid
        leaking private tags made from the repository).
 
+--always::
+       Show uniquely abbreviated commit object as fallback.
+
 EXAMPLES
 --------
 
index ed9bd75b7417a3024d20fda01b964fb6bbeaaa50..8a64869d2705071afe3d1a122b6b85a086413a0a 100644 (file)
@@ -30,7 +30,8 @@ The default is to diff against our branch (-2) and the
 cleanly resolved paths.  The option -0 can be given to
 omit diff output for unmerged entries and just show "Unmerged".
 
--c,--cc::
+-c::
+--cc::
        This compares stage 2 (our branch), stage 3 (their
        branch) and the working tree file and outputs a combined
        diff, similar to the way 'diff-tree' shows a merge
index 6ee3dccc1fa1982dd75711b56ff278926e604499..282fcaf17fed50ac51129dde8fcf105c1b9c11d9 100644 (file)
@@ -28,30 +28,32 @@ have a common ancestor commit.
 
 OPTIONS
 -------
-\--all::
+--all::
        Fetch all remote refs.
 
-\--quiet, \-q::
+-q::
+--quiet::
        Pass '-q' flag to 'git-unpack-objects'; this makes the
        cloning process less verbose.
 
-\--keep, \-k::
+-k::
+--keep::
        Do not invoke 'git-unpack-objects' on received data, but
        create a single packfile out of it instead, and store it
        in the object database. If provided twice then the pack is
        locked against repacking.
 
-\--thin::
+--thin::
        Spend extra cycles to minimize the number of objects to be sent.
        Use it on slower connection.
 
-\--include-tag::
+--include-tag::
        If the remote side supports it, annotated tags objects will
        be downloaded on the same connection as the other objects if
        the object the tag references is downloaded.  The caller must
        otherwise determine the tags this option made available.
 
-\--upload-pack=<git-upload-pack>::
+--upload-pack=<git-upload-pack>::
        Use this to specify the path to 'git-upload-pack' on the
        remote side, if is not found on your $PATH.
        Installations of sshd ignores the user's environment
@@ -63,16 +65,16 @@ OPTIONS
        shells by having a lean .bashrc file (they set most of
        the things up in .bash_profile).
 
-\--exec=<git-upload-pack>::
+--exec=<git-upload-pack>::
        Same as \--upload-pack=<git-upload-pack>.
 
-\--depth=<n>::
+--depth=<n>::
        Limit fetching to ancestor-chains not longer than n.
 
-\--no-progress::
+--no-progress::
        Do not show the progress.
 
-\-v::
+-v::
        Run verbosely.
 
 <host>::
index 44060687abd2cb6518471528a1360add3fe9417e..ea77f1fce505fbb9c1691f7e75aa014e7a1d5be5 100644 (file)
@@ -161,7 +161,8 @@ to other tags will be rewritten to point to the underlying commit.
        does this in the '.git-rewrite/' directory but you can override
        that choice by this parameter.
 
--f|--force::
+-f::
+--force::
        `git filter-branch` refuses to start with an existing temporary
        directory or when there are already refs starting with
        'refs/original/', unless forced.
index 328cc542dcf29fe08289004ad1c7f2af9de8645d..2a7cfb980b7f0b6fa2bd741b3601467f07025691 100644 (file)
@@ -33,11 +33,13 @@ OPTIONS
        Do not list one-line descriptions from the actual commits being
        merged.
 
---summary,--no-summary::
+--summary::
+--no-summary::
        Synonyms to --log and --no-log; these are deprecated and will be
        removed in the future.
 
---file <file>, -F <file>::
+-F <file>::
+--file <file>::
        Take the list of merged objects from <file> instead of
        stdin.
 
index 6325ff9a68b336efd818a9593cb47dd3f189b6ff..b347bfbb14784a4292124a4575086411a4697527 100644 (file)
@@ -53,7 +53,10 @@ OPTIONS
        literally, in the latter case matching completely or from the
        beginning up to a slash.
 
---shell, --perl, --python, --tcl::
+--shell::
+--perl::
+--python::
+--tcl::
        If given, strings that substitute `%(fieldname)`
        placeholders are quoted as string literals suitable for
        the specified host language.  This is meant to produce
index cdee6420606f808b9a2578584e503ba25a387c7e..4dafa39a9211d9d35498f4c88418713b1aa33284 100644 (file)
@@ -74,14 +74,17 @@ include::diff-options.txt[]
 -<n>::
        Limits the number of patches to prepare.
 
--o|--output-directory <dir>::
+-o <dir>::
+--output-directory <dir>::
        Use <dir> to store the resulting files, instead of the
        current working directory.
 
--n|--numbered::
+-n::
+--numbered::
        Name output in '[PATCH n/m]' format.
 
--N|--no-numbered::
+-N::
+--no-numbered::
        Name output in '[PATCH]' format.
 
 --start-number <n>::
@@ -92,11 +95,13 @@ include::diff-options.txt[]
        without the default first line of the commit appended.
        Mutually exclusive with the --stdout option.
 
--k|--keep-subject::
+-k::
+--keep-subject::
        Do not strip/add '[PATCH]' from the first line of the
        commit log message.
 
--s|--signoff::
+-s::
+--signoff::
        Add `Signed-off-by:` line to the commit message, using
        the committer identity of yourself.
 
index 13b9cf770c834371efc2053d44d1f472b54ab95f..1b646b73f069e72bc6faa3a058d61ace77c9934c 100644 (file)
@@ -33,25 +33,30 @@ OPTIONS
        Instead of searching in the working tree files, check
        the blobs registered in the index file.
 
--a | --text::
+-a::
+--text::
        Process binary files as if they were text.
 
--i | --ignore-case::
+-i::
+--ignore-case::
        Ignore case differences between the patterns and the
        files.
 
 -I::
        Don't match the pattern in binary files.
 
--w | --word-regexp::
+-w::
+--word-regexp::
        Match the pattern only at word boundary (either begin at the
        beginning of a line, or preceded by a non-word character; end at
        the end of a line or followed by a non-word character).
 
--v | --invert-match::
+-v::
+--invert-match::
        Select non-matching lines.
 
--h | -H::
+-h::
+-H::
        By default, the command shows the filename for each
        match.  `-h` option is used to suppress this output.
        `-H` is there for completeness and does not do anything
@@ -64,24 +69,33 @@ OPTIONS
        option forces paths to be output relative to the project
        top directory.
 
--E | --extended-regexp | -G | --basic-regexp::
+-E::
+--extended-regexp::
+-G::
+--basic-regexp::
        Use POSIX extended/basic regexp for patterns.  Default
        is to use basic regexp.
 
--F | --fixed-strings::
+-F::
+--fixed-strings::
        Use fixed strings for patterns (don't interpret pattern
        as a regex).
 
 -n::
        Prefix the line number to matching lines.
 
--l | --files-with-matches | --name-only | -L | --files-without-match::
+-l::
+--files-with-matches::
+--name-only::
+-L::
+--files-without-match::
        Instead of showing every matched line, show only the
        names of files that contain (or do not contain) matches.
        For better compatibility with git-diff, --name-only is a
        synonym for --files-with-matches.
 
--c | --count::
+-c::
+--count::
        Instead of showing every matched line, show the number of
        lines that match.
 
@@ -103,7 +117,10 @@ OPTIONS
        scripts passing user input to grep.  Multiple patterns are
        combined by 'or'.
 
---and | --or | --not | ( | )::
+--and::
+--or::
+--not::
+( ... )::
        Specify how multiple patterns are combined using Boolean
        expressions.  `--or` is the default operator.  `--and` has
        higher precedence than `--or`.  `-e` has to be used for all
index 8994c6d4344344293453684a1e811b56819d3c81..faecd6bb907b9622aa0a6a3a9fab2665c867354e 100644 (file)
@@ -28,15 +28,18 @@ former is internally converted into the latter.
 
 OPTIONS
 -------
--a|--all::
+-a::
+--all::
        Prints all the available commands on the standard output. This
        option supersedes any other option.
 
--i|--info::
+-i::
+--info::
        Display manual page for the command in the 'info' format. The
        'info' program will be used for that purpose.
 
--m|--man::
+-m::
+--man::
        Display manual page for the command in the 'man' format. This
        option may be used to override a value set in the
        'help.format' configuration variable.
@@ -45,7 +48,8 @@ By default the 'man' program will be used to display the manual page,
 but the 'man.viewer' configuration variable may be used to choose
 other display programs (see below).
 
--w|--web::
+-w::
+--web::
        Display manual page for the command in the 'web' (HTML)
        format. A web browser will be used for that purpose.
 +
index 143291d126f08457b0a8fcb5f2bf6c107c258636..d69b20549bf956a5c7c3f64f5315a17ec71af038 100644 (file)
@@ -15,8 +15,8 @@ DESCRIPTION
 Sends missing objects to remote repository, and updates the
 remote branch.
 
-*NOTE*: This command is temporarily disabled if your cURL
-library is older than 7.16, as the combination has been reported
+*NOTE*: This command is temporarily disabled if your libcurl
+is older than 7.16, as the combination has been reported
 not to work and sometimes corrupts repository.
 
 OPTIONS
@@ -40,7 +40,8 @@ OPTIONS
        Report the list of objects being walked locally and the
        list of objects successfully sent to the remote repository.
 
--d, -D::
+-d::
+-D::
        Remove <ref> from remote repository.  The specified branch
        cannot be the remote HEAD.  If -d is specified the following
        other conditions must also be met:
index c48b615da24c7ec43d1ec54ad5a5007532352a02..792643c80916f4b72704f046c0de89d8d55fa17c 100644 (file)
@@ -16,7 +16,8 @@ OPTIONS
 
 --
 
--q, \--quiet::
+-q::
+--quiet::
 
 Only print error and warning messages, all other output will be suppressed.
 
index 11e6a817792d6cf7e194bb10573c6288daa2af66..7da5b8d9a9af04a5bf2188523587b086301bfd67 100644 (file)
@@ -20,24 +20,29 @@ repository.
 OPTIONS
 -------
 
--l|--local::
+-l::
+--local::
        Only bind the web server to the local IP (127.0.0.1).
 
--d|--httpd::
+-d::
+--httpd::
        The HTTP daemon command-line that will be executed.
        Command-line options may be specified here, and the
        configuration file will be added at the end of the command-line.
        Currently lighttpd, apache2 and webrick are supported.
        (Default: lighttpd)
 
--m|--module-path::
+-m::
+--module-path::
        The module path (only needed if httpd is Apache).
        (Default: /usr/lib/apache2/modules)
 
--p|--port::
+-p::
+--port::
        The port number to bind the httpd to.  (Default: 1234)
 
--b|--browser::
+-b::
+--browser::
        The web browser that should be used to view the gitweb
        page. This will be passed to the 'git-web--browse' helper
        script along with the URL of the gitweb instance. See
index 1b0b212245dddf7eae3fe20d6b5a2ac27d259ce8..560594e25fdb4ef73aaaba55576c41d704f9ef8b 100644 (file)
@@ -30,23 +30,29 @@ shown:
 
 OPTIONS
 -------
--c|--cached::
+-c::
+--cached::
        Show cached files in the output (default)
 
--d|--deleted::
+-d::
+--deleted::
        Show deleted files in the output
 
--m|--modified::
+-m::
+--modified::
        Show modified files in the output
 
--o|--others::
+-o::
+--others::
        Show other files in the output
 
--i|--ignored::
+-i::
+--ignored::
        Show ignored files in the output.
        Note that this also reverses any exclude list present.
 
--s|--stage::
+-s::
+--stage::
        Show stage files in the output
 
 --directory::
@@ -56,10 +62,12 @@ OPTIONS
 --no-empty-directory::
        Do not list empty directories. Has no effect without --directory.
 
--u|--unmerged::
+-u::
+--unmerged::
        Show unmerged files in the output (forces --stage)
 
--k|--killed::
+-k::
+--killed::
        Show files on the filesystem that need to be removed due
        to file/directory conflicts for checkout-index to
        succeed.
@@ -67,11 +75,13 @@ OPTIONS
 -z::
        \0 line termination on output.
 
--x|--exclude=<pattern>::
+-x <pattern>::
+--exclude=<pattern>::
        Skips files matching pattern.
        Note that pattern is a shell wildcard pattern.
 
--X|--exclude-from=<file>::
+-X <file>::
+--exclude-from=<file>::
        exclude patterns are read from <file>; 1 per line.
 
 --exclude-per-directory=<file>::
index 8ad7a94f950068313722337610d336f761b70e72..f92f3ca1860f9d3e0d5b3f21674a9c2baf61b4d9 100644 (file)
@@ -20,13 +20,17 @@ commit IDs.
 
 OPTIONS
 -------
--h|--heads, -t|--tags::
+-h::
+--heads::
+-t::
+--tags::
        Limit to only refs/heads and refs/tags, respectively.
        These options are _not_ mutually exclusive; when given
        both, references stored in refs/heads and refs/tags are
        displayed.
 
--u <exec>, --upload-pack=<exec>::
+-u <exec>::
+--upload-pack=<exec>::
        Specify the full path of linkgit:git-upload-pack[1] on the remote
        host. This allows listing references from repositories accessed via
        SSH and where the SSH daemon does not use the PATH configured by the
index fb485de2c85b369bbbcfc7974825448b1c5b7ff0..339190600a292eca9b56771316118481236d46fb 100644 (file)
@@ -34,7 +34,8 @@ OPTIONS
        condition. An error happens when a source is neither existing nor
         controlled by GIT, or when it would overwrite an existing
         file unless '-f' is given.
--n, \--dry-run::
+-n::
+--dry-run::
        Do nothing; only show what would happen
 
 
index 12784d737296544c7b32f3f41c8ca25988d2421d..ffac3f8f564bf5f5e2ca317b986db9b01f5dc026 100644 (file)
@@ -41,6 +41,13 @@ OPTIONS
        of linkgit:git-describe[1] more closely.  This option
        cannot be combined with --stdin.
 
+--no-undefined::
+       Die with error code != 0 when a reference is undefined,
+       instead of printing `undefined`.
+
+--always::
+       Show uniquely abbreviated commit object as fallback.
+
 EXAMPLE
 -------
 
index d5a87effa4b3f15895eb8956cd4180f71a32dff7..f4d8d68e34b223f6ed06bceca706f9b91232c15f 100644 (file)
@@ -79,7 +79,8 @@ base-name::
        reference was included in the resulting packfile.  This
        can be useful to send new tags to native git clients.
 
---window=[N], --depth=[N]::
+--window=[N]::
+--depth=[N]::
        These two options affect how the objects contained in
        the pack are stored using delta compression.  The
        objects are first internally sorted by type, size and
index fa486813747135d9592ff6a117bb8568524de7cc..c0718468d563e7ee5f8bd37c5f583ec7dc9d3d62 100644 (file)
@@ -42,7 +42,7 @@ unpacked.
 OPTIONS
 -------
 
-\--all::
+--all::
 
 The command by default packs all tags and refs that are already
 packed, and leaves other refs
@@ -51,7 +51,7 @@ developed and packing their tips does not help performance.
 This option causes branch tips to be packed as well.  Useful for
 a repository with many branches of historical interests.
 
-\--no-prune::
+--no-prune::
 
 The command usually removes loose refs under `$GIT_DIR/refs`
 hierarchy after packing them.  This option tells it not to.
index 56be1b611892799819d7aeae64496a53c0efba08..ffbf93a7993cee0386c42bef1c827a8488f04d8e 100644 (file)
@@ -16,7 +16,7 @@ This command is deprecated; use `git-ls-remote` instead.
 
 OPTIONS
 -------
-\--upload-pack=<git-upload-pack>::
+--upload-pack=<git-upload-pack>::
        Use this to specify the path to 'git-upload-pack' on the
        remote side, if it is not found on your $PATH. Some
        installations of sshd ignores the user's environment
index 7283d07a0ebac9128906f5e5262331a96dd736ca..ec335d6fab6e9639a7f7d93c5b88002e2192fd4c 100644 (file)
@@ -37,7 +37,7 @@ OPTIONS
 \--::
        Do not interpret any more arguments as options.
 
-\--expire <time>::
+--expire <time>::
        Only expire loose objects older than <time>.
 
 <head>...::
index 5c522ced980dd2d457608f37de725bc13eb5b855..d0f1595f7e9051b5d58d1dba030ea3a7d80bdab5 100644 (file)
@@ -30,7 +30,7 @@ include::merge-options.txt[]
 
 :git-pull: 1
 
-\--rebase::
+--rebase::
        Instead of a merge, perform a rebase after fetching.  If
        there is a remote ref for the upstream branch, and this branch
        was rebased since last fetched, the rebase uses that information
@@ -38,13 +38,14 @@ include::merge-options.txt[]
        for branch `<name>`, set configuration `branch.<name>.rebase`
        to `true`.
 +
-*NOTE:* This is a potentially _dangerous_ mode of operation.
+[NOTE]
+This is a potentially _dangerous_ mode of operation.
 It rewrites history, which does not bode well when you
 published that history already.  Do *not* use this option
 unless you have read linkgit:git-rebase[1] carefully.
 
-\--no-rebase::
-       Override earlier \--rebase.
+--no-rebase::
+       Override earlier --rebase.
 
 include::fetch-options.txt[]
 
index 9d8c379717f2618746fc32baa84a771160e8364a..f3d5d883a7e4e42c47670eeeef41799b1cb0c228 100644 (file)
@@ -61,13 +61,14 @@ 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::
+--all::
        Instead of naming each ref to push, specifies that all
        refs under `$GIT_DIR/refs/heads/` be pushed.
 
-\--mirror::
+--mirror::
        Instead of naming each ref to push, specifies that all
-       refs under `$GIT_DIR/refs/heads/` and `$GIT_DIR/refs/tags/`
+       refs under `$GIT_DIR/refs/` (which includes but is not
+       limited to `refs/heads/`, `refs/remotes/`, and `refs/tags/`)
        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
@@ -75,39 +76,42 @@ nor in any Push line of the corresponding remotes file---see below).
        if the configuration option `remote.<remote>.mirror` is
        set.
 
-\--dry-run::
+--dry-run::
        Do everything except actually send the updates.
 
-\--tags::
+--tags::
        All refs under `$GIT_DIR/refs/tags` are pushed, in
        addition to refspecs explicitly listed on the command
        line.
 
-\--receive-pack=<git-receive-pack>::
+--receive-pack=<git-receive-pack>::
        Path to the 'git-receive-pack' program on the remote
        end.  Sometimes useful when pushing to a remote
        repository over ssh, and you do not have the program in
        a directory on the default $PATH.
 
-\--exec=<git-receive-pack>::
+--exec=<git-receive-pack>::
        Same as \--receive-pack=<git-receive-pack>.
 
--f, \--force::
+-f::
+--force::
        Usually, the command refuses to update a remote ref that is
        not an ancestor of the local ref used to overwrite it.
        This flag disables the check.  This can cause the
        remote repository to lose commits; use it with care.
 
-\--repo=<repo>::
+--repo=<repo>::
        When no repository is specified the command defaults to
        "origin"; this overrides it.
 
-\--thin, \--no-thin::
+--thin::
+--no-thin::
        These options are passed to `git-send-pack`.  Thin
        transfer spends extra cycles to minimize the number of
        objects to be sent and meant to be used on slower connection.
 
--v, \--verbose::
+-v::
+--verbose::
        Run verbosely.
 
 include::urls-remotes.txt[]
index d0bc182c7454b828fdc6e429c9b9d350fb9a93c9..0600379394ee7c2b00743379170b9a4718bf7db6 100644 (file)
@@ -29,6 +29,8 @@ preserved as the 1 line subject in the git description.
 
 OPTIONS
 -------
+
+-n::
 --dry-run::
        Walk through the patches in the series and warn
        if we cannot find all of the necessary information to commit
index cbe68352bfbb957ccbbc99fae4f97c49d90c647e..58fb906ef68e8b800b0616a5655aa757a362ed6e 100644 (file)
@@ -50,6 +50,9 @@ OPTIONS
        trees that are not directly related to the current
        working tree status into a temporary index file.
 
+-v::
+       Show the progress of checking files out.
+
 --trivial::
        Restrict three-way merge by `git-read-tree` to happen
        only if there is no file-level merging required, instead
index cc48beec750ff32ad439efcffb3dd19a2b1eedfb..7166414355e7469c5aeae0262f3902ce7398c989 100644 (file)
@@ -213,19 +213,22 @@ OPTIONS
 --skip::
        Restart the rebasing process by skipping the current patch.
 
--m, \--merge::
+-m::
+--merge::
        Use merging strategies to rebase.  When the recursive (default) merge
        strategy is used, this allows rebase to be aware of renames on the
        upstream side.
 
--s <strategy>, \--strategy=<strategy>::
+-s <strategy>::
+--strategy=<strategy>::
        Use the given merge strategy; can be supplied more than
        once to specify them in the order they should be tried.
        If there is no `-s` option, a built-in list of strategies
        is used instead (`git-merge-recursive` when merging a single
        head, `git-merge-octopus` otherwise).  This implies --merge.
 
--v, \--verbose::
+-v::
+--verbose::
        Display a diffstat of what changed upstream since the last rebase.
 
 -C<n>::
@@ -238,12 +241,14 @@ OPTIONS
        This flag is passed to the `git-apply` program
        (see linkgit:git-apply[1]) that applies the patch.
 
--i, \--interactive::
+-i::
+--interactive::
        Make a list of the commits which are about to be rebased.  Let the
        user edit that list before rebasing.  This mode can also be used to
        split commits (see SPLITTING COMMITS below).
 
--p, \--preserve-merges::
+-p::
+--preserve-merges::
        Instead of ignoring merges, try to recreate them.  This option
        only works in interactive mode.
 
index e97dc0929678dfec9266d12e02e7ddf3c29bb797..345943a26466dab73034b41698c54ca317cc4d75 100644 (file)
@@ -9,11 +9,11 @@ git-remote - manage set of tracked repositories
 SYNOPSIS
 --------
 [verse]
-'git-remote'
+'git-remote' [-v | --verbose]
 'git-remote' add [-t <branch>] [-m <master>] [-f] [--mirror] <name> <url>
 'git-remote' rm <name>
-'git-remote' show <name>
-'git-remote' prune <name>
+'git-remote' show [-n] <name>
+'git-remote' prune [-n | --dry-run] <name>
 'git-remote' update [group]
 
 DESCRIPTION
@@ -22,6 +22,14 @@ DESCRIPTION
 Manage the set of repositories ("remotes") whose branches you track.
 
 
+OPTIONS
+-------
+
+-v::
+--verbose::
+       Be a little more verbose and show remote url after name.
+
+
 COMMANDS
 --------
 
@@ -72,9 +80,8 @@ These stale branches have already been removed from the remote repository
 referenced by <name>, but are still locally available in
 "remotes/<name>".
 +
-With `-n` option, the remote heads are not confirmed first with `git
-ls-remote <name>`; cached information is used instead.  Use with
-caution.
+With `--dry-run` option, report what branches will be pruned, but do no
+actually prune them.
 
 'update'::
 
index 793dccaa9d67563a3dd3340d24d1bd66ddef7589..04d6f1fbc445efc8046e09fa70e9340d1374ea65 100644 (file)
@@ -73,7 +73,8 @@ OPTIONS
        this repository (or a direct copy of it)
        over HTTP or FTP.  See gitlink:git-update-server-info[1].
 
---window=[N], --depth=[N]::
+--window=[N]::
+--depth=[N]::
        These two options affect how the objects contained in the pack are
        stored using delta compression. The objects are first internally
        sorted by type, size and optionally names and compared against the
index a0ef1fd55062754cbcabcb660351bb6f0b1a1ca7..9e273bc5a6ee091ad7b81254228d33fd4df5541e 100644 (file)
@@ -52,7 +52,8 @@ OPTIONS
        The parameter given must be usable as a single, valid
        object name.  Otherwise barf and abort.
 
--q, --quiet::
+-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.
@@ -119,16 +120,19 @@ OPTIONS
 --is-bare-repository::
        When the repository is bare print "true", otherwise "false".
 
---short, --short=number::
+--short::
+--short=number::
        Instead of outputting the full SHA1 values of object names try to
        abbreviate them to a shorter unique name. When no length is specified
        7 is used. The minimum length is 4.
 
---since=datestring, --after=datestring::
+--since=datestring::
+--after=datestring::
        Parses the date string, and outputs corresponding
        --max-age= parameter for git-rev-list command.
 
---until=datestring, --before=datestring::
+--until=datestring::
+--before=datestring::
        Parses the date string, and outputs corresponding
        --min-age= parameter for git-rev-list command.
 
index 5e6adfcea378771c19bb79563463875c6e7f513e..5b49b813862c5318701e40f1a798ca04cd1d3a63 100644 (file)
@@ -22,12 +22,14 @@ OPTIONS
        For a more complete list of ways to spell commit names, see
        "SPECIFYING REVISIONS" section in linkgit:git-rev-parse[1].
 
--e|--edit::
+-e::
+--edit::
        With this option, `git-revert` will let you edit the commit
        message prior to committing the revert. This is the default if
        you run the command from a terminal.
 
--m parent-number|--mainline parent-number::
+-m parent-number::
+--mainline parent-number::
        Usually you cannot revert a merge because you do not know which
        side of the merge should be considered the mainline.  This
        option specifies the parent number (starting from 1) of
@@ -38,7 +40,8 @@ OPTIONS
        With this option, `git-revert` will not start the commit
        message editor.
 
--n|--no-commit::
+-n::
+--no-commit::
        Usually the command automatically creates a commit with
        a commit log message stating which commit was reverted.
        This flag applies the change necessary to revert the
@@ -51,7 +54,8 @@ OPTIONS
 This is useful when reverting more than one commits'
 effect to your working tree in a row.
 
--s|--signoff::
+-s::
+--signoff::
        Add Signed-off-by line at the end of the commit message.
 
 
index da3fe59135bfc682f91f419f6301240aafed2c85..d88554bedcaa9acdf8828e9abe6d5169e32446a3 100644 (file)
@@ -38,7 +38,8 @@ OPTIONS
 -f::
        Override the up-to-date check.
 
--n, \--dry-run::
+-n::
+--dry-run::
        Don't actually remove any file(s).  Instead, just show
        if they exist in the index and would otherwise be removed
        by the command.
@@ -52,15 +53,16 @@ OPTIONS
        the list of files, (useful when filenames might be mistaken
        for command-line options).
 
-\--cached::
+--cached::
        Use this option to unstage and remove paths only from the index.
        Working tree files, whether modified or not, will be
        left alone.
 
-\--ignore-unmatch::
+--ignore-unmatch::
        Exit with a zero status even if no files matched.
 
--q, \--quiet::
+-q::
+--quiet::
        git-rm normally outputs one line (in the form of an "rm" command)
        for each file removed. This option suppresses that output.
 
index a29583796dc79cad475e73f1aaa123bd80fbf233..251d661afd9fc93b556e2673b202523dd30383c6 100644 (file)
@@ -40,7 +40,8 @@ The --cc option must be repeated for each user you want on the cc list.
        Output of this command must be single email address per line.
        Default is the value of 'sendemail.cccmd' configuration value.
 
---chain-reply-to, --no-chain-reply-to::
+--chain-reply-to::
+--no-chain-reply-to::
        If this is set, each email will be sent as a reply to the previous
        email sent.  If disabled with "--no-chain-reply-to", all emails after
        the first will be sent as replies to the first email sent.  When using
@@ -65,7 +66,8 @@ The --cc option must be repeated for each user you want on the cc list.
        Only necessary if --compose is also set.  If --compose
        is not set, this will be prompted for.
 
---signed-off-by-cc, --no-signed-off-by-cc::
+--signed-off-by-cc::
+--no-signed-off-by-cc::
         If this is set, add emails found in Signed-off-by: or Cc: lines to the
         cc list.
         Default is the value of 'sendemail.signedoffcc' configuration value;
@@ -141,7 +143,8 @@ user is prompted for a password while the input is masked for privacy.
        Only necessary if --compose is also set.  If --compose
        is not set, this will be prompted for.
 
---suppress-from, --no-suppress-from::
+--suppress-from::
+--no-suppress-from::
         If this is set, do not add the From: address to the cc: list.
         Default is the value of 'sendemail.suppressfrom' configuration value;
         if that is unspecified, default to --no-suppress-from.
@@ -157,7 +160,8 @@ user is prompted for a password while the input is masked for privacy.
        if that is unspecified, default to 'self' if --suppress-from is
        specified, as well as 'sob' if --no-signed-off-cc is specified.
 
---thread, --no-thread::
+--thread::
+--no-thread::
        If this is set, the In-Reply-To header will be set on each email sent.
        If disabled with "--no-thread", no emails will have the In-Reply-To
        header set.
index 850c351dcd3748716abf6a3f6f154050a3a67166..ba2fdaec08913e921189395e7feb2ed4d229ece5 100644 (file)
@@ -21,33 +21,33 @@ updates it from the current repository, sending named refs.
 
 OPTIONS
 -------
-\--receive-pack=<git-receive-pack>::
+--receive-pack=<git-receive-pack>::
        Path to the 'git-receive-pack' program on the remote
        end.  Sometimes useful when pushing to a remote
        repository over ssh, and you do not have the program in
        a directory on the default $PATH.
 
-\--exec=<git-receive-pack>::
+--exec=<git-receive-pack>::
        Same as \--receive-pack=<git-receive-pack>.
 
-\--all::
+--all::
        Instead of explicitly specifying which refs to update,
        update all heads that locally exist.
 
-\--dry-run::
+--dry-run::
        Do everything except actually send the updates.
 
-\--force::
+--force::
        Usually, the command refuses to update a remote ref that
        is not an ancestor of the local ref used to overwrite it.
        This flag disables the check.  What this means is that
        the remote repository can lose commits; use it with
        care.
 
-\--verbose::
+--verbose::
        Run verbosely.
 
-\--thin::
+--thin::
        Spend extra cycles to minimize the number of objects to be sent.
        Use it on slower connection.
 
index 5079b568e6fda5a1348c0bc585bb958fb5f8e919..daa64d4d8165a0dfe5d87f54cd44c4bb6b476eba 100644 (file)
@@ -22,17 +22,21 @@ Additionally, "[PATCH]" will be stripped from the commit description.
 OPTIONS
 -------
 
--h, \--help::
+-h::
+--help::
        Print a short usage message and exit.
 
--n, \--numbered::
+-n::
+--numbered::
        Sort output according to the number of commits per author instead
        of author alphabetic order.
 
--s, \--summary::
+-s::
+--summary::
        Suppress commit description and provide a commit count summary only.
 
--e, \--email::
+-e::
+--email::
        Show the email address of each author.
 
 -w[<width>[,<indent1>[,<indent2>]]]::
index 32595ad5498981343b60daf8cf5c389c6d9724a1..de9e8f885f794692bcc45b871e791ebbd7c806cd 100644 (file)
@@ -38,10 +38,12 @@ OPTIONS
        branches under $GIT_DIR/refs/heads/topic, giving
        `topic/*` would show all of them.
 
--r|--remotes::
+-r::
+--remotes::
        Show the remote-tracking branches.
 
--a|--all::
+-a::
+--all::
        Show both remote-tracking branches and local branches.
 
 --current::
index a85332c3630c227ffb4015a9aa0b6c3014ae38ad..6b99529b6bb659ec1e1ffd741208ef03762c0356 100644 (file)
@@ -29,22 +29,26 @@ in the `.git` directory.
 OPTIONS
 -------
 
--h, --head::
+-h::
+--head::
 
        Show the HEAD reference.
 
---tags, --heads::
+--tags::
+--heads::
 
        Limit to only "refs/heads" and "refs/tags", respectively.  These
        options are not mutually exclusive; when given both, references stored
        in "refs/heads" and "refs/tags" are displayed.
 
--d, --dereference::
+-d::
+--dereference::
 
        Dereference tags into object IDs as well. They will be shown with "^{}"
        appended.
 
--s, --hash::
+-s::
+--hash::
 
        Only show the SHA1 hash, not the reference name. When also using
        --dereference the dereferenced tag will still be shown after the SHA1.
@@ -55,17 +59,20 @@ OPTIONS
        Aside from returning an error code of 1, it will also print an error
        message if '--quiet' was not specified.
 
---abbrev, --abbrev=len::
+--abbrev::
+--abbrev=len::
 
        Abbreviate the object name.  When using `--hash`, you do
        not have to say `--hash --abbrev`; `--hash=len` would do.
 
--q, --quiet::
+-q::
+--quiet::
 
        Do not print any results to stdout. When combined with '--verify' this
        can be used to silently check if a reference exists.
 
---exclude-existing, --exclude-existing=pattern::
+--exclude-existing::
+--exclude-existing=pattern::
 
        Make git-show-ref act as a filter that reads refs from stdin of the
        form "^(?:<anything>\s)?<refname>(?:\^\{\})?$" and performs the
index 4883834a14ebfe74ff8c6794db1dfd13c0ef9028..8421a39f26ac4807afd42e8f3ac084686b170871 100644 (file)
@@ -16,7 +16,8 @@ Remove multiple empty lines, and empty lines at beginning and end.
 
 OPTIONS
 -------
--s|--strip-comments::
+-s::
+--strip-comments::
        In addition to empty lines, also strip lines starting with '#'.
 
 <stream>::
index 139206f01433bd2ec1d7c42e2e82d16b84e45b97..441ae1483bf57aca849c0470c6e19e963c9ebf19 100644 (file)
@@ -61,10 +61,12 @@ summary::
 
 OPTIONS
 -------
--q, --quiet::
+-q::
+--quiet::
        Only print error messages.
 
--b, --branch::
+-b::
+--branch::
        Branch of repository to add as submodule.
 
 --cached::
@@ -72,7 +74,8 @@ OPTIONS
        commands typically use the commit found in the submodule HEAD, but
        with this option, the commit stored in the index is used instead.
 
--n, --summary-limit::
+-n::
+--summary-limit::
        This option is only valid for the summary command.
        Limit the summary size (number of commits shown in total).
        Giving 0 will disable the summary; a negative number means unlimited
index f4cbd2f212e544f0a17c761a4c870a925db5802b..97bed54fbde18a1e7c5516382a54b341fc81668e 100644 (file)
@@ -448,6 +448,8 @@ svn-remote.<name>.rewriteRoot::
        the repository with a public http:// or svn:// URL in the
        metadata so users of it will see the public URL.
 
+--
+
 Since the noMetadata, rewriteRoot, useSvnsyncProps and useSvmProps
 options all affect the metadata generated and used by git-svn; they
 *must* be set in the configuration file before any history is imported
@@ -456,7 +458,6 @@ and these settings should never be changed once they are set.
 Additionally, only one of these four options can be used per-svn-remote
 section because they affect the 'git-svn-id:' metadata line.
 
---
 
 BASIC EXAMPLES
 --------------
index e9b996baa831dfc06088f19815a21341cdb32563..3d3a059c5e2e91bff2de173c5d6f8107d10b7e62 100644 (file)
@@ -26,7 +26,8 @@ a regular file whose contents is `ref: refs/heads/master`.
 OPTIONS
 -------
 
--q, --quiet::
+-q::
+--quiet::
        Do not issue an error message if the <name> is not a
        symbolic ref but a detached HEAD; instead exit with
        non-zero status silently.
index c703365186afbe25d106d3f5a3e4f857ed65fe8e..bbb0a6ad57187c4387412a08ff301ddfc7173726 100644 (file)
@@ -76,7 +76,8 @@ OPTIONS
 --chmod=(+|-)x::
         Set the execute permissions on the updated files.
 
---assume-unchanged, --no-assume-unchanged::
+--assume-unchanged::
+--no-assume-unchanged::
        When these flags are specified, the object name recorded
        for the paths are not updated.  Instead, these options
        sets and unsets the "assume unchanged" bit for the
@@ -88,7 +89,8 @@ OPTIONS
        filesystem that has very slow lstat(2) system call
        (e.g. cifs).
 
---again, -g::
+-g::
+--again::
        Runs `git-update-index` itself on the paths whose index
        entries are different from those from the `HEAD` commit.
 
index 7f7e3d197bafbbb2efe610096b0cad6901488be5..bae2c8b7eced2042af0437b1e92cc73636c7cfa5 100644 (file)
@@ -7,7 +7,7 @@ git-update-ref - Update the object name stored in a ref safely
 
 SYNOPSIS
 --------
-'git-update-ref' [-m <reason>] (-d <ref> <oldvalue> | [--no-deref] <ref> <newvalue> [<oldvalue>])
+'git-update-ref' [-m <reason>] (-d <ref> [<oldvalue>] | [--no-deref] <ref> <newvalue> [<oldvalue>])
 
 DESCRIPTION
 -----------
index aa1ee67cbb2a7f285d466f33c4078a31b9394e8f..d21be41d0646c80e7ec9aeb1ed46ce617022e3cc 100644 (file)
@@ -22,7 +22,8 @@ generates such auxiliary files.
 OPTIONS
 -------
 
--f|--force::
+-f::
+--force::
        Update the info files from scratch.
 
 
index 521da5b200fc3ad8eea035cfe0c6fa70b477e0e9..bac465e13f2b2d0aaadaedf00fd03ab6f3f9a62c 100644 (file)
@@ -24,10 +24,10 @@ repository.  For push operations, see 'git-send-pack'.
 OPTIONS
 -------
 
-\--strict::
+--strict::
        Do not try <directory>/.git/ if <directory> is no git directory.
 
-\--timeout=<n>::
+--timeout=<n>::
        Interrupt transfer after <n> seconds of inactivity.
 
 <directory>::
index f8d5fb11d1922e7469b325e237fa097f86a6a638..e80a7c1cc4c1b62bc4fbdb0a91f063022542d38d 100644 (file)
@@ -31,14 +31,17 @@ Custom commands may also be specified.
 
 OPTIONS
 -------
--b BROWSER|--browser=BROWSER::
+-b BROWSER::
+--browser=BROWSER::
        Use the specified BROWSER. It must be in the list of supported
        browsers.
 
--t BROWSER|--tool=BROWSER::
+-t BROWSER::
+--tool=BROWSER::
        Same as above.
 
--c CONF.VAR|--config=CONF.VAR::
+-c CONF.VAR::
+--config=CONF.VAR::
        CONF.VAR is looked up in the git config files. If it's set,
        then its value specify the browser that should be used.
 
index ba07e51f59edbbf101c092a2664e6436c0004e47..7414238fe52819689615e57d10f53dd2b29a3cbe 100644 (file)
@@ -43,15 +43,21 @@ unreleased) version of git, that is available from 'master'
 branch of the `git.git` repository.
 Documentation for older releases are available here:
 
+* link:v1.5.6/git.html[documentation for release 1.5.6]
+
+* release notes for
+  link:RelNotes-1.5.6.txt[1.5.6],
+
 * link:v1.5.5/git.html[documentation for release 1.5.5]
 
 * release notes for
+  link:RelNotes-1.5.5.4.txt[1.5.5.4],
   link:RelNotes-1.5.5.3.txt[1.5.5.3],
   link:RelNotes-1.5.5.2.txt[1.5.5.2],
   link:RelNotes-1.5.5.1.txt[1.5.5.1],
   link:RelNotes-1.5.5.txt[1.5.5].
 
-* link:v1.5.5.3/git.html[documentation for release 1.5.5.3]
+* link:v1.5.5.4/git.html[documentation for release 1.5.5.4]
 
 * link:v1.5.4.5/git.html[documentation for release 1.5.4.5]
 
@@ -137,7 +143,8 @@ help ...'.
        environment variable. If no path is given 'git' will print
        the current setting and then exit.
 
--p|--paginate::
+-p::
+--paginate::
        Pipe all output into 'less' (or if set, $PAGER).
 
 --no-pager::
index 14bcf91f4060be9168f2f80126ca37340796fe04..f843f39bf2f0d42f568595e1b29192d203b3e403 100644 (file)
@@ -25,7 +25,8 @@ To control which revisions to shown, the command takes options applicable to
 the linkgit:git-rev-list[1] command. This manual page describes only the most
 frequently used options.
 
--n <number>, --max-count=<number>::
+-n <number>::
+--max-count=<number>::
 
        Limits the number of commits to show.
 
index 9563a632eb5fef5fe62a5b5bd152cd06ad874a1f..d465aab64e367f1564793b74522d571433d5b53f 100644 (file)
@@ -114,7 +114,7 @@ newly modified content to the index.  Finally, commit your changes with:
 $ git commit
 ------------------------------------------------
 
-This will again prompt your for a message describing the change, and then
+This will again prompt you for a message describing the change, and then
 record a new version of the project.
 
 Alternatively, instead of running `git add` beforehand, you can use
index b7d09c1ec69ac0e76302cef44d5f6884d05a0e0f..40327486084ac02874faff70fd100b619af83214 100644 (file)
@@ -186,7 +186,7 @@ Step 3: setup the client
 ------------------------
 
 Make sure that you have HTTP support, i.e. your git was built with
-curl (version more recent than 7.10). The command 'git http-push' with
+libcurl (version more recent than 7.10). The command 'git http-push' with
 no argument should display a usage message.
 
 Then, add the following to your $HOME/.netrc (you can do without, but will be
index f37a77648934fcd8c707cfc1446ef5425cc7fa79..ffbc6e9861094f48fd3f24af3a0b343c9c0ea7f4 100644 (file)
@@ -2,10 +2,12 @@
        Show a diffstat at the end of the merge. The diffstat is also
        controlled by the configuration option merge.stat.
 
--n, \--no-stat::
+-n::
+--no-stat::
        Do not show diffstat at the end of the merge.
 
---summary, \--no-summary::
+--summary::
+--no-summary::
        Synonyms to --stat and --no-stat; these are deprecated and will be
        removed in the future.
 
@@ -49,7 +51,8 @@
        a fast-forward, only update the branch pointer. This is
        the default behavior of git-merge.
 
--s <strategy>, \--strategy=<strategy>::
+-s <strategy>::
+--strategy=<strategy>::
        Use the given merge strategy; can be supplied more than
        once to specify them in the order they should be tried.
        If there is no `-s` option, a built-in list of strategies
index e8bea3e18e569e702233d0bb986fc7e52266d445..ec3755579408ebae58c7de644609590f5636b9c6 100644 (file)
@@ -124,3 +124,25 @@ The placeholders are:
 - '%m': left, right or boundary mark
 - '%n': newline
 - '%x00': print a byte from a hex code
+
+* 'tformat:'
++
+The 'tformat:' format works exactly like 'format:', except that it
+provides "terminator" semantics instead of "separator" semantics. In
+other words, each commit has the message terminator character (usually a
+newline) appended, rather than a separator placed between entries.
+This means that the final entry of a single-line format will be properly
+terminated with a new line, just as the "oneline" format does.
+For example:
++
+---------------------
+$ git log -2 --pretty=format:%h 4da45bef \
+  | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
+4da45be
+7134973 -- NO NEWLINE
+
+$ git log -2 --pretty=tformat:%h 4da45bef \
+  | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
+4da45be
+7134973
+---------------------
index 05d5abec25e73a123fd249099911d79f1ccf2a39..37dd1d61ea36d7afb1e1b16cc46bee0d357ad1c8 100644 (file)
@@ -129,7 +129,8 @@ limiting may be applied.
 
 --
 
--n 'number', --max-count='number'::
+-n 'number'::
+--max-count='number'::
 
        Limit the number of commits output.
 
@@ -137,21 +138,25 @@ limiting may be applied.
 
        Skip 'number' commits before starting to show the commit output.
 
---since='date', --after='date'::
+--since='date'::
+--after='date'::
 
        Show commits more recent than a specific date.
 
---until='date', --before='date'::
+--until='date'::
+--before='date'::
 
        Show commits older than a specific date.
 
 ifdef::git-rev-list[]
---max-age='timestamp', --min-age='timestamp'::
+--max-age='timestamp'::
+--min-age='timestamp'::
 
        Limit the commits output to specified time range.
 endif::git-rev-list[]
 
---author='pattern', --committer='pattern'::
+--author='pattern'::
+--committer='pattern'::
 
        Limit the commits output to ones with author/committer
        header lines that match the specified pattern (regular expression).
@@ -161,16 +166,19 @@ endif::git-rev-list[]
        Limit the commits output to ones with log message that
        matches the specified pattern (regular expression).
 
--i, --regexp-ignore-case::
+-i::
+--regexp-ignore-case::
 
        Match the regexp limiting patterns without regard to letters case.
 
--E, --extended-regexp::
+-E::
+--extended-regexp::
 
        Consider the limiting patterns to be extended regular expressions
        instead of the default basic regular expressions.
 
--F, --fixed-strings::
+-F::
+--fixed-strings::
 
        Consider the limiting patterns to be fixed strings (don't interpret
        pattern as a regular expression).
@@ -239,7 +247,8 @@ from the other branch (for example, "3rd on b" may be cherry-picked
 from branch A).  With this option, such pairs of commits are
 excluded from the output.
 
--g, --walk-reflogs::
+-g::
+--walk-reflogs::
 
        Instead of walking the commit ancestry chain, walk
        reflog entries from the most recent one to older ones.
@@ -268,7 +277,8 @@ See also linkgit:git-reflog[1].
        Output uninteresting commits at the boundary, which are usually
        not shown.
 
---dense, --sparse::
+--dense::
+--sparse::
 
 When optional paths are given, the default behaviour ('--dense') is to
 only output commits that changes at least one of them, and also ignore
index d0776831710eaffa6e4b88edfd62e5fbb25fff31..9dbedd0a67ce6c1cecd157b0d89f9b1333e180e3 100644 (file)
@@ -1,9 +1,126 @@
 path-list API
 =============
 
-Talk about <path-list.h>, things like
+The path_list API offers a data structure and functions to handle sorted
+and unsorted string lists.
 
-* it is not just paths but strings in general;
-* the calling sequence.
+The name is a bit misleading, a path_list may store not only paths but
+strings in general.
 
-(Dscho)
+The caller:
+
+. Allocates and clears a `struct path_list` variable.
+
+. Initializes the members. You might want to set the flag `strdup_paths`
+  if the strings should be strdup()ed. For example, this is necessary
+  when you add something like git_path("..."), since that function returns
+  a static buffer that will change with the next call to git_path().
++
+If you need something advanced, you can manually malloc() the `items`
+member (you need this if you add things later) and you should set the
+`nr` and `alloc` members in that case, too.
+
+. Adds new items to the list, using `path_list_append` or `path_list_insert`.
+
+. Can check if a string is in the list using `path_list_has_path` or
+  `unsorted_path_list_has_path` and get it from the list using
+  `path_list_lookup` for sorted lists.
+
+. Can sort an unsorted list using `sort_path_list`.
+
+. Finally it should free the list using `path_list_clear`.
+
+Example:
+
+----
+struct path_list list;
+int i;
+
+memset(&list, 0, sizeof(struct path_list));
+path_list_append("foo", &list);
+path_list_append("bar", &list);
+for (i = 0; i < list.nr; i++)
+       printf("%s\n", list.items[i].path)
+----
+
+NOTE: It is more efficient to build an unsorted list and sort it
+afterwards, instead of building a sorted list (`O(n log n)` instead of
+`O(n^2)`).
++
+However, if you use the list to check if a certain string was added
+already, you should not do that (using unsorted_path_list_has_path()),
+because the complexity would be quadratic again (but with a worse factor).
+
+Functions
+---------
+
+* General ones (works with sorted and unsorted lists as well)
+
+`print_path_list`::
+
+       Dump a path_list to stdout, useful mainly for debugging purposes. It
+       can take an optional header argument and it writes out the
+       string-pointer pairs of the path_list, each one in its own line.
+
+`path_list_clear`::
+
+       Free a path_list. The `path` pointer of the items will be freed in case
+       the `strdup_paths` member of the path_list is set. The second parameter
+       controls if the `util` pointer of the items should be freed or not.
+
+* Functions for sorted lists only
+
+`path_list_has_path`::
+
+       Determine if the path_list has a given string or not.
+
+`path_list_insert`::
+
+       Insert a new element to the path_list. The returned pointer can be handy
+       if you want to write something to the `util` pointer of the
+       path_list_item containing the just added string.
++
+Since this function uses xrealloc() (which die()s if it fails) if the
+list needs to grow, it is safe not to check the pointer. I.e. you may
+write `path_list_insert(...)->util = ...;`.
+
+`path_list_lookup`::
+
+       Look up a given string in the path_list, returning the containing
+       path_list_item. If the string is not found, NULL is returned.
+
+* Functions for unsorted lists only
+
+`path_list_append`::
+
+       Append a new string to the end of the path_list.
+
+`sort_path_list`::
+
+       Make an unsorted list sorted.
+
+`unsorted_path_list_has_path`::
+
+       It's like `path_list_has_path()` but for unsorted lists.
++
+This function needs to look through all items, as opposed to its
+counterpart for sorted lists, which performs a binary search.
+
+Data structures
+---------------
+
+* `struct path_list_item`
+
+Represents an item of the list. The `path` member is a pointer to the
+string, and you may use the `util` member for any purpose, if you want.
+
+* `struct path_list`
+
+Represents the list itself.
+
+. The array of items are available via the `items` member.
+. The `nr` member contains the number of items stored in the list.
+. The `alloc` member is used to avoid reallocating at every insertion.
+  You should not tamper with it.
+. Setting the `strdup_paths` member to 1 will strdup() the strings
+  before adding them, see above.
index c364a22c8f98f6fbb71d4059f7458ed0fa78ed43..3e1342acf405adb322054a19123cd98fc12b69a9 100644 (file)
@@ -63,7 +63,7 @@ command to run in a sub-process.
 
 The caller:
 
-1. allocates and clears (memset(&chld, '0', sizeof(chld));) a
+1. allocates and clears (memset(&chld, 0, sizeof(chld));) a
    struct child_process variable;
 2. initializes the members;
 3. calls start_command();
@@ -136,7 +136,7 @@ to produce output that the caller reads.
 
 The caller:
 
-1. allocates and clears (memset(&asy, '0', sizeof(asy));) a
+1. allocates and clears (memset(&asy, 0, sizeof(asy));) a
    struct async variable;
 2. initializes .proc and .data;
 3. calls start_async();
index bfde507e0ec9a5aadf71bfb42470b8669369ad56..64a820bf60ae5da8aaaac5fd72c169b8dd381c89 100644 (file)
@@ -1254,16 +1254,15 @@ these three "file stages" represents a different version of the file:
 
 -------------------------------------------------
 $ git show :1:file.txt # the file in a common ancestor of both branches
-$ git show :2:file.txt # the version from HEAD, but including any
-                       # nonconflicting changes from MERGE_HEAD
-$ git show :3:file.txt # the version from MERGE_HEAD, but including any
-                       # nonconflicting changes from HEAD.
+$ git show :2:file.txt # the version from HEAD.
+$ git show :3:file.txt # the version from MERGE_HEAD.
 -------------------------------------------------
 
-Since the stage 2 and stage 3 versions have already been updated with
-nonconflicting changes, the only remaining differences between them are
-the important ones; thus linkgit:git-diff[1] can use the information in
-the index to show only those conflicts.
+When you ask linkgit:git-diff[1] to show the conflicts, it runs a
+three-way diff between the conflicted merge results in the work tree with
+stages 2 and 3 to show only hunks whose contents come from both sides,
+mixed (in other words, when a hunk's merge results come only from stage 2,
+that part is not conflicting and is not shown.  Same for stage 3).
 
 The diff above shows the differences between the working-tree version of
 file.txt and the stage 2 and stage 3 versions.  So instead of preceding
index 3cabc92e7a1f8ce30eb6e5151a4c81c82468bcee..f221447478aea8628c0ab6d098338f7e8630201e 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 GVF=GIT-VERSION-FILE
-DEF_VER=v1.5.5.GIT
+DEF_VER=v1.5.6.GIT
 
 LF='
 '
diff --git a/INSTALL b/INSTALL
index d9b425fa73e806751ff2636300ea24bd1e7f1e56..4a4e13fe46567a567b1ceb09a792379674dc6f57 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -67,10 +67,10 @@ Issues of note:
          that come with git (git includes the one from Mozilla, and has
          its own PowerPC and ARM optimized ones too - see the Makefile).
 
-       - "libcurl" and "curl" executable.  git-http-fetch and
-         git-fetch use them.  If you do not use http
-         transfer, you are probably OK if you do not have
-         them.
+       - libcurl library; git-http-fetch and git-fetch use them.  You
+         might also want the "curl" executable for debugging purposes.
+         If you do not use http transfer, you are probably OK if you
+         do not have them.
 
        - expat library; git-http-push uses it for remote lock
          management over DAV.  Similar to "curl" above, this is optional.
@@ -83,9 +83,6 @@ Issues of note:
        - "perl" and POSIX-compliant shells are needed to use most of
          the barebone Porcelainish scripts.
 
-       - "cpio" is used by git-clone when doing a local (possibly
-         hardlinked) clone.
-
  - Some platform specific issues are dealt with Makefile rules,
    but depending on your specific installation, you may not
    have all the libraries/tools needed, or you may have
index cce5a6e1bf9ad8f5ebf8046a5053588d18e90bc6..6a31c9fedada5d9ea331f119044b3c2383671e60 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -13,7 +13,7 @@ all::
 # Define NO_OPENSSL environment variable if you do not have OpenSSL.
 # This also implies MOZILLA_SHA1.
 #
-# Define NO_CURL if you do not have curl installed.  git-http-pull and
+# Define NO_CURL if you do not have libcurl installed.  git-http-pull and
 # git-http-push are not built, and you cannot use http:// and https://
 # transports.
 #
@@ -564,6 +564,45 @@ endif
 ifeq ($(uname_S),GNU/kFreeBSD)
        NO_STRLCPY = YesPlease
 endif
+ifeq ($(uname_S),UnixWare)
+       CC = cc
+       NEEDS_SOCKET = YesPlease
+       NEEDS_NSL = YesPlease
+       NEEDS_SSL_WITH_CRYPTO = YesPlease
+       NEEDS_LIBICONV = YesPlease
+       SHELL_PATH = /usr/local/bin/bash
+       NO_IPV6 = YesPlease
+       NO_HSTRERROR = YesPlease
+       BASIC_CFLAGS += -Kthread
+       BASIC_CFLAGS += -I/usr/local/include
+       BASIC_LDFLAGS += -L/usr/local/lib
+       INSTALL = ginstall
+       TAR = gtar
+       NO_STRCASESTR = YesPlease
+       NO_MEMMEM = YesPlease
+endif
+ifeq ($(uname_S),SCO_SV)
+       ifeq ($(uname_R),3.2)
+               CFLAGS = -O2
+       endif
+       ifeq ($(uname_R),5)
+               CC = cc
+               BASIC_CFLAGS += -Kthread
+       endif
+       NEEDS_SOCKET = YesPlease
+       NEEDS_NSL = YesPlease
+       NEEDS_SSL_WITH_CRYPTO = YesPlease
+       NEEDS_LIBICONV = YesPlease
+       SHELL_PATH = /usr/bin/bash
+       NO_IPV6 = YesPlease
+       NO_HSTRERROR = YesPlease
+       BASIC_CFLAGS += -I/usr/local/include
+       BASIC_LDFLAGS += -L/usr/local/lib
+       NO_STRCASESTR = YesPlease
+       NO_MEMMEM = YesPlease
+       INSTALL = ginstall
+       TAR = gtar
+endif
 ifeq ($(uname_S),Darwin)
        NEEDS_SSL_WITH_CRYPTO = YesPlease
        NEEDS_LIBICONV = YesPlease
@@ -1251,6 +1290,9 @@ endif
 install-doc:
        $(MAKE) -C Documentation install
 
+install-html:
+       $(MAKE) -C Documentation install-html
+
 install-info:
        $(MAKE) -C Documentation install-info
 
@@ -1373,6 +1415,14 @@ check-docs::
                documented,gitmodules | \
                documented,gitcli | \
                documented,git-tools | \
+               documented,gitcore-tutorial | \
+               documented,gitcvs-migration | \
+               documented,gitdiffcore | \
+               documented,gitglossary | \
+               documented,githooks | \
+               documented,gitrepository-layout | \
+               documented,gittutorial | \
+               documented,gittutorial-2 | \
                sentinel,not,matching,is,ok ) continue ;; \
                esac; \
                case " $(ALL_PROGRAMS) $(BUILT_INS) git gitk " in \
diff --git a/attr.c b/attr.c
index 1a15fad294c5db1f922e686995e215b94b89b9a0..0fb47d34346ca96addde5cb3722fa5e586057285 100644 (file)
--- a/attr.c
+++ b/attr.c
@@ -438,11 +438,13 @@ static void bootstrap_attr_stack(void)
                elem->prev = attr_stack;
                attr_stack = elem;
 
-               elem = read_attr(GITATTRIBUTES_FILE, 1);
-               elem->origin = strdup("");
-               elem->prev = attr_stack;
-               attr_stack = elem;
-               debug_push(elem);
+               if (!is_bare_repository()) {
+                       elem = read_attr(GITATTRIBUTES_FILE, 1);
+                       elem->origin = strdup("");
+                       elem->prev = attr_stack;
+                       attr_stack = elem;
+                       debug_push(elem);
+               }
 
                elem = read_attr_from_file(git_path(INFOATTRIBUTES_FILE), 1);
                if (!elem)
@@ -501,22 +503,24 @@ static void prepare_attr_stack(const char *path, int dirlen)
        /*
         * Read from parent directories and push them down
         */
-       while (1) {
-               char *cp;
-
-               len = strlen(attr_stack->origin);
-               if (dirlen <= len)
-                       break;
-               memcpy(pathbuf, path, dirlen);
-               memcpy(pathbuf + dirlen, "/", 2);
-               cp = strchr(pathbuf + len + 1, '/');
-               strcpy(cp + 1, GITATTRIBUTES_FILE);
-               elem = read_attr(pathbuf, 0);
-               *cp = '\0';
-               elem->origin = strdup(pathbuf);
-               elem->prev = attr_stack;
-               attr_stack = elem;
-               debug_push(elem);
+       if (!is_bare_repository()) {
+               while (1) {
+                       char *cp;
+
+                       len = strlen(attr_stack->origin);
+                       if (dirlen <= len)
+                               break;
+                       memcpy(pathbuf, path, dirlen);
+                       memcpy(pathbuf + dirlen, "/", 2);
+                       cp = strchr(pathbuf + len + 1, '/');
+                       strcpy(cp + 1, GITATTRIBUTES_FILE);
+                       elem = read_attr(pathbuf, 0);
+                       *cp = '\0';
+                       elem->origin = strdup(pathbuf);
+                       elem->prev = attr_stack;
+                       attr_stack = elem;
+                       debug_push(elem);
+               }
        }
 
        /*
index 1da22eec915539f06a4dfc1e4bb1d18482de0ede..9930cf53f5e94cb7389e7c0b2b760b113a366e51 100644 (file)
@@ -200,8 +200,8 @@ static struct option builtin_add_options[] = {
        OPT_GROUP(""),
        OPT_BOOLEAN('i', "interactive", &add_interactive, "interactive picking"),
        OPT_BOOLEAN('p', "patch", &patch_interactive, "interactive patching"),
-       OPT_BOOLEAN('f', NULL, &ignored_too, "allow adding otherwise ignored files"),
-       OPT_BOOLEAN('u', NULL, &take_worktree_changes, "update tracked files"),
+       OPT_BOOLEAN('f', "force", &ignored_too, "allow adding otherwise ignored files"),
+       OPT_BOOLEAN('u', "update", &take_worktree_changes, "update tracked files"),
        OPT_BOOLEAN( 0 , "refresh", &refresh_only, "don't add, only refresh the index"),
        OPT_BOOLEAN( 0 , "ignore-errors", &ignore_add_errors, "just skip files which cannot be added because of errors"),
        OPT_END(),
index f8b3160668e1eeff3ef9a893459c64992aa53b5b..bd343efae7d6cc6fddef4df5c3433b97bd640d3c 100644 (file)
@@ -150,7 +150,7 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name)
 static int batch_one_object(const char *obj_name, int print_contents)
 {
        unsigned char sha1[20];
-       enum object_type type;
+       enum object_type type = 0;
        unsigned long size;
        void *contents = contents;
 
@@ -168,8 +168,11 @@ static int batch_one_object(const char *obj_name, int print_contents)
        else
                type = sha1_object_info(sha1, &size);
 
-       if (type <= 0)
-               return 1;
+       if (type <= 0) {
+               printf("%s missing\n", obj_name);
+               fflush(stdout);
+               return 0;
+       }
 
        printf("%s %s %lu\n", sha1_to_hex(sha1), typename(type), size);
        fflush(stdout);
index 0a70808280c5366acd5655caf0b081b42e628bb4..e3ad38b3bd78bc2d19c5e5d1ebfbe0388b22582e 100644 (file)
@@ -503,7 +503,8 @@ static int prepare_to_commit(const char *index_file, const char *prefix)
 
        fp = fopen(git_path(commit_editmsg), "w");
        if (fp == NULL)
-               die("could not open %s", git_path(commit_editmsg));
+               die("could not open %s: %s",
+                   git_path(commit_editmsg), strerror(errno));
 
        if (cleanup_mode != CLEANUP_NONE)
                stripspace(&sb, 0);
old mode 100755 (executable)
new mode 100644 (file)
index 1dfc01e..d0a462f
@@ -188,6 +188,8 @@ static void handle_commit(struct commit *commit, struct rev_info *rev)
        mark_object(&commit->object);
        if (!is_encoding_utf8(encoding))
                reencoded = reencode_string(message, "UTF-8", encoding);
+       if (!commit->parents)
+               printf("reset %s\n", (const char*)commit->util);
        printf("commit %s\nmark :%d\n%.*s\n%.*s\ndata %u\n%s",
               (const char *)commit->util, last_idnum,
               (int)(author_end - author), author,
index 362c290028d68ebc2e589d424bc42cd5e8630a4e..4aa28a1babbb275df8110fd80311f34a12fea750 100644 (file)
@@ -555,9 +555,19 @@ static void update_file_flags(const unsigned char *sha,
                        die("cannot read object %s '%s'", sha1_to_hex(sha), path);
                if (type != OBJ_BLOB)
                        die("blob expected for %s '%s'", sha1_to_hex(sha), path);
+               if (S_ISREG(mode)) {
+                       struct strbuf strbuf;
+                       strbuf_init(&strbuf, 0);
+                       if (convert_to_working_tree(path, buf, size, &strbuf)) {
+                               free(buf);
+                               size = strbuf.len;
+                               buf = strbuf_detach(&strbuf, NULL);
+                       }
+               }
 
                if (make_room_for_path(path) < 0) {
                        update_wd = 0;
+                       free(buf);
                        goto update_index;
                }
                if (S_ISREG(mode) || (!has_symlinks && S_ISLNK(mode))) {
@@ -580,6 +590,7 @@ static void update_file_flags(const unsigned char *sha,
                } else
                        die("do not know what to do with %06o %s '%s'",
                            mode, sha1_to_hex(sha), path);
+               free(buf);
        }
  update_index:
        if (update_cache)
index 897d1dcac6b34e0c631c94b98c489db075e90bb2..b151e24ff94e06840db7e57014fe4a73ea811575 100644 (file)
@@ -307,6 +307,8 @@ static int expire_reflog(const char *ref, const unsigned char *sha1, int unused,
                        unlink(newlog_path);
                } else if (cmd->updateref && commit_ref(lock)) {
                        status |= error("Couldn't set %s", lock->ref_name);
+               } else {
+                       adjust_shared_perm(log_file);
                }
        }
        free(newlog_path);
index c49f00f58b3cda6ac76a93d5f0bb36e8bc5bafb1..145dd8568c7a644344d8bb25ba395b10c5835c5c 100644 (file)
@@ -419,52 +419,68 @@ static void show_list(const char *title, struct path_list *list)
        printf("\n");
 }
 
-static int show_or_prune(int argc, const char **argv, int prune)
+static int get_remote_ref_states(const char *name,
+                                struct ref_states *states,
+                                int query)
 {
-       int dry_run = 0, result = 0;
+       struct transport *transport;
+       const struct ref *ref;
+
+       states->remote = remote_get(name);
+       if (!states->remote)
+               return error("No such remote: %s", name);
+
+       read_branches();
+
+       if (query) {
+               transport = transport_get(NULL, states->remote->url_nr > 0 ?
+                       states->remote->url[0] : NULL);
+               ref = transport_get_remote_refs(transport);
+               transport_disconnect(transport);
+
+               get_ref_states(ref, states);
+       }
+
+       return 0;
+}
+
+static int append_ref_to_tracked_list(const char *refname,
+       const unsigned char *sha1, int flags, void *cb_data)
+{
+       struct ref_states *states = cb_data;
+       struct refspec refspec;
+
+       memset(&refspec, 0, sizeof(refspec));
+       refspec.dst = (char *)refname;
+       if (!remote_find_tracking(states->remote, &refspec)) {
+               path_list_append(skip_prefix(refspec.src, "refs/heads/"),
+                       &states->tracked);
+       }
+
+       return 0;
+}
+
+static int show(int argc, const char **argv)
+{
+       int no_query = 0, result = 0;
        struct option options[] = {
                OPT_GROUP("show specific options"),
-               OPT__DRY_RUN(&dry_run),
+               OPT_BOOLEAN('n', NULL, &no_query, "do not query remotes"),
                OPT_END()
        };
        struct ref_states states;
 
        argc = parse_options(argc, argv, options, builtin_remote_usage, 0);
 
-       if (argc < 1) {
-               if (!prune)
-                       return show_all();
-               usage_with_options(builtin_remote_usage, options);
-       }
+       if (argc < 1)
+               return show_all();
 
        memset(&states, 0, sizeof(states));
        for (; argc; argc--, argv++) {
-               struct transport *transport;
-               const struct ref *ref;
                struct strbuf buf;
-               int i, got_states;
-
-               states.remote = remote_get(*argv);
-               if (!states.remote)
-                       return error("No such remote: %s", *argv);
-               transport = transport_get(NULL, states.remote->url_nr > 0 ?
-                       states.remote->url[0] : NULL);
-               ref = transport_get_remote_refs(transport);
-               transport_disconnect(transport);
-
-               read_branches();
-               got_states = get_ref_states(ref, &states);
-               if (got_states)
-                       result = error("Error getting local info for '%s'",
-                                       states.remote->name);
+               int i;
 
-               if (prune) {
-                       for (i = 0; i < states.stale.nr; i++) {
-                               const char *refname = states.stale.items[i].util;
-                               result |= delete_ref(refname, NULL);
-                       }
-                       goto cleanup_states;
-               }
+               get_remote_ref_states(*argv, &states, !no_query);
 
                printf("* remote %s\n  URL: %s\n", *argv,
                        states.remote->url_nr > 0 ?
@@ -486,17 +502,19 @@ static int show_or_prune(int argc, const char **argv, int prune)
                        printf("\n");
                }
 
-               if (got_states)
-                       continue;
-               strbuf_init(&buf, 0);
-               strbuf_addf(&buf, "  New remote branch%%s (next fetch will "
-                       "store in remotes/%s)", states.remote->name);
-               show_list(buf.buf, &states.new);
-               strbuf_release(&buf);
-               show_list("  Stale tracking branch%s (use 'git remote prune')",
-                               &states.stale);
-               show_list("  Tracked remote branch%s",
-                               &states.tracked);
+               if (!no_query) {
+                       strbuf_init(&buf, 0);
+                       strbuf_addf(&buf, "  New remote branch%%s (next fetch "
+                               "will store in remotes/%s)", states.remote->name);
+                       show_list(buf.buf, &states.new);
+                       strbuf_release(&buf);
+                       show_list("  Stale tracking branch%s (use 'git remote "
+                               "prune')", &states.stale);
+               }
+
+               if (no_query)
+                       for_each_ref(append_ref_to_tracked_list, &states);
+               show_list("  Tracked remote branch%s", &states.tracked);
 
                if (states.remote->push_refspec_nr) {
                        printf("  Local branch%s pushed with 'git push'\n   ",
@@ -511,7 +529,55 @@ static int show_or_prune(int argc, const char **argv, int prune)
                        }
                        printf("\n");
                }
-cleanup_states:
+
+               /* NEEDSWORK: free remote */
+               path_list_clear(&states.new, 0);
+               path_list_clear(&states.stale, 0);
+               path_list_clear(&states.tracked, 0);
+       }
+
+       return result;
+}
+
+static int prune(int argc, const char **argv)
+{
+       int dry_run = 0, result = 0;
+       struct option options[] = {
+               OPT_GROUP("prune specific options"),
+               OPT__DRY_RUN(&dry_run),
+               OPT_END()
+       };
+       struct ref_states states;
+
+       argc = parse_options(argc, argv, options, builtin_remote_usage, 0);
+
+       if (argc < 1)
+               usage_with_options(builtin_remote_usage, options);
+
+       memset(&states, 0, sizeof(states));
+       for (; argc; argc--, argv++) {
+               int i;
+
+               get_remote_ref_states(*argv, &states, 1);
+
+               if (states.stale.nr) {
+                       printf("Pruning %s\n", *argv);
+                       printf("URL: %s\n",
+                              states.remote->url_nr
+                              ? states.remote->url[0]
+                              : "(no URL)");
+               }
+
+               for (i = 0; i < states.stale.nr; i++) {
+                       const char *refname = states.stale.items[i].util;
+
+                       if (!dry_run)
+                               result |= delete_ref(refname, NULL);
+
+                       printf(" * [%s] %s\n", dry_run ? "would prune" : "pruned",
+                              skip_prefix(refname, "refs/remotes/"));
+               }
+
                /* NEEDSWORK: free remote */
                path_list_clear(&states.new, 0);
                path_list_clear(&states.stale, 0);
@@ -632,9 +698,9 @@ int cmd_remote(int argc, const char **argv, const char *prefix)
        else if (!strcmp(argv[0], "rm"))
                result = rm(argc, argv);
        else if (!strcmp(argv[0], "show"))
-               result = show_or_prune(argc, argv, 0);
+               result = show(argc, argv);
        else if (!strcmp(argv[0], "prune"))
-               result = show_or_prune(argc, argv, 1);
+               result = prune(argc, argv);
        else if (!strcmp(argv[0], "update"))
                result = update(argc, argv);
        else {
index 5c811423cc1234d933cff013f9923b45f19dc6fa..85222d9bc591e0b603bf6f33c32d6bb1bad479ee 100644 (file)
@@ -43,7 +43,7 @@ static void read_rr(struct path_list *rr)
                        ; /* do nothing */
                if (i == sizeof(buf))
                        die("filename too long");
-               path_list_insert(buf, rr)->util = xstrdup(name);
+               path_list_insert(buf, rr)->util = name;
        }
        fclose(in);
 }
index 93c127196d272d99d8af24a5fbc7ac89efdbb3d4..d90d11d2e35c38baab32f05f58125aaf1baee6cc 100644 (file)
@@ -4,14 +4,14 @@
 #include "parse-options.h"
 
 static const char * const git_update_ref_usage[] = {
-       "git-update-ref [options] -d <refname> <oldval>",
+       "git-update-ref [options] -d <refname> [<oldval>]",
        "git-update-ref [options]    <refname> <newval> [<oldval>]",
        NULL
 };
 
 int cmd_update_ref(int argc, const char **argv, const char *prefix)
 {
-       const char *refname, *value, *oldval, *msg=NULL;
+       const char *refname, *oldval, *msg=NULL;
        unsigned char sha1[20], oldsha1[20];
        int delete = 0, no_deref = 0;
        struct option options[] = {
@@ -27,25 +27,29 @@ int cmd_update_ref(int argc, const char **argv, const char *prefix)
        if (msg && !*msg)
                die("Refusing to perform update with empty message.");
 
-       if (argc < 2 || argc > 3)
-               usage_with_options(git_update_ref_usage, options);
-       refname = argv[0];
-       value   = argv[1];
-       oldval  = argv[2];
-
-       if (get_sha1(value, sha1))
-               die("%s: not a valid SHA1", value);
-
        if (delete) {
-               if (oldval)
+               if (argc < 1 || argc > 2)
+                       usage_with_options(git_update_ref_usage, options);
+               refname = argv[0];
+               oldval = argv[1];
+       } else {
+               const char *value;
+               if (argc < 2 || argc > 3)
                        usage_with_options(git_update_ref_usage, options);
-               return delete_ref(refname, sha1);
+               refname = argv[0];
+               value = argv[1];
+               oldval = argv[2];
+               if (get_sha1(value, sha1))
+                       die("%s: not a valid SHA1", value);
        }
 
-       hashclr(oldsha1);
+       hashclr(oldsha1); /* all-zero hash in case oldval is the empty string */
        if (oldval && *oldval && get_sha1(oldval, oldsha1))
                die("%s: not a valid old SHA1", oldval);
 
-       return update_ref(msg, refname, sha1, oldval ? oldsha1 : NULL,
-                         no_deref ? REF_NODEREF : 0, DIE_ON_ERR);
+       if (delete)
+               return delete_ref(refname, oldval ? oldsha1 : NULL);
+       else
+               return update_ref(msg, refname, sha1, oldval ? oldsha1 : NULL,
+                                 no_deref ? REF_NODEREF : 0, DIE_ON_ERR);
 }
diff --git a/cache.h b/cache.h
index 0a63c0eae60ea41025b153874e9dbbbb0523f6b7..81b7e17de26ae33249c60b101f5718cb5c5e5699 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -536,9 +536,6 @@ extern int force_object_loose(const unsigned char *sha1, time_t mtime);
 
 extern int check_sha1_signature(const unsigned char *sha1, void *buf, unsigned long size, const char *type);
 
-extern int write_sha1_from_fd(const unsigned char *sha1, int fd, char *buffer,
-                             size_t bufsize, size_t *bufposn);
-extern int write_sha1_to_fd(int fd, const unsigned char *sha1);
 extern int move_temp_to_file(const char *tmpfile, const char *filename);
 
 extern int has_sha1_pack(const unsigned char *sha1, const char **ignore);
@@ -697,8 +694,6 @@ extern struct ref **get_remote_heads(int in, struct ref **list, int nr_match, ch
 extern int server_supports(const char *feature);
 
 extern struct packed_git *parse_pack_index(unsigned char *sha1);
-extern struct packed_git *parse_pack_index_file(const unsigned char *sha1,
-                                               const char *idx_path);
 
 extern void prepare_packed_git(void);
 extern void reprepare_packed_git(void);
index 94d5b3d2618d335585084170ef6a3a8e67f34c62..e2d8624d9c19adde87ae521361f4ccd8260c06a0 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -243,7 +243,6 @@ int parse_commit_buffer(struct commit *item, void *buffer, unsigned long size)
        unsigned char parent[20];
        struct commit_list **pptr;
        struct commit_graft *graft;
-       unsigned n_refs = 0;
 
        if (item->object.parsed)
                return 0;
@@ -255,8 +254,6 @@ int parse_commit_buffer(struct commit *item, void *buffer, unsigned long size)
                return error("bad tree pointer in commit %s",
                             sha1_to_hex(item->object.sha1));
        item->tree = lookup_tree(parent);
-       if (item->tree)
-               n_refs++;
        bufptr += 46; /* "tree " + "hex sha1" + "\n" */
        pptr = &item->parents;
 
@@ -272,10 +269,8 @@ int parse_commit_buffer(struct commit *item, void *buffer, unsigned long size)
                if (graft)
                        continue;
                new_parent = lookup_commit(parent);
-               if (new_parent) {
+               if (new_parent)
                        pptr = &commit_list_insert(new_parent, pptr)->next;
-                       n_refs++;
-               }
        }
        if (graft) {
                int i;
@@ -285,7 +280,6 @@ int parse_commit_buffer(struct commit *item, void *buffer, unsigned long size)
                        if (!new_parent)
                                continue;
                        pptr = &commit_list_insert(new_parent, pptr)->next;
-                       n_refs++;
                }
        }
        item->date = parse_commit_date(bufptr, tail);
index 82584e91532264790bac7efd953f9f5da09576c1..7c2856efc92ca55e3cf03fcf1c72ffb70318f7c3 100644 (file)
@@ -158,7 +158,7 @@ AC_CHECK_LIB([crypto], [SHA1_Init],
 AC_SUBST(NEEDS_SSL_WITH_CRYPTO)
 AC_SUBST(NO_OPENSSL)
 #
-# Define NO_CURL if you do not have curl installed.  git-http-pull and
+# Define NO_CURL if you do not have libcurl installed.  git-http-pull and
 # git-http-push are not built, and you cannot use http:// and https://
 # transports.
 AC_CHECK_LIB([curl], [curl_global_init],
index 16984632d984006e2f2867a26714086bf3045ca3..ebf7cde5c023c86ee7ed0751730e09d1245930da 100755 (executable)
@@ -500,7 +500,10 @@ _git_add ()
        local cur="${COMP_WORDS[COMP_CWORD]}"
        case "$cur" in
        --*)
-               __gitcomp "--interactive --refresh"
+               __gitcomp "
+                       --interactive --refresh --patch --update --dry-run
+                       --ignore-errors
+                       "
                return
        esac
        COMPREPLY=()
@@ -758,6 +761,10 @@ _git_log ()
                        --pretty= --name-status --name-only --raw
                        --not --all
                        --left-right --cherry-pick
+                       --graph
+                       --stat --numstat --shortstat
+                       --decorate --diff-filter=
+                       --color-words --walk-reflogs
                        "
                return
                ;;
diff --git a/contrib/thunderbird-patch-inline/README b/contrib/thunderbird-patch-inline/README
new file mode 100644 (file)
index 0000000..39f96aa
--- /dev/null
@@ -0,0 +1,20 @@
+appp.sh is a script that is supposed to be used together with ExternalEditor
+for Mozilla Thundebird. It will let you include patches inline in e-mails
+in an easy way.
+
+Usage:
+- Generate the patch with git format-patch.
+- Start writing a new e-mail in Thunderbird.
+- Press the external editor button (or Ctrl-E) to run appp.sh
+- Select the previosly generated patch file.
+- Finish editing the e-mail.
+
+Any text that is entered into the message editor before appp.sh is called
+will be moved to the section between the --- and the diffstat.
+
+All S-O-B:s and Cc:s in the patch will be added to the CC list.
+
+To set it up, just install External Editor and tell it to use appp.sh as the
+editor.
+
+Zenity is a required dependency.
diff --git a/contrib/thunderbird-patch-inline/appp.sh b/contrib/thunderbird-patch-inline/appp.sh
new file mode 100755 (executable)
index 0000000..cc518f3
--- /dev/null
@@ -0,0 +1,55 @@
+#!/bin/bash
+# Copyright 2008 Lukas Sandström <luksan@gmail.com>
+#
+# AppendPatch - A script to be used together with ExternalEditor
+# for Mozilla Thunderbird to properly include pathes inline i e-mails.
+
+# ExternalEditor can be downloaded at http://globs.org/articles.php?lng=en&pg=2
+
+CONFFILE=~/.appprc
+
+SEP="-=-=-=-=-=-=-=-=-=# Don't remove this line #=-=-=-=-=-=-=-=-=-"
+if [ -e "$CONFFILE" ] ; then
+       LAST_DIR=`grep -m 1 "^LAST_DIR=" "${CONFFILE}"|sed -e 's/^LAST_DIR=//'`
+       cd "${LAST_DIR}"
+else
+       cd > /dev/null
+fi
+
+PATCH=$(zenity --file-selection)
+
+if [ "$?" != "0" ] ; then
+       #zenity --error --text "No patchfile given."
+       exit 1
+fi
+
+cd - > /dev/null
+
+SUBJECT=`sed -n -e '/^Subject: /p' "${PATCH}"`
+HEADERS=`sed -e '/^'"${SEP}"'$/,$d' $1`
+BODY=`sed -e "1,/${SEP}/d" $1`
+CMT_MSG=`sed -e '1,/^$/d' -e '/^---$/,$d' "${PATCH}"`
+DIFF=`sed -e '1,/^---$/d' "${PATCH}"`
+
+CCS=`echo -e "$CMT_MSG\n$HEADERS" | sed -n -e 's/^Cc: \(.*\)$/\1,/gp' \
+       -e 's/^Signed-off-by: \(.*\)/\1,/gp'`
+
+echo "$SUBJECT" > $1
+echo "Cc: $CCS" >> $1
+echo "$HEADERS" | sed -e '/^Subject: /d' -e '/^Cc: /d' >> $1
+echo "$SEP" >> $1
+
+echo "$CMT_MSG" >> $1
+echo "---" >> $1
+if [ "x${BODY}x" != "xx" ] ; then
+       echo >> $1
+       echo "$BODY" >> $1
+       echo >> $1
+fi
+echo "$DIFF" >> $1
+
+LAST_DIR=`dirname "${PATCH}"`
+
+grep -v "^LAST_DIR=" "${CONFFILE}" > "${CONFFILE}_"
+echo "LAST_DIR=${LAST_DIR}" >> "${CONFFILE}_"
+mv "${CONFFILE}_" "${CONFFILE}"
diff --git a/date.c b/date.c
index a74ed86422763e7d7e5dccf73530e52551a6929a..1a4eb87b01d5dab0c4a0c455bbef3fda132415ee 100644 (file)
--- a/date.c
+++ b/date.c
@@ -682,10 +682,8 @@ static void date_am(struct tm *tm, int *num)
 
 static void date_never(struct tm *tm, int *num)
 {
-       tm->tm_mon = tm->tm_wday = tm->tm_yday
-               = tm->tm_hour = tm->tm_min = tm->tm_sec = 0;
-       tm->tm_year = 70;
-       tm->tm_mday = 1;
+       time_t n = 0;
+       localtime_r(&n, tm);
 }
 
 static const struct special {
diff --git a/diff.c b/diff.c
index 62fdc5492bbe5dacab6bc5b615a76ba5cd9de760..526249008662d4041e5623914c1a420f3443c4d4 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -514,9 +514,15 @@ const char *diff_get_color(int diff_use_color, enum color_diff ix)
 
 static void emit_line(FILE *file, const char *set, const char *reset, const char *line, int len)
 {
+       int has_trailing_newline = (len > 0 && line[len-1] == '\n');
+       if (has_trailing_newline)
+               len--;
+
        fputs(set, file);
        fwrite(line, len, 1, file);
        fputs(reset, file);
+       if (has_trailing_newline)
+               fputc('\n', file);
 }
 
 static void emit_add_line(const char *reset, struct emit_callback *ecbdata, const char *line, int len)
index b48096ec2037e3f14d4bdf89a0afe4623aff090e..2c517ede590c5c3274b03d1c980f9a847cc7d643 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
@@ -421,7 +421,7 @@ do
        else
            action=yes
        fi
-       FIRSTLINE=$(head -1 "$dotest/final-commit")
+       FIRSTLINE=$(sed 1q "$dotest/final-commit")
 
        if test $action = skip
        then
index 01c4045e89a2e156062255193ed5d865fdf8a922..c04e8baa87f263b426de17556f63351ae254ae95 100644 (file)
@@ -39,7 +39,7 @@
 /* Approximation of the length of the decimal representation of this type. */
 #define decimal_length(x)      ((int)(sizeof(x) * 2.56 + 0.5) + 1)
 
-#if !defined(__APPLE__) && !defined(__FreeBSD__)
+#if !defined(__APPLE__) && !defined(__FreeBSD__)  && !defined(__USLC__) && !defined(_M_UNIX)
 #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
 #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
 #endif
index 5a0255052c9360fdc4cbbdd79008a206ab3e4623..cacbfc0259fd1ae353117d93e345cd8c4dd41188 100755 (executable)
@@ -227,6 +227,7 @@ sub conn {
                                $proxyport = $1;
                        }
                }
+               $repo ||= '/';
 
                # if username is not explicit in CVSROOT, then use current user, as cvs would
                $user=(getlogin() || $ENV{'LOGNAME'} || $ENV{'USER'} || "anonymous") unless $user;
index 6f91c8f845b2c4ef426a6451ac07abae2bce9488..af0fde538cefe8531031629cf78847da5eac4fa5 100755 (executable)
@@ -22,10 +22,10 @@ restart        restart the web server
 . git-sh-setup
 
 fqgitdir="$GIT_DIR"
-local="`git config --bool --get instaweb.local`"
-httpd="`git config --get instaweb.httpd`"
-port=`git config --get instaweb.port`
-module_path="`git config --get instaweb.modulepath`"
+local="$(git config --bool --get instaweb.local)"
+httpd="$(git config --get instaweb.httpd)"
+port=$(git config --get instaweb.port)
+module_path="$(git config --get instaweb.modulepath)"
 
 conf="$GIT_DIR/gitweb/httpd.conf"
 
@@ -37,11 +37,21 @@ test -z "$httpd" && httpd='lighttpd -f'
 # any untaken local port will do...
 test -z "$port" && port=1234
 
-start_httpd () {
-       httpd_only="`echo $httpd | cut -f1 -d' '`"
+resolve_full_httpd () {
+       case "$httpd" in
+       *apache2*|*lighttpd*)
+               # ensure that the apache2/lighttpd command ends with "-f"
+               if ! echo "$httpd" | grep -- '-f *$' >/dev/null 2>&1
+               then
+                       httpd="$httpd -f"
+               fi
+               ;;
+       esac
+
+       httpd_only="$(echo $httpd | cut -f1 -d' ')"
        if case "$httpd_only" in /*) : ;; *) which $httpd_only >/dev/null;; esac
        then
-               $httpd "$fqgitdir/gitweb/httpd.conf"
+               full_httpd=$httpd
        else
                # many httpds are installed in /usr/sbin or /usr/local/sbin
                # these days and those are not in most users $PATHs
@@ -51,16 +61,23 @@ start_httpd () {
                do
                        if test -x "$i/$httpd_only"
                        then
-                               # don't quote $httpd, there can be
-                               # arguments to it (-f)
-                               $i/$httpd "$fqgitdir/gitweb/httpd.conf"
+                               full_httpd=$i/$httpd
                                return
                        fi
                done
-               echo "$httpd_only not found. Install $httpd_only or use" \
-                    "--httpd to specify another http daemon."
+
+               echo >&2 "$httpd_only not found. Install $httpd_only or use" \
+                    "--httpd to specify another httpd daemon."
                exit 1
        fi
+}
+
+start_httpd () {
+       # here $httpd should have a meaningful value
+       resolve_full_httpd
+
+       # don't quote $full_httpd, there can be arguments to it (-f)
+       $full_httpd "$fqgitdir/gitweb/httpd.conf"
        if test $? != 0; then
                echo "Could not execute http daemon $httpd."
                exit 1
@@ -68,7 +85,7 @@ start_httpd () {
 }
 
 stop_httpd () {
-       test -f "$fqgitdir/pid" && kill `cat "$fqgitdir/pid"`
+       test -f "$fqgitdir/pid" && kill $(cat "$fqgitdir/pid")
 }
 
 while test $# != 0
@@ -116,7 +133,7 @@ do
 done
 
 mkdir -p "$GIT_DIR/gitweb/tmp"
-GIT_EXEC_PATH="`git --exec-path`"
+GIT_EXEC_PATH="$(git --exec-path)"
 GIT_DIR="$fqgitdir"
 export GIT_EXEC_PATH GIT_DIR
 
@@ -215,7 +232,8 @@ PerlPassEnv GIT_EXEC_DIR
 EOF
        else
                # plain-old CGI
-               list_mods=`echo "$httpd" | sed "s/-f$/-l/"`
+               resolve_full_httpd
+               list_mods=$(echo "$full_httpd" | sed "s/-f$/-l/")
                $list_mods | grep 'mod_cgi\.c' >/dev/null 2>&1 || \
                echo "LoadModule cgi_module $module_path/mod_cgi.so" >> "$conf"
                cat >> "$conf" <<EOF
index 5fc5f5201f8ea8e155a25795b93bfea86fc12d12..8026ccff4a459a75148740382646f7fe10b00255 100755 (executable)
@@ -13,7 +13,7 @@ n                    don't show a diffstat at the end of the merge
 summary              (synonym to --stat)
 log                  add list of one-line log to merge commit message
 squash               create a single commit instead of doing a merge
-commit               perform a commit if the merge sucesses (default)
+commit               perform a commit if the merge succeeds (default)
 ff                   allow fast forward (default)
 s,strategy=          merge strategy to use
 m,message=           message to be used for the merge commit (if any)
index 0ca986f7213280bef067f7a0ee53d1a154f1803d..a64d9d57ab5943ac4e065866ce0ccd7de5364a9a 100755 (executable)
@@ -530,9 +530,9 @@ do
 # Rebase $SHORTUPSTREAM..$SHORTHEAD onto $SHORTONTO
 #
 # Commands:
-#  pick = use commit
-#  edit = use commit, but stop for amending
-#  squash = use commit, but meld into previous commit
+#  p, pick = use commit
+#  e, edit = use commit, but stop for amending
+#  s, squash = use commit, but meld into previous commit
 #
 # If you remove a line here THAT COMMIT WILL BE LOST.
 # However, if you remove everything, the rebase will be aborted.
index a598fdc890c817875766c29aa714d622af770f4b..0b04ba32f0399d338be587ac2d9ad4620705c9a1 100755 (executable)
@@ -209,6 +209,7 @@ sub format_2822_time {
     "bcc" => \@bcclist,
     "aliasesfile" => \@alias_files,
     "suppresscc" => \@suppress_cc,
+    "envelopesender" => \$envelope_sender,
 );
 
 # Handle Uncouth Termination
@@ -441,7 +442,7 @@ sub read_config {
        }
 
        my $to = $_;
-       push @to, split /,/, $to;
+       push @to, split /,\s*/, $to;
        $prompting++;
 }
 
index 100737210de3c76682ab3803626a36328fb27ca1..3eb78cc724187998aa9ecf71509325631b8668c9 100755 (executable)
@@ -45,8 +45,8 @@ resolve_relative_url ()
        branch="$(git symbolic-ref HEAD 2>/dev/null)"
        remote="$(git config branch.${branch#refs/heads/}.remote)"
        remote="${remote:-origin}"
-       remoteurl="$(git config remote.$remote.url)" ||
-               die "remote ($remote) does not have a url in .git/config"
+       remoteurl=$(git config "remote.$remote.url") ||
+               die "remote ($remote) does not have a url defined in .git/config"
        url="$1"
        while test -n "$url"
        do
@@ -73,7 +73,7 @@ resolve_relative_url ()
 module_name()
 {
        # Do we have "submodule.<something>.path = $1" defined in .gitmodules file?
-       re=$(printf '%s' "$1" | sed -e 's/[].[^$\\*]/\\&/g')
+       re=$(printf '%s\n' "$1" | sed -e 's/[].[^$\\*]/\\&/g')
        name=$( git config -f .gitmodules --get-regexp '^submodule\..*\.path$' |
                sed -n -e 's|^submodule\.\(.*\)\.path '"$re"'$|\1|p' )
        test -z "$name" &&
@@ -178,7 +178,8 @@ cmd_add()
                case "$repo" in
                ./*|../*)
                        # dereference source url relative to parent's url
-                       realrepo="$(resolve_relative_url $repo)" ;;
+                       realrepo=$(resolve_relative_url "$repo") || exit
+                       ;;
                *)
                        # Turn the source into an absolute path if
                        # it is local
@@ -246,7 +247,7 @@ cmd_init()
                # Possibly a url relative to parent
                case "$url" in
                ./*|../*)
-                       url="$(resolve_relative_url "$url")"
+                       url=$(resolve_relative_url "$url") || exit
                        ;;
                esac
 
index 47b0c37d17101e17e34fab8ed04c3409fe106e87..a54979dc51f0fc392b357da9071b6ea19aac4798 100755 (executable)
@@ -1023,6 +1023,7 @@ sub get_commit_entry {
                my $in_msg = 0;
                my $author;
                my $saw_from = 0;
+               my $msgbuf = "";
                while (<$msg_fh>) {
                        if (!$in_msg) {
                                $in_msg = 1 if (/^\s*$/);
@@ -1035,14 +1036,15 @@ sub get_commit_entry {
                                if (/^From:/ || /^Signed-off-by:/) {
                                        $saw_from = 1;
                                }
-                               print $log_fh $_ or croak $!;
+                               $msgbuf .= $_;
                        }
                }
+               $msgbuf =~ s/\s+$//s;
                if ($Git::SVN::_add_author_from && defined($author)
                    && !$saw_from) {
-                       print $log_fh "\nFrom: $author\n"
-                             or croak $!;
+                       $msgbuf .= "\n\nFrom: $author";
                }
+               print $log_fh $msgbuf or croak $!;
                command_close_pipe($msg_fh, $ctx);
        }
        close $log_fh or croak $!;
diff --git a/git.c b/git.c
index 15a0e71cc1f5d7ad032a2b0591e526f9b0ca8b0b..59f0fcc1f2278d3234a7e4a306db56c7cfcde9a2 100644 (file)
--- a/git.c
+++ b/git.c
@@ -286,7 +286,7 @@ static void handle_internal_command(int argc, const char **argv)
                { "checkout-index", cmd_checkout_index,
                        RUN_SETUP | NEED_WORK_TREE},
                { "check-ref-format", cmd_check_ref_format },
-               { "check-attr", cmd_check_attr, RUN_SETUP | NEED_WORK_TREE },
+               { "check-attr", cmd_check_attr, RUN_SETUP },
                { "cherry", cmd_cherry, RUN_SETUP },
                { "cherry-pick", cmd_cherry_pick, RUN_SETUP | NEED_WORK_TREE },
                { "clone", cmd_clone },
index 97a26be29a5e6e64ca33760ba0010693e0fa07f9..3d7f3ef4afeccefd56330342715cb89e73b94775 100644 (file)
@@ -12,7 +12,7 @@ BuildRequires:        zlib-devel >= 1.2, openssl-devel, curl-devel, expat-devel, gettex
 BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 Requires:      perl-Git = %{version}-%{release}
-Requires:      zlib >= 1.2, rsync, curl, less, openssh-clients, expat
+Requires:      zlib >= 1.2, rsync, less, openssh-clients, expat
 Provides:      git-core = %{version}-%{release}
 Obsoletes:     git-core <= 1.5.4.2
 Obsoletes:     git-p4
@@ -187,6 +187,9 @@ rm -rf $RPM_BUILD_ROOT
 # No files for you!
 
 %changelog
+* Sun Jun 15 2008 Junio C Hamano <gitster@pobox.com>
+- Remove curl from Requires list.
+
 * Fri Feb 15 2008 Kristian Høgsberg <krh@redhat.com>
 - Rename git-core to just git and rename meta package from git to git-all.
 
index 22bcd18a4671b3bdd78f065c65bdaf042ba4a77e..fddcb45817ed6839ba95965d7e57e9a2e04ae30a 100644 (file)
@@ -296,7 +296,7 @@ proc start_rev_list {view} {
     global startmsecs commitidx viewcomplete curview
     global commfd leftover tclencoding
     global viewargs viewargscmd viewfiles vfilelimit
-    global showlocalchanges commitinterest mainheadid
+    global showlocalchanges commitinterest
     global viewactive loginstance viewinstances vmergeonly
     global pending_select mainheadid
     global vcanopt vflags vrevs vorigargs
@@ -358,7 +358,7 @@ proc start_rev_list {view} {
     set viewinstances($view) [list $i]
     set commfd($i) $fd
     set leftover($i) {}
-    if {$showlocalchanges} {
+    if {$showlocalchanges && $mainheadid ne {}} {
        lappend commitinterest($mainheadid) {dodiffindex}
     }
     fconfigure $fd -blocking 0 -translation lf -eofchar {}
@@ -406,7 +406,7 @@ proc getcommits {} {
 
 proc updatecommits {} {
     global curview vcanopt vorigargs vfilelimit viewinstances
-    global viewactive viewcomplete loginstance tclencoding mainheadid
+    global viewactive viewcomplete loginstance tclencoding
     global startmsecs commfd showneartags showlocalchanges leftover
     global mainheadid pending_select
     global isworktree
@@ -1467,7 +1467,6 @@ proc chewcommits {} {
     if {$viewcomplete($curview)} {
        global commitidx varctok
        global numcommits startmsecs
-       global mainheadid nullid
 
        if {[info exists pending_select]} {
            set row [first_real_row]
@@ -1604,12 +1603,10 @@ proc readrefs {} {
     set mainhead {}
     set mainheadid {}
     catch {
+       set mainheadid [exec git rev-parse HEAD]
        set thehead [exec git symbolic-ref HEAD]
        if {[string match "refs/heads/*" $thehead]} {
            set mainhead [string range $thehead 11 end]
-           if {[info exists headids($mainhead)]} {
-               set mainheadid $headids($mainhead)
-           }
        }
     }
 }
@@ -4022,6 +4019,7 @@ proc layoutmore {} {
 proc doshowlocalchanges {} {
     global curview mainheadid
 
+    if {$mainheadid eq {}} return
     if {[commitinview $mainheadid $curview]} {
        dodiffindex
     } else {
@@ -4841,7 +4839,8 @@ proc drawcmittext {id row col} {
     global cmitlisted commitinfo rowidlist parentlist
     global rowtextx idpos idtags idheads idotherrefs
     global linehtag linentag linedtag selectedline
-    global canvxmax boldrows boldnamerows fgcolor nullid nullid2
+    global canvxmax boldrows boldnamerows fgcolor
+    global mainheadid nullid nullid2 circleitem circlecolors
 
     # listed is 0 for boundary, 1 for normal, 2 for negative, 3 for left, 4 for right
     set listed $cmitlisted($curview,$id)
@@ -4849,8 +4848,10 @@ proc drawcmittext {id row col} {
        set ofill red
     } elseif {$id eq $nullid2} {
        set ofill green
+    } elseif {$id eq $mainheadid} {
+       set ofill yellow
     } else {
-       set ofill [expr {$listed != 0 ? $listed == 2 ? "gray" : "blue" : "white"}]
+       set ofill [lindex $circlecolors $listed]
     }
     set x [xc $row $col]
     set y [yc $row]
@@ -4874,6 +4875,7 @@ proc drawcmittext {id row col} {
                   [expr {$x - $orad}] [expr {$y + $orad - 1}] \
                   -fill $ofill -outline $fgcolor -width 1 -tags circle]
     }
+    set circleitem($row) $t
     $canv raise $t
     $canv bind $t <1> {selcanvline {} %x %y}
     set rmx [llength [lindex $rowidlist $row]]
@@ -7399,12 +7401,18 @@ proc domktag {} {
 }
 
 proc redrawtags {id} {
-    global canv linehtag idpos currentid curview
-    global canvxmax iddrawn
+    global canv linehtag idpos currentid curview cmitlisted
+    global canvxmax iddrawn circleitem mainheadid circlecolors
 
     if {![commitinview $id $curview]} return
     if {![info exists iddrawn($id)]} return
     set row [rowofcommit $id]
+    if {$id eq $mainheadid} {
+       set ofill yellow
+    } else {
+       set ofill [lindex $circlecolors $cmitlisted($curview,$id)]
+    }
+    $canv itemconf $circleitem($row) -fill $ofill
     $canv delete tag.$id
     set xt [eval drawtags $id $idpos($id)]
     $canv coords $linehtag($row) $xt [lindex $idpos($id) 2]
@@ -7574,8 +7582,8 @@ proc cherrypick {} {
        if {$mainhead ne {}} {
            movehead $newhead $mainhead
            movedhead $newhead $mainhead
-           set mainheadid $newhead
        }
+       set mainheadid $newhead
        redrawtags $oldhead
        redrawtags $newhead
        selbyid $newhead
@@ -7675,7 +7683,7 @@ proc headmenu {x y id head} {
 }
 
 proc cobranch {} {
-    global headmenuid headmenuhead mainhead headids
+    global headmenuid headmenuhead headids
     global showlocalchanges mainheadid
 
     # check the tree is clean first??
@@ -7711,12 +7719,10 @@ proc readcheckoutstat {fd newhead newheadid} {
     if {[catch {close $fd} err]} {
        error_popup $err
     }
-    set oldmainhead $mainhead
+    set oldmainid $mainheadid
     set mainhead $newhead
     set mainheadid $newheadid
-    if {[info exists headids($oldmainhead)]} {
-       redrawtags $headids($oldmainhead)
-    }
+    redrawtags $oldmainid
     redrawtags $newheadid
     selbyid $newheadid
     if {$showlocalchanges} {
@@ -9016,12 +9022,14 @@ proc rereadrefs {} {
                        [array names idheads] [array names idotherrefs]]]
     foreach id $refids {
        set v [listrefs $id]
-       if {![info exists ref($id)] || $ref($id) != $v ||
-           ($id eq $oldmainhead && $id ne $mainheadid) ||
-           ($id eq $mainheadid && $id ne $oldmainhead)} {
+       if {![info exists ref($id)] || $ref($id) != $v} {
            redrawtags $id
        }
     }
+    if {$oldmainhead ne $mainheadid} {
+       redrawtags $oldmainhead
+       redrawtags $mainheadid
+    }
     run refill_reflist
 }
 
@@ -9761,6 +9769,8 @@ set diffcontext 3
 set ignorespace 0
 set selectbgcolor gray85
 
+set circlecolors {white blue gray blue blue}
+
 ## For msgcat loading, first locate the installation location.
 if { [info exists ::env(GITK_MSGSDIR)] } {
     ## Msgsdir was manually set in the environment.
index 8f7ea367bae72ea3ce25b10b968554f9b842fffe..356ab7b327eb0df99c0773d68375e155dbcea0be 100644 (file)
@@ -255,12 +255,15 @@ Webserver configuration
 If you want to have one URL for both gitweb and your http://
 repositories, you can configure apache like this:
 
-<VirtualHost www:80>
-    ServerName git.domain.org
+<VirtualHost *:80>
+    ServerName git.example.org
     DocumentRoot /pub/git
-    RewriteEngine on
-    RewriteRule ^/(.*\.git/(?!/?(info|objects|refs)).*)?$ /cgi-bin/gitweb.cgi%{REQUEST_URI}  [L,PT]
     SetEnv     GITWEB_CONFIG   /etc/gitweb.conf
+    RewriteEngine on
+    # make the front page an internal rewrite to the gitweb script
+    RewriteRule ^/$  /cgi-bin/gitweb.cgi
+    # make access for "dumb clients" work
+    RewriteRule ^/(.*\.git/(?!/?(HEAD|info|objects|refs)).*)?$ /cgi-bin/gitweb.cgi%{REQUEST_URI}  [L,PT]
 </VirtualHost>
 
 The above configuration expects your public repositories to live under
@@ -276,6 +279,13 @@ override the defaults given at the head of the gitweb.perl (or
 gitweb.cgi).  Look at the comments in that file for information on
 which variables and what they mean.
 
+If you use the rewrite rules from the example you'll likely also need
+something like the following in your gitweb.conf (or gitweb_config.perl) file:
+
+  @stylesheets = ("/some/absolute/path/gitweb.css");
+  $my_uri = "/";
+  $home_link = "/";
+
 
 Originally written by:
   Kay Sievers <kay.sievers@vrfy.org>
index 198772c2104708bee899aa5f8ed9ec23267daae1..87887ab358298565bc14e3c5663f38b7250218fb 100755 (executable)
@@ -377,7 +377,7 @@ sub filter_snapshot_fmts {
 }
 
 # version of the core git binary
-our $git_version = qx($GIT --version) =~ m/git version (.*)$/ ? $1 : "unknown";
+our $git_version = qx("$GIT" --version) =~ m/git version (.*)$/ ? $1 : "unknown";
 
 $projects_list ||= $projectroot;
 
@@ -539,7 +539,7 @@ sub evaluate_path_info {
 
 # dispatch
 my %actions = (
-       "blame" => \&git_blame2,
+       "blame" => \&git_blame,
        "blobdiff" => \&git_blobdiff,
        "blobdiff_plain" => \&git_blobdiff_plain,
        "blob" => \&git_blob,
@@ -1500,9 +1500,13 @@ sub git_cmd {
        return $GIT, '--git-dir='.$git_dir;
 }
 
-# returns path to the core git executable and the --git-dir parameter as string
-sub git_cmd_str {
-       return join(' ', git_cmd());
+# quote the given arguments for passing them to the shell
+# quote_command("command", "arg 1", "arg with ' and ! characters")
+# => "'command' 'arg 1' 'arg with '\'' and '\!' characters'"
+# Try to avoid using this function wherever possible.
+sub quote_command {
+       return join(' ',
+                   map( { my $a = $_; $a =~ s/(['!])/'\\$1'/g; "'$a'" } @_ ));
 }
 
 # get HEAD ref of given project as hash
@@ -2158,49 +2162,6 @@ sub parse_commits {
        return wantarray ? @cos : \@cos;
 }
 
-# parse ref from ref_file, given by ref_id, with given type
-sub parse_ref {
-       my $ref_file = shift;
-       my $ref_id = shift;
-       my $type = shift || git_get_type($ref_id);
-       my %ref_item;
-
-       $ref_item{'type'} = $type;
-       $ref_item{'id'} = $ref_id;
-       $ref_item{'epoch'} = 0;
-       $ref_item{'age'} = "unknown";
-       if ($type eq "tag") {
-               my %tag = parse_tag($ref_id);
-               $ref_item{'comment'} = $tag{'comment'};
-               if ($tag{'type'} eq "commit") {
-                       my %co = parse_commit($tag{'object'});
-                       $ref_item{'epoch'} = $co{'committer_epoch'};
-                       $ref_item{'age'} = $co{'age_string'};
-               } elsif (defined($tag{'epoch'})) {
-                       my $age = time - $tag{'epoch'};
-                       $ref_item{'epoch'} = $tag{'epoch'};
-                       $ref_item{'age'} = age_string($age);
-               }
-               $ref_item{'reftype'} = $tag{'type'};
-               $ref_item{'name'} = $tag{'name'};
-               $ref_item{'refid'} = $tag{'object'};
-       } elsif ($type eq "commit"){
-               my %co = parse_commit($ref_id);
-               $ref_item{'reftype'} = "commit";
-               $ref_item{'name'} = $ref_file;
-               $ref_item{'title'} = $co{'title'};
-               $ref_item{'refid'} = $ref_id;
-               $ref_item{'epoch'} = $co{'committer_epoch'};
-               $ref_item{'age'} = $co{'age_string'};
-       } else {
-               $ref_item{'reftype'} = $type;
-               $ref_item{'name'} = $ref_file;
-               $ref_item{'refid'} = $ref_id;
-       }
-
-       return %ref_item;
-}
-
 # parse line of git-diff-tree "raw" output
 sub parse_difftree_raw_line {
        my $line = shift;
@@ -3559,21 +3520,24 @@ sub git_patchset_body {
 
 # . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
 
-sub git_project_list_body {
-       my ($projlist, $order, $from, $to, $extra, $no_header) = @_;
-
-       my ($check_forks) = gitweb_check_feature('forks');
-
+# fills project list info (age, description, owner, forks) for each
+# project in the list, removing invalid projects from returned list
+# NOTE: modifies $projlist, but does not remove entries from it
+sub fill_project_list_info {
+       my ($projlist, $check_forks) = @_;
        my @projects;
+
+ PROJECT:
        foreach my $pr (@$projlist) {
-               my (@aa) = git_get_last_activity($pr->{'path'});
-               unless (@aa) {
-                       next;
+               my (@activity) = git_get_last_activity($pr->{'path'});
+               unless (@activity) {
+                       next PROJECT;
                }
-               ($pr->{'age'}, $pr->{'age_string'}) = @aa;
+               ($pr->{'age'}, $pr->{'age_string'}) = @activity;
                if (!defined $pr->{'descr'}) {
                        my $descr = git_get_project_description($pr->{'path'}) || "";
-                       $pr->{'descr_long'} = to_utf8($descr);
+                       $descr = to_utf8($descr);
+                       $pr->{'descr_long'} = $descr;
                        $pr->{'descr'} = chop_str($descr, $projects_list_description_width, 5);
                }
                if (!defined $pr->{'owner'}) {
@@ -3585,14 +3549,52 @@ sub git_project_list_body {
                            ($pname !~ /\/$/) &&
                            (-d "$projectroot/$pname")) {
                                $pr->{'forks'} = "-d $projectroot/$pname";
-                       }
-                       else {
+                       }       else {
                                $pr->{'forks'} = 0;
                        }
                }
                push @projects, $pr;
        }
 
+       return @projects;
+}
+
+# print 'sort by' <th> element, either sorting by $key if $name eq $order
+# (changing $list), or generating 'sort by $name' replay link otherwise
+sub print_sort_th {
+       my ($str_sort, $name, $order, $key, $header, $list) = @_;
+       $key    ||= $name;
+       $header ||= ucfirst($name);
+
+       if ($order eq $name) {
+               if ($str_sort) {
+                       @$list = sort {$a->{$key} cmp $b->{$key}} @$list;
+               } else {
+                       @$list = sort {$a->{$key} <=> $b->{$key}} @$list;
+               }
+               print "<th>$header</th>\n";
+       } else {
+               print "<th>" .
+                     $cgi->a({-href => href(-replay=>1, order=>$name),
+                              -class => "header"}, $header) .
+                     "</th>\n";
+       }
+}
+
+sub print_sort_th_str {
+       print_sort_th(1, @_);
+}
+
+sub print_sort_th_num {
+       print_sort_th(0, @_);
+}
+
+sub git_project_list_body {
+       my ($projlist, $order, $from, $to, $extra, $no_header) = @_;
+
+       my ($check_forks) = gitweb_check_feature('forks');
+       my @projects = fill_project_list_info($projlist, $check_forks);
+
        $order ||= $default_projects_order;
        $from = 0 unless defined $from;
        $to = $#projects if (!defined $to || $#projects < $to);
@@ -3603,43 +3605,15 @@ sub git_project_list_body {
                if ($check_forks) {
                        print "<th></th>\n";
                }
-               if ($order eq "project") {
-                       @projects = sort {$a->{'path'} cmp $b->{'path'}} @projects;
-                       print "<th>Project</th>\n";
-               } else {
-                       print "<th>" .
-                             $cgi->a({-href => href(project=>undef, order=>'project'),
-                                      -class => "header"}, "Project") .
-                             "</th>\n";
-               }
-               if ($order eq "descr") {
-                       @projects = sort {$a->{'descr'} cmp $b->{'descr'}} @projects;
-                       print "<th>Description</th>\n";
-               } else {
-                       print "<th>" .
-                             $cgi->a({-href => href(project=>undef, order=>'descr'),
-                                      -class => "header"}, "Description") .
-                             "</th>\n";
-               }
-               if ($order eq "owner") {
-                       @projects = sort {$a->{'owner'} cmp $b->{'owner'}} @projects;
-                       print "<th>Owner</th>\n";
-               } else {
-                       print "<th>" .
-                             $cgi->a({-href => href(project=>undef, order=>'owner'),
-                                      -class => "header"}, "Owner") .
-                             "</th>\n";
-               }
-               if ($order eq "age") {
-                       @projects = sort {$a->{'age'} <=> $b->{'age'}} @projects;
-                       print "<th>Last Change</th>\n";
-               } else {
-                       print "<th>" .
-                             $cgi->a({-href => href(project=>undef, order=>'age'),
-                                      -class => "header"}, "Last Change") .
-                             "</th>\n";
-               }
-               print "<th></th>\n" .
+               print_sort_th_str('project', $order, 'path',
+                                 'Project', \@projects);
+               print_sort_th_str('descr', $order, 'descr_long',
+                                 'Description', \@projects);
+               print_sort_th_str('owner', $order, 'owner',
+                                 'Owner', \@projects);
+               print_sort_th_num('age', $order, 'age',
+                                 'Last Change', \@projects);
+               print "<th></th>\n" . # for links
                      "</tr>\n";
        }
        my $alternate = 1;
@@ -4152,7 +4126,7 @@ sub git_tag {
        git_footer_html();
 }
 
-sub git_blame2 {
+sub git_blame {
        my $fd;
        my $ftype;
 
@@ -4260,103 +4234,6 @@ sub git_blame2 {
        git_footer_html();
 }
 
-sub git_blame {
-       my $fd;
-
-       my ($have_blame) = gitweb_check_feature('blame');
-       if (!$have_blame) {
-               die_error('403 Permission denied', "Permission denied");
-       }
-       die_error('404 Not Found', "File name not defined") if (!$file_name);
-       $hash_base ||= git_get_head_hash($project);
-       die_error(undef, "Couldn't find base commit") unless ($hash_base);
-       my %co = parse_commit($hash_base)
-               or die_error(undef, "Reading commit failed");
-       if (!defined $hash) {
-               $hash = git_get_hash_by_path($hash_base, $file_name, "blob")
-                       or die_error(undef, "Error lookup file");
-       }
-       open ($fd, "-|", git_cmd(), "annotate", '-l', '-t', '-r', $file_name, $hash_base)
-               or die_error(undef, "Open git-annotate failed");
-       git_header_html();
-       my $formats_nav =
-               $cgi->a({-href => href(action=>"blob", hash=>$hash, hash_base=>$hash_base, file_name=>$file_name)},
-                       "blob") .
-               " | " .
-               $cgi->a({-href => href(action=>"history", hash=>$hash, hash_base=>$hash_base, file_name=>$file_name)},
-                       "history") .
-               " | " .
-               $cgi->a({-href => href(action=>"blame", file_name=>$file_name)},
-                       "HEAD");
-       git_print_page_nav('','', $hash_base,$co{'tree'},$hash_base, $formats_nav);
-       git_print_header_div('commit', esc_html($co{'title'}), $hash_base);
-       git_print_page_path($file_name, 'blob', $hash_base);
-       print "<div class=\"page_body\">\n";
-       print <<HTML;
-<table class="blame">
-  <tr>
-    <th>Commit</th>
-    <th>Age</th>
-    <th>Author</th>
-    <th>Line</th>
-    <th>Data</th>
-  </tr>
-HTML
-       my @line_class = (qw(light dark));
-       my $line_class_len = scalar (@line_class);
-       my $line_class_num = $#line_class;
-       while (my $line = <$fd>) {
-               my $long_rev;
-               my $short_rev;
-               my $author;
-               my $time;
-               my $lineno;
-               my $data;
-               my $age;
-               my $age_str;
-               my $age_class;
-
-               chomp $line;
-               $line_class_num = ($line_class_num + 1) % $line_class_len;
-
-               if ($line =~ m/^([0-9a-fA-F]{40})\t\(\s*([^\t]+)\t(\d+) [+-]\d\d\d\d\t(\d+)\)(.*)$/) {
-                       $long_rev = $1;
-                       $author   = $2;
-                       $time     = $3;
-                       $lineno   = $4;
-                       $data     = $5;
-               } else {
-                       print qq(  <tr><td colspan="5" class="error">Unable to parse: $line</td></tr>\n);
-                       next;
-               }
-               $short_rev  = substr ($long_rev, 0, 8);
-               $age        = time () - $time;
-               $age_str    = age_string ($age);
-               $age_str    =~ s/ /&nbsp;/g;
-               $age_class  = age_class($age);
-               $author     = esc_html ($author);
-               $author     =~ s/ /&nbsp;/g;
-
-               $data = untabify($data);
-               $data = esc_html ($data);
-
-               print <<HTML;
-  <tr class="$line_class[$line_class_num]">
-    <td class="sha1"><a href="${\href (action=>"commit", hash=>$long_rev)}" class="text">$short_rev..</a></td>
-    <td class="$age_class">$age_str</td>
-    <td>$author</td>
-    <td class="linenr"><a id="$lineno" href="#$lineno" class="linenr">$lineno</a></td>
-    <td class="pre">$data</td>
-  </tr>
-HTML
-       } # while (my $line = <$fd>)
-       print "</table>\n\n";
-       close $fd
-               or print "Reading blob failed.\n";
-       print "</div>";
-       git_footer_html();
-}
-
 sub git_tags {
        my $head = git_get_head_hash($project);
        git_header_html();
@@ -4633,7 +4510,6 @@ sub git_snapshot {
                $hash = git_get_head_hash($project);
        }
 
-       my $git_command = git_cmd_str();
        my $name = $project;
        $name =~ s,([^/])/*\.git$,$1,;
        $name = basename($name);
@@ -4641,11 +4517,12 @@ sub git_snapshot {
        $name =~ s/\047/\047\\\047\047/g;
        my $cmd;
        $filename .= "-$hash$known_snapshot_formats{$format}{'suffix'}";
-       $cmd = "$git_command archive " .
-               "--format=$known_snapshot_formats{$format}{'format'} " .
-               "--prefix=\'$name\'/ $hash";
+       $cmd = quote_command(
+               git_cmd(), 'archive',
+               "--format=$known_snapshot_formats{$format}{'format'}",
+               "--prefix=$name/", $hash);
        if (exists $known_snapshot_formats{$format}{'compressor'}) {
-               $cmd .= ' | ' . join ' ', @{$known_snapshot_formats{$format}{'compressor'}};
+               $cmd .= ' | ' . quote_command(@{$known_snapshot_formats{$format}{'compressor'}});
        }
 
        print $cgi->header(
@@ -4858,8 +4735,8 @@ sub git_object {
        if ($hash || ($hash_base && !defined $file_name)) {
                my $object_id = $hash || $hash_base;
 
-               my $git_command = git_cmd_str();
-               open my $fd, "-|", "$git_command cat-file -t $object_id 2>/dev/null"
+               open my $fd, "-|", quote_command(
+                       git_cmd(), 'cat-file', '-t', $object_id) . ' 2> /dev/null'
                        or die_error('404 Not Found', "Object does not exist");
                $type = <$fd>;
                chomp $type;
index c93e781c3b503bae6ee7c6735fa058aa0a98e026..665712a85de3fb4bba3a879753b60ece64a4243a 100644 (file)
@@ -9,6 +9,7 @@
 #include "revision.h"
 #include "exec_cmd.h"
 #include "remote.h"
+#include "list-objects.h"
 
 #include <expat.h>
 
@@ -1878,31 +1879,6 @@ static int ref_newer(const unsigned char *new_sha1,
        return found;
 }
 
-static void mark_edge_parents_uninteresting(struct commit *commit)
-{
-       struct commit_list *parents;
-
-       for (parents = commit->parents; parents; parents = parents->next) {
-               struct commit *parent = parents->item;
-               if (!(parent->object.flags & UNINTERESTING))
-                       continue;
-               mark_tree_uninteresting(parent->tree);
-       }
-}
-
-static void mark_edges_uninteresting(struct commit_list *list)
-{
-       for ( ; list; list = list->next) {
-               struct commit *commit = list->item;
-
-               if (commit->object.flags & UNINTERESTING) {
-                       mark_tree_uninteresting(commit->tree);
-                       continue;
-               }
-               mark_edge_parents_uninteresting(commit);
-       }
-}
-
 static void add_remote_info_ref(struct remote_ls_ctx *ls)
 {
        struct strbuf *buf = (struct strbuf *)ls->userData;
@@ -2408,6 +2384,7 @@ int main(int argc, char **argv)
                }
                init_revisions(&revs, setup_git_directory());
                setup_revisions(commit_argc, commit_argv, &revs, NULL);
+               revs.edge_hint = 0; /* just in case */
                free(new_sha1_hex);
                if (old_sha1_hex) {
                        free(old_sha1_hex);
@@ -2418,7 +2395,7 @@ int main(int argc, char **argv)
                pushing = 0;
                if (prepare_revision_walk(&revs))
                        die("revision walk setup failed");
-               mark_edges_uninteresting(revs.commits);
+               mark_edges_uninteresting(revs.commits, &revs, NULL);
                objects_to_send = get_delta(&revs, ref_lock);
                finish_all_active_slots();
 
diff --git a/http.c b/http.c
index 2a21ccbb76351d108301d2b9c334e2c5a5feacd9..105dc93843ba1f01ea0d40c63dd174e879f1a25a 100644 (file)
--- a/http.c
+++ b/http.c
@@ -583,7 +583,7 @@ static char *quote_ref_url(const char *base, const char *ref)
        int len, baselen, ch;
 
        baselen = strlen(base);
-       len = baselen + 7; /* "/refs/" + NUL */
+       len = baselen + 2; /* '/' after base and terminating NUL */
        for (cp = ref; (ch = *cp) != 0; cp++, len++)
                if (needs_quote(ch))
                        len += 2; /* extra two hex plus replacement % */
diff --git a/path.c b/path.c
index 4945f2abc50be08aa5e0cc2f9be562c74c47b9d7..7a35a26a1697480f0f43244132d8267deb301651 100644 (file)
--- a/path.c
+++ b/path.c
@@ -314,7 +314,7 @@ const char *make_nonrelative_path(const char *path)
 {
        static char buf[PATH_MAX + 1];
 
-       if (path[0] == '/') {
+       if (is_absolute_path(path)) {
                if (strlcpy(buf, path, PATH_MAX) >= PATH_MAX)
                        die ("Too long path: %.*s", 60, path);
        } else {
index d19f80c0bb25928383f8a1aff3f6f49f9a65131c..55a8687ad15788f8ea5a5beb463d216908f618b2 100644 (file)
@@ -241,16 +241,21 @@ void stop_progress_msg(struct progress **p_progress, const char *msg)
        *p_progress = NULL;
        if (progress->last_value != -1) {
                /* Force the last update */
-               char buf[strlen(msg) + 5];
+               char buf[128], *bufp;
+               size_t len = strlen(msg) + 5;
                struct throughput *tp = progress->throughput;
+
+               bufp = (len < sizeof(buf)) ? buf : xmalloc(len + 1);
                if (tp) {
                        unsigned int rate = !tp->avg_misecs ? 0 :
                                        tp->avg_bytes / tp->avg_misecs;
                        throughput_string(tp, tp->curr_total, rate);
                }
                progress_update = 1;
-               sprintf(buf, ", %s.\n", msg);
-               display(progress, progress->last_value, buf);
+               sprintf(bufp, ", %s.\n", msg);
+               display(progress, progress->last_value, bufp);
+               if (buf != bufp)
+                       free(bufp);
        }
        clear_progress_signal();
        free(progress->throughput);
index 91e3b112bb5ffa151a8ede9391d3bd88ea4d3500..ff2c8021678fee5ef12060d35c6eb1960e8792c7 100644 (file)
--- a/remote.c
+++ b/remote.c
@@ -867,8 +867,7 @@ static char *guess_ref(const char *name, struct ref *peer)
 
 static int match_explicit(struct ref *src, struct ref *dst,
                          struct ref ***dst_tail,
-                         struct refspec *rs,
-                         int errs)
+                         struct refspec *rs)
 {
        struct ref *matched_src, *matched_dst;
 
@@ -876,7 +875,7 @@ static int match_explicit(struct ref *src, struct ref *dst,
        char *dst_guess;
 
        if (rs->pattern || rs->matching)
-               return errs;
+               return 0;
 
        matched_src = matched_dst = NULL;
        switch (count_refspec_match(rs->src, src, &matched_src)) {
@@ -889,23 +888,16 @@ static int match_explicit(struct ref *src, struct ref *dst,
                 */
                matched_src = try_explicit_object_name(rs->src);
                if (!matched_src)
-                       error("src refspec %s does not match any.", rs->src);
+                       return error("src refspec %s does not match any.", rs->src);
                break;
        default:
-               matched_src = NULL;
-               error("src refspec %s matches more than one.", rs->src);
-               break;
+               return error("src refspec %s matches more than one.", rs->src);
        }
 
-       if (!matched_src)
-               errs = 1;
-
        if (!dst_value) {
                unsigned char sha1[20];
                int flag;
 
-               if (!matched_src)
-                       return errs;
                dst_value = resolve_ref(matched_src->name, sha1, 1, &flag);
                if (!dst_value ||
                    ((flag & REF_ISSYMREF) &&
@@ -936,18 +928,16 @@ static int match_explicit(struct ref *src, struct ref *dst,
                      dst_value);
                break;
        }
-       if (errs || !matched_dst)
-               return 1;
-       if (matched_dst->peer_ref) {
-               errs = 1;
-               error("dst ref %s receives from more than one src.",
+       if (!matched_dst)
+               return -1;
+       if (matched_dst->peer_ref)
+               return error("dst ref %s receives from more than one src.",
                      matched_dst->name);
-       }
        else {
                matched_dst->peer_ref = matched_src;
                matched_dst->force = rs->force;
        }
-       return errs;
+       return 0;
 }
 
 static int match_explicit_refs(struct ref *src, struct ref *dst,
@@ -956,8 +946,8 @@ static int match_explicit_refs(struct ref *src, struct ref *dst,
 {
        int i, errs;
        for (i = errs = 0; i < rs_nr; i++)
-               errs |= match_explicit(src, dst, dst_tail, &rs[i], errs);
-       return -errs;
+               errs += match_explicit(src, dst, dst_tail, &rs[i]);
+       return errs;
 }
 
 static const struct refspec *check_pattern_match(const struct refspec *rs,
index adcf37c3f68d16200b01adae441fa3d8f68e3c02..191f814e09ee6067edf7b0acc73a04751e73a6da 100644 (file)
@@ -35,8 +35,6 @@ static size_t sz_fmt(size_t s) { return s; }
 
 const unsigned char null_sha1[20];
 
-static unsigned int sha1_file_open_flag = O_NOATIME;
-
 const signed char hexval_table[256] = {
         -1, -1, -1, -1, -1, -1, -1, -1,                /* 00-07 */
         -1, -1, -1, -1, -1, -1, -1, -1,                /* 08-0f */
@@ -118,7 +116,7 @@ int safe_create_leading_directories(char *path)
        return 0;
 }
 
-char * sha1_to_hex(const unsigned char *sha1)
+char *sha1_to_hex(const unsigned char *sha1)
 {
        static int bufno;
        static char hexbuffer[4][50];
@@ -399,21 +397,21 @@ void prepare_alt_odb(void)
        read_info_alternates(get_object_directory(), 0);
 }
 
-static char *find_sha1_file(const unsigned char *sha1, struct stat *st)
+static int has_loose_object(const unsigned char *sha1)
 {
        char *name = sha1_file_name(sha1);
        struct alternate_object_database *alt;
 
-       if (!stat(name, st))
-               return name;
+       if (!access(name, F_OK))
+               return 1;
        prepare_alt_odb();
        for (alt = alt_odb_list; alt; alt = alt->next) {
                name = alt->name;
                fill_sha1_path(name, sha1);
-               if (!stat(alt->base, st))
-                       return alt->base;
+               if (!access(alt->base, F_OK))
+                       return 1;
        }
-       return NULL;
+       return 0;
 }
 
 static unsigned int pack_used_ctr;
@@ -833,13 +831,7 @@ struct packed_git *add_packed_git(const char *path, int path_len, int local)
 
 struct packed_git *parse_pack_index(unsigned char *sha1)
 {
-       char *path = sha1_pack_index_name(sha1);
-       return parse_pack_index_file(sha1, path);
-}
-
-struct packed_git *parse_pack_index_file(const unsigned char *sha1,
-                                        const char *idx_path)
-{
+       const char *idx_path = sha1_pack_index_name(sha1);
        const char *path = sha1_pack_name(sha1);
        struct packed_git *p = xmalloc(sizeof(*p) + strlen(path) + 2);
 
@@ -997,38 +989,58 @@ int check_sha1_signature(const unsigned char *sha1, void *map, unsigned long siz
        return hashcmp(sha1, real_sha1) ? -1 : 0;
 }
 
+static int git_open_noatime(const char *name)
+{
+       static int sha1_file_open_flag = O_NOATIME;
+       int fd = open(name, O_RDONLY | sha1_file_open_flag);
+
+       /* Might the failure be due to O_NOATIME? */
+       if (fd < 0 && errno != ENOENT && sha1_file_open_flag) {
+               fd = open(name, O_RDONLY);
+               if (fd >= 0)
+                       sha1_file_open_flag = 0;
+       }
+       return fd;
+}
+
+static int open_sha1_file(const unsigned char *sha1)
+{
+       int fd;
+       char *name = sha1_file_name(sha1);
+       struct alternate_object_database *alt;
+
+       fd = git_open_noatime(name);
+       if (fd >= 0)
+               return fd;
+
+       prepare_alt_odb();
+       errno = ENOENT;
+       for (alt = alt_odb_list; alt; alt = alt->next) {
+               name = alt->name;
+               fill_sha1_path(name, sha1);
+               fd = git_open_noatime(alt->base);
+               if (fd >= 0)
+                       return fd;
+       }
+       return -1;
+}
+
 static void *map_sha1_file(const unsigned char *sha1, unsigned long *size)
 {
-       struct stat st;
        void *map;
        int fd;
-       char *filename = find_sha1_file(sha1, &st);
 
-       if (!filename) {
-               return NULL;
-       }
+       fd = open_sha1_file(sha1);
+       map = NULL;
+       if (fd >= 0) {
+               struct stat st;
 
-       fd = open(filename, O_RDONLY | sha1_file_open_flag);
-       if (fd < 0) {
-               /* See if it works without O_NOATIME */
-               switch (sha1_file_open_flag) {
-               default:
-                       fd = open(filename, O_RDONLY);
-                       if (fd >= 0)
-                               break;
-               /* Fallthrough */
-               case 0:
-                       return NULL;
+               if (!fstat(fd, &st)) {
+                       *size = xsize_t(st.st_size);
+                       map = xmmap(NULL, *size, PROT_READ, MAP_PRIVATE, fd, 0);
                }
-
-               /* If it failed once, it will probably fail again.
-                * Stop using O_NOATIME
-                */
-               sha1_file_open_flag = 0;
+               close(fd);
        }
-       *size = xsize_t(st.st_size);
-       map = xmmap(NULL, *size, PROT_READ, MAP_PRIVATE, fd, 0);
-       close(fd);
        return map;
 }
 
@@ -2018,49 +2030,12 @@ static void write_sha1_file_prepare(const void *buf, unsigned long len,
        SHA1_Final(sha1, &c);
 }
 
-/*
- * Link the tempfile to the final place, possibly creating the
- * last directory level as you do so.
- *
- * Returns the errno on failure, 0 on success.
- */
-static int link_temp_to_file(const char *tmpfile, const char *filename)
-{
-       int ret;
-       char *dir;
-
-       if (!link(tmpfile, filename))
-               return 0;
-
-       /*
-        * Try to mkdir the last path component if that failed.
-        *
-        * Re-try the "link()" regardless of whether the mkdir
-        * succeeds, since a race might mean that somebody
-        * else succeeded.
-        */
-       ret = errno;
-       dir = strrchr(filename, '/');
-       if (dir) {
-               *dir = 0;
-               if (!mkdir(filename, 0777) && adjust_shared_perm(filename)) {
-                       *dir = '/';
-                       return -2;
-               }
-               *dir = '/';
-               if (!link(tmpfile, filename))
-                       return 0;
-               ret = errno;
-       }
-       return ret;
-}
-
 /*
  * Move the just written object into its final resting place
  */
 int move_temp_to_file(const char *tmpfile, const char *filename)
 {
-       int ret = link_temp_to_file(tmpfile, filename);
+       int ret = link(tmpfile, filename);
 
        /*
         * Coda hack - coda doesn't like cross-directory links,
@@ -2105,6 +2080,55 @@ int hash_sha1_file(const void *buf, unsigned long len, const char *type,
        return 0;
 }
 
+/* Finalize a file on disk, and close it. */
+static void close_sha1_file(int fd)
+{
+       /* For safe-mode, we could fsync_or_die(fd, "sha1 file") here */
+       fchmod(fd, 0444);
+       if (close(fd) != 0)
+               die("unable to write sha1 file");
+}
+
+/* Size of directory component, including the ending '/' */
+static inline int directory_size(const char *filename)
+{
+       const char *s = strrchr(filename, '/');
+       if (!s)
+               return 0;
+       return s - filename + 1;
+}
+
+/*
+ * This creates a temporary file in the same directory as the final
+ * 'filename'
+ *
+ * We want to avoid cross-directory filename renames, because those
+ * can have problems on various filesystems (FAT, NFS, Coda).
+ */
+static int create_tmpfile(char *buffer, size_t bufsiz, const char *filename)
+{
+       int fd, dirlen = directory_size(filename);
+
+       if (dirlen + 20 > bufsiz) {
+               errno = ENAMETOOLONG;
+               return -1;
+       }
+       memcpy(buffer, filename, dirlen);
+       strcpy(buffer + dirlen, "tmp_obj_XXXXXX");
+       fd = mkstemp(buffer);
+       if (fd < 0 && dirlen) {
+               /* Make sure the directory exists */
+               buffer[dirlen-1] = 0;
+               if (mkdir(buffer, 0777) || adjust_shared_perm(buffer))
+                       return -1;
+
+               /* Try again */
+               strcpy(buffer + dirlen - 1, "/tmp_obj_XXXXXX");
+               fd = mkstemp(buffer);
+       }
+       return fd;
+}
+
 static int write_loose_object(const unsigned char *sha1, char *hdr, int hdrlen,
                              void *buf, unsigned long len, time_t mtime)
 {
@@ -2115,23 +2139,7 @@ static int write_loose_object(const unsigned char *sha1, char *hdr, int hdrlen,
        static char tmpfile[PATH_MAX];
 
        filename = sha1_file_name(sha1);
-       fd = open(filename, O_RDONLY);
-       if (fd >= 0) {
-               /*
-                * FIXME!!! We might do collision checking here, but we'd
-                * need to uncompress the old file and check it. Later.
-                */
-               close(fd);
-               return 0;
-       }
-
-       if (errno != ENOENT) {
-               return error("sha1 file %s: %s\n", filename, strerror(errno));
-       }
-
-       snprintf(tmpfile, sizeof(tmpfile), "%s/tmp_obj_XXXXXX", get_object_directory());
-
-       fd = mkstemp(tmpfile);
+       fd = create_tmpfile(tmpfile, sizeof(tmpfile), filename);
        if (fd < 0) {
                if (errno == EPERM)
                        return error("insufficient permission for adding an object to repository database %s\n", get_object_directory());
@@ -2170,9 +2178,7 @@ static int write_loose_object(const unsigned char *sha1, char *hdr, int hdrlen,
 
        if (write_buffer(fd, compressed, size) < 0)
                die("unable to write sha1 file");
-       fchmod(fd, 0444);
-       if (close(fd))
-               die("unable to write sha1 file");
+       close_sha1_file(fd);
        free(compressed);
 
        if (mtime) {
@@ -2206,14 +2212,13 @@ int write_sha1_file(void *buf, unsigned long len, const char *type, unsigned cha
 
 int force_object_loose(const unsigned char *sha1, time_t mtime)
 {
-       struct stat st;
        void *buf;
        unsigned long len;
        enum object_type type;
        char hdr[32];
        int hdrlen;
 
-       if (find_sha1_file(sha1, &st))
+       if (has_loose_object(sha1))
                return 0;
        buf = read_packed_sha1(sha1, &type, &len);
        if (!buf)
@@ -2222,150 +2227,6 @@ int force_object_loose(const unsigned char *sha1, time_t mtime)
        return write_loose_object(sha1, hdr, hdrlen, buf, len, mtime);
 }
 
-/*
- * We need to unpack and recompress the object for writing
- * it out to a different file.
- */
-static void *repack_object(const unsigned char *sha1, unsigned long *objsize)
-{
-       size_t size;
-       z_stream stream;
-       unsigned char *unpacked;
-       unsigned long len;
-       enum object_type type;
-       char hdr[32];
-       int hdrlen;
-       void *buf;
-
-       /* need to unpack and recompress it by itself */
-       unpacked = read_packed_sha1(sha1, &type, &len);
-       if (!unpacked)
-               error("cannot read sha1_file for %s", sha1_to_hex(sha1));
-
-       hdrlen = sprintf(hdr, "%s %lu", typename(type), len) + 1;
-
-       /* Set it up */
-       memset(&stream, 0, sizeof(stream));
-       deflateInit(&stream, zlib_compression_level);
-       size = deflateBound(&stream, len + hdrlen);
-       buf = xmalloc(size);
-
-       /* Compress it */
-       stream.next_out = buf;
-       stream.avail_out = size;
-
-       /* First header.. */
-       stream.next_in = (void *)hdr;
-       stream.avail_in = hdrlen;
-       while (deflate(&stream, 0) == Z_OK)
-               /* nothing */;
-
-       /* Then the data itself.. */
-       stream.next_in = unpacked;
-       stream.avail_in = len;
-       while (deflate(&stream, Z_FINISH) == Z_OK)
-               /* nothing */;
-       deflateEnd(&stream);
-       free(unpacked);
-
-       *objsize = stream.total_out;
-       return buf;
-}
-
-int write_sha1_to_fd(int fd, const unsigned char *sha1)
-{
-       int retval;
-       unsigned long objsize;
-       void *buf = map_sha1_file(sha1, &objsize);
-
-       if (buf) {
-               retval = write_buffer(fd, buf, objsize);
-               munmap(buf, objsize);
-               return retval;
-       }
-
-       buf = repack_object(sha1, &objsize);
-       retval = write_buffer(fd, buf, objsize);
-       free(buf);
-       return retval;
-}
-
-int write_sha1_from_fd(const unsigned char *sha1, int fd, char *buffer,
-                      size_t bufsize, size_t *bufposn)
-{
-       char tmpfile[PATH_MAX];
-       int local;
-       z_stream stream;
-       unsigned char real_sha1[20];
-       unsigned char discard[4096];
-       int ret;
-       SHA_CTX c;
-
-       snprintf(tmpfile, sizeof(tmpfile), "%s/tmp_obj_XXXXXX", get_object_directory());
-
-       local = mkstemp(tmpfile);
-       if (local < 0) {
-               if (errno == EPERM)
-                       return error("insufficient permission for adding an object to repository database %s\n", get_object_directory());
-               else
-                       return error("unable to create temporary sha1 filename %s: %s\n", tmpfile, strerror(errno));
-       }
-
-       memset(&stream, 0, sizeof(stream));
-
-       inflateInit(&stream);
-
-       SHA1_Init(&c);
-
-       do {
-               ssize_t size;
-               if (*bufposn) {
-                       stream.avail_in = *bufposn;
-                       stream.next_in = (unsigned char *) buffer;
-                       do {
-                               stream.next_out = discard;
-                               stream.avail_out = sizeof(discard);
-                               ret = inflate(&stream, Z_SYNC_FLUSH);
-                               SHA1_Update(&c, discard, sizeof(discard) -
-                                           stream.avail_out);
-                       } while (stream.avail_in && ret == Z_OK);
-                       if (write_buffer(local, buffer, *bufposn - stream.avail_in) < 0)
-                               die("unable to write sha1 file");
-                       memmove(buffer, buffer + *bufposn - stream.avail_in,
-                               stream.avail_in);
-                       *bufposn = stream.avail_in;
-                       if (ret != Z_OK)
-                               break;
-               }
-               size = xread(fd, buffer + *bufposn, bufsize - *bufposn);
-               if (size <= 0) {
-                       close(local);
-                       unlink(tmpfile);
-                       if (!size)
-                               return error("Connection closed?");
-                       perror("Reading from connection");
-                       return -1;
-               }
-               *bufposn += size;
-       } while (1);
-       inflateEnd(&stream);
-
-       fchmod(local, 0444);
-       if (close(local) != 0)
-               die("unable to write sha1 file");
-       SHA1_Final(real_sha1, &c);
-       if (ret != Z_STREAM_END) {
-               unlink(tmpfile);
-               return error("File %s corrupted", sha1_to_hex(sha1));
-       }
-       if (hashcmp(sha1, real_sha1)) {
-               unlink(tmpfile);
-               return error("File %s has bad hash", sha1_to_hex(sha1));
-       }
-
-       return move_temp_to_file(tmpfile, sha1_file_name(sha1));
-}
-
 int has_pack_index(const unsigned char *sha1)
 {
        struct stat st;
@@ -2390,12 +2251,11 @@ int has_sha1_pack(const unsigned char *sha1, const char **ignore_packed)
 
 int has_sha1_file(const unsigned char *sha1)
 {
-       struct stat st;
        struct pack_entry e;
 
        if (find_pack_entry(sha1, &e, NULL))
                return 1;
-       return find_sha1_file(sha1, &st) ? 1 : 0;
+       return has_loose_object(sha1);
 }
 
 int index_pipe(unsigned char *sha1, int fd, const char *type, int write_object)
index 562b12e16ebc543db80629d8bcf9499f7a16e74f..ab6edbf19e80a5e07c85ff7cde05061fba349647 100644 (file)
@@ -1 +1,2 @@
-* -whitespace
+t[0-9][0-9][0-9][0-9]-*.sh -whitespace
+t[0-9][0-9][0-9][0-9]/* -whitespace
index 70841a4645b2469d8263553a7ba41d4f953774f7..8f12d48fe8b4ffe4a4b37dcd16ce58e50837433f 100644 (file)
--- a/t/README
+++ b/t/README
@@ -54,6 +54,38 @@ You can pass --verbose (or -v), --debug (or -d), and --immediate
        This causes the test to immediately exit upon the first
        failed test.
 
+--long-tests::
+       This causes additional long-running tests to be run (where
+       available), for more exhaustive testing.
+
+
+Skipping Tests
+--------------
+
+In some environments, certain tests have no way of succeeding
+due to platform limitation, such as lack of 'unzip' program, or
+filesystem that do not allow arbitrary sequence of non-NUL bytes
+as pathnames.
+
+You should be able to say something like
+
+    $ GIT_SKIP_TESTS=t9200.8 sh ./t9200-git-cvsexport-commit.sh
+
+and even:
+
+    $ GIT_SKIP_TESTS='t[0-4]??? t91?? t9200.8' make
+
+to omit such tests.  The value of the environment variable is a
+SP separated list of patterns that tells which tests to skip,
+and either can match the "t[0-9]{4}" part to skip the whole
+test, or t[0-9]{4} followed by ".$number" to say which
+particular test to skip.
+
+Note that some tests in the existing test suite rely on previous
+test item, so you cannot arbitrarily disable one and expect the
+remainder of test to check what the test originally was intended
+to check.
+
 
 Naming Tests
 ------------
index c56d2fbabaa0fdd90547ce8b629a629c21fbbc0e..3d8e06a20fade230136d50736a2f621d3c96002c 100755 (executable)
@@ -54,4 +54,39 @@ test_expect_success 'root subdir attribute test' '
 
 '
 
+test_expect_success 'setup bare' '
+
+       git clone --bare . bare.git &&
+       cd bare.git
+
+'
+
+test_expect_success 'bare repository: check that .gitattribute is ignored' '
+
+       (
+               echo "f test=f"
+               echo "a/i test=a/i"
+       ) >.gitattributes &&
+       attr_check f unspecified &&
+       attr_check a/f unspecified &&
+       attr_check a/c/f unspecified &&
+       attr_check a/i unspecified &&
+       attr_check subdir/a/i unspecified
+
+'
+
+test_expect_success 'bare repository: test info/attributes' '
+
+       (
+               echo "f test=f"
+               echo "a/i test=a/i"
+       ) >info/attributes &&
+       attr_check f f &&
+       attr_check a/f f &&
+       attr_check a/c/f f &&
+       attr_check a/i a/i &&
+       attr_check subdir/a/i unspecified
+
+'
+
 test_done
index cb1fbe5820723cbc39753fd652ec4fdafc94b988..d8b7f2ffbcc0427b1ae9d48feb4387f580e81d61 100755 (executable)
@@ -74,7 +74,7 @@ $content"
     test -z "$content" ||
     test_expect_success "--batch output of $type is correct" '
        expect="$(maybe_remove_timestamp "$batch_output" $no_ts)"
-       actual="$(maybe_remove_timestamp "$(echo $sha1 | git cat-file --batch)" no_ts)"
+       actual="$(maybe_remove_timestamp "$(echo $sha1 | git cat-file --batch)" $no_ts)"
         if test "z$expect" = "z$actual"
        then
                : happy
@@ -174,9 +174,27 @@ do
     '
 done
 
-test_expect_success "--batch-check for a non-existent object" '
-    test "deadbeef missing" = \
-    "$(echo_without_newline deadbeef | git cat-file --batch-check)"
+test_expect_success "--batch-check for a non-existent named object" '
+    test "foobar42 missing
+foobar84 missing" = \
+    "$( ( echo foobar42; echo_without_newline foobar84; ) | git cat-file --batch-check)"
+'
+
+test_expect_success "--batch-check for a non-existent hash" '
+    test "0000000000000000000000000000000000000042 missing
+0000000000000000000000000000000000000084 missing" = \
+    "$( ( echo 0000000000000000000000000000000000000042;
+         echo_without_newline 0000000000000000000000000000000000000084; ) \
+       | git cat-file --batch-check)"
+'
+
+test_expect_success "--batch for an existent and a non-existent hash" '
+    test "$tag_sha1 tag $tag_size
+$tag_content
+0000000000000000000000000000000000000000 missing" = \
+    "$( ( echo $tag_sha1;
+         echo_without_newline 0000000000000000000000000000000000000000; ) \
+       | git cat-file --batch)"
 '
 
 test_expect_success "--batch-check for an emtpy line" '
index 5e4252a320d5f967eacb9bd68bb0a510fe748e80..6c78c8bc9b76828c258f524e73b40d7daff7c305 100755 (executable)
@@ -83,4 +83,19 @@ do
 
 done
 
+test_expect_success 'git reflog expire honors core.sharedRepository' '
+       git config core.sharedRepository group &&
+       git reflog expire --all &&
+       actual="$(ls -l .git/logs/refs/heads/master)" &&
+       case "$actual" in
+       -rw-rw-*)
+               : happy
+               ;;
+       *)
+               echo Ooops, .git/logs/refs/heads/master is not 0662 [$actual]
+               false
+               ;;
+       esac
+'
+
 test_done
index b8b7ab410354b01584092802365f4b53cd991b4a..f387d46f1a17ac9f9d3319c4da7e30a6c6326c67 100755 (executable)
@@ -42,6 +42,14 @@ test_expect_success "delete $m" '
 '
 rm -f .git/$m
 
+test_expect_success "delete $m without oldvalue verification" "
+       git update-ref $m $A &&
+       test $A = \$(cat .git/$m) &&
+       git update-ref -d $m &&
+       ! test -f .git/$m
+"
+rm -f .git/$m
+
 test_expect_success \
        "fail to create $n" \
        "touch .git/$n_dir
index 0cfd47cfcff31fddfb9470654367a8f1ac261bfd..ceb6a79fe0c8ca5b26a9e148215556f2aa344eb9 100755 (executable)
@@ -26,7 +26,6 @@ test_expect_success setup '
 
 test_expect_success 'apply empty' '
        git reset --hard &&
-       >empty &&
        rm -f missing &&
        git apply patch0 &&
        test_cmp expect empty
@@ -34,7 +33,6 @@ test_expect_success 'apply empty' '
 
 test_expect_success 'apply --index empty' '
        git reset --hard &&
-       >empty &&
        rm -f missing &&
        git apply --index patch0 &&
        test_cmp expect empty &&
@@ -43,7 +41,6 @@ test_expect_success 'apply --index empty' '
 
 test_expect_success 'apply create' '
        git reset --hard &&
-       >empty &&
        rm -f missing &&
        git apply patch1 &&
        test_cmp expect missing
@@ -51,7 +48,6 @@ test_expect_success 'apply create' '
 
 test_expect_success 'apply --index create' '
        git reset --hard &&
-       >empty &&
        rm -f missing &&
        git apply --index patch1 &&
        test_cmp expect missing &&
index 0d7ed1f99b327c3130c43519c3a8a8fd4ee37892..1e192a2207a4b56d477e8e3efc382c3a296ba776 100755 (executable)
@@ -138,6 +138,25 @@ test_expect_success 'show' '
         test_cmp expect output)
 '
 
+cat > test/expect << EOF
+* remote origin
+  URL: $(pwd)/one/.git
+  Remote branch merged with 'git pull' while on branch master
+    master
+  Tracked remote branches
+    master side
+  Local branches pushed with 'git push'
+    master:upstream +refs/tags/lastbackup
+EOF
+
+test_expect_success 'show -n' '
+       (mv one one.unreachable &&
+        cd test &&
+        git remote show -n origin > output &&
+        mv ../one.unreachable ../one &&
+        test_cmp expect output)
+'
+
 test_expect_success 'prune' '
        (cd one &&
         git branch -m side side2) &&
@@ -148,6 +167,24 @@ test_expect_success 'prune' '
         ! git rev-parse refs/remotes/origin/side)
 '
 
+cat > test/expect << EOF
+Pruning origin
+URL: $(pwd)/one/.git
+ * [would prune] origin/side2
+EOF
+
+test_expect_success 'prune --dry-run' '
+       (cd one &&
+        git branch -m side2 side) &&
+       (cd test &&
+        git remote prune --dry-run origin > output &&
+        git rev-parse refs/remotes/origin/side2 &&
+        ! git rev-parse refs/remotes/origin/side &&
+       (cd ../one &&
+        git branch -m side side2) &&
+        test_cmp expect output)
+'
+
 test_expect_success 'add --mirror && prune' '
        (mkdir mirror &&
         cd mirror &&
index 6946557c677ccc190309cd5961b046c420174f7d..df7750f7d1ede6e888ec3071397115022e067eb3 100755 (executable)
@@ -37,7 +37,8 @@ test_expect_success "clone and setup child repos" '
                echo "Pull: refs/heads/one:refs/heads/one"
        } >.git/remotes/two &&
        cd .. &&
-       git clone . bundle
+       git clone . bundle &&
+       git clone . seven
 '
 
 test_expect_success "fetch test" '
@@ -295,4 +296,11 @@ test_expect_success 'configured fetch updates tracking' '
        )
 '
 
+test_expect_success 'pushing nonexistent branch by mistake should not segv' '
+
+       cd "$D" &&
+       test_must_fail git push seven no:no
+
+'
+
 test_done
diff --git a/t/t6033-merge-crlf.sh b/t/t6033-merge-crlf.sh
new file mode 100755 (executable)
index 0000000..75d9602
--- /dev/null
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+append_cr () {
+       sed -e 's/$/Q/' | tr Q '\015'
+}
+
+remove_cr () {
+       tr '\015' Q | sed -e 's/Q$//'
+}
+
+test_description='merge conflict in crlf repo
+
+               b---M
+              /   /
+       initial---a
+
+'
+
+. ./test-lib.sh
+
+test_expect_success setup '
+       git config core.autocrlf true &&
+       echo foo | append_cr >file &&
+       git add file &&
+       git commit -m "Initial" &&
+       git tag initial &&
+       git branch side &&
+       echo line from a | append_cr >file &&
+       git commit -m "add line from a" file &&
+       git tag a &&
+       git checkout side &&
+       echo line from b | append_cr >file &&
+       git commit -m "add line from b" file &&
+       git tag b &&
+       git checkout master
+'
+
+test_expect_success 'Check "ours" is CRLF' '
+       git reset --hard initial &&
+       git merge side -s ours &&
+       cat file | remove_cr | append_cr >file.temp &&
+       test_cmp file file.temp
+'
+
+test_expect_success 'Check that conflict file is CRLF' '
+       git reset --hard a &&
+       test_must_fail git merge side &&
+       cat file | remove_cr | append_cr >file.temp &&
+       test_cmp file file.temp
+'
+
+test_done
index ed871a6b4d7963f520b994f4d378b02194d69f9e..c25eff9e468acd628cf0a5e7a0968c801396e9f8 100755 (executable)
@@ -212,7 +212,11 @@ test_expect_success 'do not fire editor in the presence of conflicts' '
        # Must fail due to conflict
        test_must_fail git cherry-pick -n master &&
        echo "editor not started" >.git/result &&
-       test_must_fail GIT_EDITOR="$(pwd)/.git/FAKE_EDITOR" git commit &&
+       (
+               GIT_EDITOR="$(pwd)/.git/FAKE_EDITOR" &&
+               export GIT_EDITOR &&
+               test_must_fail git commit
+       ) &&
        test "$(cat .git/result)" = "editor not started"
 '
 
index 8c58f0b8d7488732d25fd1d154b6c5459f5d080e..1190576a658d08a680e177b748cfc5e69caa3ddb 100755 (executable)
@@ -64,7 +64,21 @@ test_expect_success 'interact with it via git-svn' '
 
        # Make sure --add-author-from with --use-log-author affected
        # the authorship information
-       grep "^Author: A U Thor " actual.4
+       grep "^Author: A U Thor " actual.4 &&
+
+       # Make sure there are no commit messages with excess blank lines
+       test $(grep "^ " actual.2 | wc -l) = 3 &&
+       test $(grep "^ " actual.3 | wc -l) = 5 &&
+       test $(grep "^ " actual.4 | wc -l) = 5 &&
+
+       # Make sure there are no svn commit messages with excess blank lines
+       (
+               cd work.svn &&
+               svn up &&
+               
+               test $(svn log -r2:2 | wc -l) = 5 &&
+               test $(svn log -r4:4 | wc -l) = 7
+       )
 '
 
 test_done
index 7a8bd27abc79a43a9248c3bcee8d6a3670e30fe3..e331cadcff479a8d9de59590c44b0502653653f9 100644 (file)
@@ -80,6 +80,8 @@ do
                debug=t; shift ;;
        -i|--i|--im|--imm|--imme|--immed|--immedi|--immedia|--immediat|--immediate)
                immediate=t; shift ;;
+       -l|--l|--lo|--lon|--long|--long-|--long-t|--long-te|--long-tes|--long-test|--long-tests)
+               export GIT_TEST_LONG=t; shift ;;
        -h|--h|--he|--hel|--help)
                help=t; shift ;;
        -v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose)
@@ -168,7 +170,7 @@ trap 'die' exit
 # environment variables to work around this.
 #
 # In particular, quoting isn't enough, as the path may contain the same quote
-# that we're using. 
+# that we're using.
 test_set_editor () {
        FAKE_EDITOR="$1"
        export FAKE_EDITOR
@@ -386,7 +388,7 @@ test_done () {
 }
 
 # Test the binaries we have just built.  The tests are kept in
-# t/ subdirectory and are run in trash subdirectory.
+# t/ subdirectory and are run in 'trash directory' subdirectory.
 PATH=$(pwd)/..:$PATH
 GIT_EXEC_PATH=$(pwd)/..
 GIT_TEMPLATE_DIR=$(pwd)/../templates/blt