Compare commits
54 Commits
Author | SHA1 | Date | |
---|---|---|---|
92e802c6cc | |||
c1fe2fe4fe | |||
da6bf70ebf | |||
2ed8e622bf | |||
2961e0ee8b | |||
6ce183216d | |||
aa66c7ec77 | |||
81214e4ddf | |||
353ce81597 | |||
6ff0b1c56c | |||
2ccd2027b0 | |||
10ae7d86c1 | |||
b484ef28fb | |||
e58b97af31 | |||
31f883d1b8 | |||
50b4e0c178 | |||
b6ae5409ea | |||
88fb958baa | |||
d9e08be9d5 | |||
781411ed46 | |||
7f272ca80c | |||
b73cebf437 | |||
0a15217184 | |||
8b32572c74 | |||
4e7a2eccc2 | |||
82f9d58a39 | |||
89438677ab | |||
f1ec72ba1e | |||
17dff84b5e | |||
36cd2cc7d9 | |||
e9add36007 | |||
8eafa3da62 | |||
08337a97a2 | |||
e5f5219a4f | |||
975b31dc6e | |||
c97451ce09 | |||
7e4a2a8483 | |||
7d6fb370bc | |||
6ab58895cd | |||
ac44f3e7c0 | |||
9a84074d08 | |||
695bf722da | |||
bb5ebed731 | |||
c5ced64578 | |||
c63da8d8e8 | |||
1e80e04492 | |||
a14c225661 | |||
e99fcf96de | |||
69310a34cb | |||
7246ed438c | |||
f4a11066cf | |||
8d712aafd2 | |||
8ac4838af4 | |||
50e7b06730 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -119,3 +119,4 @@ git-core.spec
|
|||||||
*.exe
|
*.exe
|
||||||
libgit.a
|
libgit.a
|
||||||
*.o
|
*.o
|
||||||
|
*.py[co]
|
||||||
|
@ -138,7 +138,7 @@ mailing list archives for details).
|
|||||||
git has a couple of alternatives, though, that you may find sufficient
|
git has a couple of alternatives, though, that you may find sufficient
|
||||||
or even superior depending on your use. One is called "git-whatchanged"
|
or even superior depending on your use. One is called "git-whatchanged"
|
||||||
(for obvious reasons) and the other one is called "pickaxe" ("a tool for
|
(for obvious reasons) and the other one is called "pickaxe" ("a tool for
|
||||||
the software archeologist").
|
the software archaeologist").
|
||||||
|
|
||||||
The "git-whatchanged" script is a truly trivial script that can give you
|
The "git-whatchanged" script is a truly trivial script that can give you
|
||||||
a good overview of what has changed in a file or a directory (or an
|
a good overview of what has changed in a file or a directory (or an
|
||||||
|
@ -117,7 +117,7 @@ git specific extension to diff format
|
|||||||
What -p option produces is slightly different from the
|
What -p option produces is slightly different from the
|
||||||
traditional diff format.
|
traditional diff format.
|
||||||
|
|
||||||
1. It is preceeded with a "git diff" header, that looks like
|
1. It is preceded with a "git diff" header, that looks like
|
||||||
this:
|
this:
|
||||||
|
|
||||||
diff --git a/file1 b/file2
|
diff --git a/file1 b/file2
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
--abbrev[=<n>]::
|
--abbrev[=<n>]::
|
||||||
Instead of showing the full 40-byte hexadecimal object
|
Instead of showing the full 40-byte hexadecimal object
|
||||||
name in diff-raw format output and diff-tree header
|
name in diff-raw format output and diff-tree header
|
||||||
lines, show only handful dhexigits prefix. This is
|
lines, show only handful hexdigits prefix. This is
|
||||||
independent of --full-index option above, which controls
|
independent of --full-index option above, which controls
|
||||||
the diff-patch output format. Non default number of
|
the diff-patch output format. Non default number of
|
||||||
digits can be specified with --abbrev=<n>.
|
digits can be specified with --abbrev=<n>.
|
||||||
|
@ -31,7 +31,7 @@ DISCUSSION
|
|||||||
----------
|
----------
|
||||||
|
|
||||||
The list of <file> given to the command is fed to `git-ls-files`
|
The list of <file> given to the command is fed to `git-ls-files`
|
||||||
command to list files that are not registerd in the index and
|
command to list files that are not registered in the index and
|
||||||
are not ignored/excluded by `$GIT_DIR/info/exclude` file or
|
are not ignored/excluded by `$GIT_DIR/info/exclude` file or
|
||||||
`.gitignore` file in each directory. This means two things:
|
`.gitignore` file in each directory. This means two things:
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ git-am - Apply a series of patches in a mailbox
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
|
[verse]
|
||||||
'git-am' [--signoff] [--dotest=<dir>] [--utf8] [--binary] [--3way] <mbox>...
|
'git-am' [--signoff] [--dotest=<dir>] [--utf8] [--binary] [--3way] <mbox>...
|
||||||
'git-am' [--skip | --resolved]
|
'git-am' [--skip | --resolved]
|
||||||
|
|
||||||
|
@ -8,7 +8,10 @@ git-apply - Apply patch on a git index file and a work tree
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
'git-apply' [--stat] [--numstat] [--summary] [--check] [--index] [--apply] [--no-add] [--index-info] [--allow-binary-replacement] [-z] [<patch>...]
|
[verse]
|
||||||
|
'git-apply' [--stat] [--numstat] [--summary] [--check] [--index] [--apply]
|
||||||
|
[--no-add] [--index-info] [--allow-binary-replacement] [-z]
|
||||||
|
[<patch>...]
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
|
@ -8,15 +8,15 @@ git-archimport - Import an Arch repository into git
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
`git-archimport` [ -h ] [ -v ] [ -o ] [ -a ] [ -f ] [ -T ]
|
[verse]
|
||||||
[ -D depth ] [ -t tempdir ]
|
`git-archimport` [-h] [-v] [-o] [-a] [-f] [-T] [-D depth] [-t tempdir]
|
||||||
<archive/branch> [ <archive/branch> ]
|
<archive/branch> [ <archive/branch> ]
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
Imports a project from one or more Arch repositories. It will follow branches
|
Imports a project from one or more Arch repositories. It will follow branches
|
||||||
and repositories within the namespaces defined by the <archive/branch>
|
and repositories within the namespaces defined by the <archive/branch>
|
||||||
parameters suppplied. If it cannot find the remote branch a merge comes from
|
parameters supplied. If it cannot find the remote branch a merge comes from
|
||||||
it will just import it as a regular commit. If it can find it, it will mark it
|
it will just import it as a regular commit. If it can find it, it will mark it
|
||||||
as a merge whenever possible (see discussion below).
|
as a merge whenever possible (see discussion below).
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ git-cat-file - Provide content or type information for repository objects
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
'git-cat-file' (-t | -s | -e | <type>) <object>
|
'git-cat-file' [-t | -s | -e | <type>] <object>
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
|
@ -8,6 +8,7 @@ git-checkout-index - Copy files from the index to the working directory
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
|
[verse]
|
||||||
'git-checkout-index' [-u] [-q] [-a] [-f] [-n] [--prefix=<string>]
|
'git-checkout-index' [-u] [-q] [-a] [-f] [-n] [--prefix=<string>]
|
||||||
[--stage=<number>] [--] <file>...
|
[--stage=<number>] [--] <file>...
|
||||||
|
|
||||||
|
@ -8,7 +8,9 @@ git-clone - Clones a repository.
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
'git-clone' [-l [-s]] [-q] [-n] [-u <upload-pack>] <repository> [<directory>]
|
[verse]
|
||||||
|
'git-clone' [-l [-s]] [-q] [-n] [-u <upload-pack>]
|
||||||
|
<repository> [<directory>]
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
|
@ -60,7 +60,8 @@ either `.git/config` file, or using the following environment variables.
|
|||||||
|
|
||||||
(nb "<", ">" and "\n"s are stripped)
|
(nb "<", ">" and "\n"s are stripped)
|
||||||
|
|
||||||
In `.git/config` file, the following items are used:
|
In `.git/config` file, the following items are used for GIT_AUTHOR_NAME and
|
||||||
|
GIT_AUTHOR_EMAIL:
|
||||||
|
|
||||||
[user]
|
[user]
|
||||||
name = "Your Name"
|
name = "Your Name"
|
||||||
|
@ -7,7 +7,9 @@ git-commit - Record your changes
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
'git-commit' [-a] [-s] [-v] [(-c | -C) <commit> | -F <file> | -m <msg>] [-e] [--] <file>...
|
[verse]
|
||||||
|
'git-commit' [-a] [-s] [-v] [(-c | -C) <commit> | -F <file> | -m <msg>]
|
||||||
|
[-e] [--] <file>...
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
|
@ -8,8 +8,7 @@ git-cvsexportcommit - Export a commit to a CVS checkout
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
git-cvsexportcommmit.perl
|
'git-cvsexportcommmit' [-h] [-v] [-c] [-p] [PARENTCOMMIT] COMMITID
|
||||||
[ -h ] [ -v ] [ -c ] [ -p ] [PARENTCOMMIT] COMMITID
|
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
|
@ -8,10 +8,10 @@ git-cvsimport - Import a CVS repository into git
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
'git-cvsimport' [ -o <branch-for-HEAD> ] [ -h ] [ -v ]
|
[verse]
|
||||||
[ -d <CVSROOT> ] [ -p <options-for-cvsps> ]
|
'git-cvsimport' [-o <branch-for-HEAD>] [-h] [-v] [-d <CVSROOT>] [-s <subst>]
|
||||||
[ -C <git_repository> ] [ -i ] [ -P <file> ] [ -k ]
|
[-p <options-for-cvsps>] [-C <git_repository>] [-i] [-P <file>]
|
||||||
[ -s <subst> ] [ -m ] [ -M regex ] [ <CVS_module> ]
|
[-m] [-M regex] [<CVS_module>]
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
|
@ -7,6 +7,7 @@ git-daemon - A really simple server for git repositories.
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
|
[verse]
|
||||||
'git-daemon' [--verbose] [--syslog] [--inetd | --port=n] [--export-all]
|
'git-daemon' [--verbose] [--syslog] [--inetd | --port=n] [--export-all]
|
||||||
[--timeout=n] [--init-timeout=n] [--strict-paths] [directory...]
|
[--timeout=n] [--init-timeout=n] [--strict-paths] [directory...]
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ If '--cached' is specified, it allows you to ask:
|
|||||||
contents (the ones I'd write with a "git-write-tree")
|
contents (the ones I'd write with a "git-write-tree")
|
||||||
|
|
||||||
For example, let's say that you have worked on your working directory, updated
|
For example, let's say that you have worked on your working directory, updated
|
||||||
some files in the index and are ready to commit. You want to see eactly
|
some files in the index and are ready to commit. You want to see exactly
|
||||||
*what* you are going to commit is without having to write a new tree
|
*what* you are going to commit is without having to write a new tree
|
||||||
object and compare it that way, and to do that, you just do
|
object and compare it that way, and to do that, you just do
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ NOTE: As with other commands of this type, "git-diff-index" does not
|
|||||||
actually look at the contents of the file at all. So maybe
|
actually look at the contents of the file at all. So maybe
|
||||||
`kernel/sched.c` hasn't actually changed, and it's just that you
|
`kernel/sched.c` hasn't actually changed, and it's just that you
|
||||||
touched it. In either case, it's a note that you need to
|
touched it. In either case, it's a note that you need to
|
||||||
"git-upate-index" it to make the index be in sync.
|
"git-update-index" it to make the index be in sync.
|
||||||
|
|
||||||
NOTE: You can have a mixture of files show up as "has been updated"
|
NOTE: You can have a mixture of files show up as "has been updated"
|
||||||
and "is still dirty in the working directory" together. You can always
|
and "is still dirty in the working directory" together. You can always
|
||||||
|
@ -8,7 +8,9 @@ git-diff-tree - Compares the content and mode of blobs found via two tree object
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
'git-diff-tree' [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty] [-t] [-r] [--root] [<common diff options>] <tree-ish> [<tree-ish>] [<path>...]
|
[verse]
|
||||||
|
'git-diff-tree' [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty] [-t] [-r]
|
||||||
|
[--root] [<common diff options>] <tree-ish> [<tree-ish>] [<path>...]
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
@ -62,7 +64,7 @@ separated with a single space are given.
|
|||||||
-s::
|
-s::
|
||||||
By default, "git-diff-tree --stdin" shows differences,
|
By default, "git-diff-tree --stdin" shows differences,
|
||||||
either in machine-readable form (without '-p') or in patch
|
either in machine-readable form (without '-p') or in patch
|
||||||
form (with '-p'). This output can be supressed. It is
|
form (with '-p'). This output can be suppressed. It is
|
||||||
only useful with '-v' flag.
|
only useful with '-v' flag.
|
||||||
|
|
||||||
-v::
|
-v::
|
||||||
|
@ -67,7 +67,7 @@ $ git diff HEAD^ HEAD <3>
|
|||||||
<1> instead of using the tip of the current branch, compare with the
|
<1> instead of using the tip of the current branch, compare with the
|
||||||
tip of "test" branch.
|
tip of "test" branch.
|
||||||
<2> instead of comparing with the tip of "test" branch, compare with
|
<2> instead of comparing with the tip of "test" branch, compare with
|
||||||
the tip of the curren branch, but limit the comparison to the
|
the tip of the current branch, but limit the comparison to the
|
||||||
file "test".
|
file "test".
|
||||||
<3> compare the version before the last commit and the last commit.
|
<3> compare the version before the last commit and the last commit.
|
||||||
------------
|
------------
|
||||||
|
@ -8,7 +8,9 @@ git-format-patch - Prepare patches for e-mail submission.
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
'git-format-patch' [-n | -k] [-o <dir> | --stdout] [-s] [-c] [--mbox] [--diff-options] <his> [<mine>]
|
[verse]
|
||||||
|
'git-format-patch' [-n | -k] [-o <dir> | --stdout] [-s] [-c] [--mbox]
|
||||||
|
[--diff-options] <his> [<mine>]
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
@ -96,7 +98,7 @@ git-format-patch -M -B origin::
|
|||||||
|
|
||||||
See Also
|
See Also
|
||||||
--------
|
--------
|
||||||
gitlink:git-am[1], gitlink:git-send-email
|
gitlink:git-am[1], gitlink:git-send-email[1]
|
||||||
|
|
||||||
|
|
||||||
Author
|
Author
|
||||||
|
@ -8,7 +8,9 @@ git-fsck-objects - Verifies the connectivity and validity of the objects in the
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
'git-fsck-objects' [--tags] [--root] [--unreachable] [--cache] [--standalone | --full] [--strict] [<object>*]
|
[verse]
|
||||||
|
'git-fsck-objects' [--tags] [--root] [--unreachable] [--cache]
|
||||||
|
[--standalone | --full] [--strict] [<object>*]
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
|
@ -8,7 +8,7 @@ git-grep - print lines matching a pattern
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
'git-grep' <option>... <pattern> <path>...
|
'git-grep' [<option>...] <pattern> [<path>...]
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
@ -27,7 +27,6 @@ OPTIONS
|
|||||||
The pattern to look for.
|
The pattern to look for.
|
||||||
|
|
||||||
<path>...::
|
<path>...::
|
||||||
|
|
||||||
Optional paths to limit the set of files to be searched;
|
Optional paths to limit the set of files to be searched;
|
||||||
passed to `git-ls-files`.
|
passed to `git-ls-files`.
|
||||||
|
|
||||||
|
@ -3,12 +3,12 @@ git-http-fetch(1)
|
|||||||
|
|
||||||
NAME
|
NAME
|
||||||
----
|
----
|
||||||
git-http-fetch - Downloads a remote git repository via HTTP
|
git-http-fetch - downloads a remote git repository via HTTP
|
||||||
|
|
||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
'git-http-fetch' [-c] [-t] [-a] [-d] [-v] [-w filename] [--recover] commit-id url
|
'git-http-fetch' [-c] [-t] [-a] [-d] [-v] [-w filename] [--recover] <commit> <url>
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
|
@ -8,7 +8,7 @@ git-init-db - Creates an empty git repository
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
'git-init-db' [--template=<template_directory>]
|
'git-init-db' [--template=<template_directory>] [--shared]
|
||||||
|
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
@ -16,6 +16,9 @@ OPTIONS
|
|||||||
--template=<template_directory>::
|
--template=<template_directory>::
|
||||||
Provide the directory in from which templates will be used.
|
Provide the directory in from which templates will be used.
|
||||||
|
|
||||||
|
--shared::
|
||||||
|
Specify that the git repository is to be shared amongst several users.
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
@ -30,7 +33,16 @@ If the object storage directory is specified via the `$GIT_OBJECT_DIRECTORY`
|
|||||||
environment variable then the sha1 directories are created underneath -
|
environment variable then the sha1 directories are created underneath -
|
||||||
otherwise the default `$GIT_DIR/objects` directory is used.
|
otherwise the default `$GIT_DIR/objects` directory is used.
|
||||||
|
|
||||||
`git-init-db` won't hurt an existing repository.
|
A shared repository allows users belonging to the same group to push into that
|
||||||
|
repository. When specifying `--shared` the config variable "core.sharedRepository"
|
||||||
|
is set to 'true' so that directories under `$GIT_DIR` are made group writable
|
||||||
|
(and g+sx, since the git group may be not the primary group of all users).
|
||||||
|
|
||||||
|
|
||||||
|
Running `git-init-db` in an existing repository is safe. It will not overwrite
|
||||||
|
things that are already there. The primary reason for rerunning `git-init-db`
|
||||||
|
is to pick up newly added templates.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
|
@ -13,7 +13,8 @@ SYNOPSIS
|
|||||||
(-[c|d|o|i|s|u|k|m])\*
|
(-[c|d|o|i|s|u|k|m])\*
|
||||||
[-x <pattern>|--exclude=<pattern>]
|
[-x <pattern>|--exclude=<pattern>]
|
||||||
[-X <file>|--exclude-from=<file>]
|
[-X <file>|--exclude-from=<file>]
|
||||||
[--exclude-per-directory=<file>] [--] [<file>]\*
|
[--exclude-per-directory=<file>]
|
||||||
|
[--full-name] [--] [<file>]\*
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
@ -73,10 +74,16 @@ OPTIONS
|
|||||||
H:: cached
|
H:: cached
|
||||||
M:: unmerged
|
M:: unmerged
|
||||||
R:: removed/deleted
|
R:: removed/deleted
|
||||||
C:: modifed/changed
|
C:: modified/changed
|
||||||
K:: to be killed
|
K:: to be killed
|
||||||
? other
|
? other
|
||||||
|
|
||||||
|
--full-name::
|
||||||
|
When run from a subdirectory, the command usually
|
||||||
|
outputs paths relative to the current directory. This
|
||||||
|
option forces paths to be output relative to the project
|
||||||
|
top directory.
|
||||||
|
|
||||||
--::
|
--::
|
||||||
Do not interpret any more arguments as options.
|
Do not interpret any more arguments as options.
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ base-name::
|
|||||||
output of the command.
|
output of the command.
|
||||||
|
|
||||||
--stdout::
|
--stdout::
|
||||||
Write the pack contents (what would have been writtin to
|
Write the pack contents (what would have been written to
|
||||||
.pack file) out to the standard output.
|
.pack file) out to the standard output.
|
||||||
|
|
||||||
--window and --depth::
|
--window and --depth::
|
||||||
|
@ -21,9 +21,9 @@ You can query/set/replace/unset options with this command. The name is
|
|||||||
actually the section and the key separated by a dot, and the value will be
|
actually the section and the key separated by a dot, and the value will be
|
||||||
escaped.
|
escaped.
|
||||||
|
|
||||||
If you want to set/unset an option which can occor on multiple lines, you
|
If you want to set/unset an option which can occur on multiple lines, you
|
||||||
should provide a POSIX regex for the value. If you want to handle the lines
|
should provide a POSIX regex for the value. If you want to handle the lines
|
||||||
*not* matching the regex, just prepend a single exlamation mark in front
|
*not* matching the regex, just prepend a single exclamation mark in front
|
||||||
(see EXAMPLES).
|
(see EXAMPLES).
|
||||||
|
|
||||||
This command will fail if
|
This command will fail if
|
||||||
|
@ -8,16 +8,17 @@ git-rev-list - Lists commit objects in reverse chronological order
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
|
[verse]
|
||||||
'git-rev-list' [ \--max-count=number ]
|
'git-rev-list' [ \--max-count=number ]
|
||||||
[ \--max-age=timestamp ]
|
[ \--max-age=timestamp ]
|
||||||
[ \--min-age=timestamp ]
|
[ \--min-age=timestamp ]
|
||||||
[ \--sparse ]
|
[ \--sparse ]
|
||||||
[ \--no-merges ]
|
[ \--no-merges ]
|
||||||
[ \--all ]
|
[ \--all ]
|
||||||
[ [ \--merge-order [ \--show-breaks ] ] | [ \--topo-order ] | ]
|
[ [ \--merge-order [ \--show-breaks ] ] | [ \--topo-order ] ]
|
||||||
[ \--parents ]
|
[ \--parents ]
|
||||||
[ \--objects [ \--unpacked ] ]
|
[ \--objects [ \--unpacked ] ]
|
||||||
[ \--pretty | \--header | ]
|
[ \--pretty | \--header ]
|
||||||
[ \--bisect ]
|
[ \--bisect ]
|
||||||
<commit>... [ \-- <paths>... ]
|
<commit>... [ \-- <paths>... ]
|
||||||
|
|
||||||
@ -129,7 +130,7 @@ the marked commit in the list.
|
|||||||
+
|
+
|
||||||
Commits marked with (^) are not parents of the immediately preceding commit.
|
Commits marked with (^) are not parents of the immediately preceding commit.
|
||||||
These "breaks" represent necessary discontinuities implied by trying to
|
These "breaks" represent necessary discontinuities implied by trying to
|
||||||
represent an arbtirary DAG in a linear form.
|
represent an arbitrary DAG in a linear form.
|
||||||
+
|
+
|
||||||
`--show-breaks` is only valid if `--merge-order` is also specified.
|
`--show-breaks` is only valid if `--merge-order` is also specified.
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ Following these N lines, one-line log for each commit is
|
|||||||
displayed, indented N places. If a commit is on the I-th
|
displayed, indented N places. If a commit is on the I-th
|
||||||
branch, the I-th indentation character shows a '+' sign;
|
branch, the I-th indentation character shows a '+' sign;
|
||||||
otherwise it shows a space. Each commit shows a short name that
|
otherwise it shows a space. Each commit shows a short name that
|
||||||
can be used as an exended SHA1 to name that commit.
|
can be used as an extended SHA1 to name that commit.
|
||||||
|
|
||||||
The following example shows three branches, "master", "fixes"
|
The following example shows three branches, "master", "fixes"
|
||||||
and "mhf":
|
and "mhf":
|
||||||
|
@ -11,7 +11,7 @@ SYNOPSIS
|
|||||||
--------
|
--------
|
||||||
'git-svnimport' [ -o <branch-for-HEAD> ] [ -h ] [ -v ] [ -d | -D ]
|
'git-svnimport' [ -o <branch-for-HEAD> ] [ -h ] [ -v ] [ -d | -D ]
|
||||||
[ -C <GIT_repository> ] [ -i ] [ -u ] [-l limit_rev]
|
[ -C <GIT_repository> ] [ -i ] [ -u ] [-l limit_rev]
|
||||||
[ -b branch_subdir ] [ -t trunk_subdir ] [ -T tag_subdir ]
|
[ -b branch_subdir ] [ -T trunk_subdir ] [ -t tag_subdir ]
|
||||||
[ -s start_chg ] [ -m ] [ -M regex ]
|
[ -s start_chg ] [ -m ] [ -M regex ]
|
||||||
<SVN_repository_URL> [ <path> ]
|
<SVN_repository_URL> [ <path> ]
|
||||||
|
|
||||||
@ -40,17 +40,17 @@ OPTIONS
|
|||||||
-s <start_rev>::
|
-s <start_rev>::
|
||||||
Start importing at this SVN change number. The default is 1.
|
Start importing at this SVN change number. The default is 1.
|
||||||
+
|
+
|
||||||
When importing incementally, you might need to edit the .git/svn2git file.
|
When importing incrementally, you might need to edit the .git/svn2git file.
|
||||||
|
|
||||||
-i::
|
-i::
|
||||||
Import-only: don't perform a checkout after importing. This option
|
Import-only: don't perform a checkout after importing. This option
|
||||||
ensures the working directory and index remain untouched and will
|
ensures the working directory and index remain untouched and will
|
||||||
not create them if they do not exist.
|
not create them if they do not exist.
|
||||||
|
|
||||||
-t <trunk_subdir>::
|
-T <trunk_subdir>::
|
||||||
Name the SVN trunk. Default "trunk".
|
Name the SVN trunk. Default "trunk".
|
||||||
|
|
||||||
-T <tag_subdir>::
|
-t <tag_subdir>::
|
||||||
Name the SVN subdirectory for tags. Default "tags".
|
Name the SVN subdirectory for tags. Default "tags".
|
||||||
|
|
||||||
-b <branch_subdir>::
|
-b <branch_subdir>::
|
||||||
|
@ -422,7 +422,7 @@ gitlink:git-rev-parse[1]::
|
|||||||
gitlink:git-send-email[1]::
|
gitlink:git-send-email[1]::
|
||||||
Send patch e-mails out of "format-patch --mbox" output.
|
Send patch e-mails out of "format-patch --mbox" output.
|
||||||
|
|
||||||
gitlink:git-symbolic-refs[1]::
|
gitlink:git-symbolic-ref[1]::
|
||||||
Read and modify symbolic refs.
|
Read and modify symbolic refs.
|
||||||
|
|
||||||
gitlink:git-stripspace[1]::
|
gitlink:git-stripspace[1]::
|
||||||
|
@ -19,7 +19,7 @@ hash::
|
|||||||
In git's context, synonym to object name.
|
In git's context, synonym to object name.
|
||||||
|
|
||||||
object database::
|
object database::
|
||||||
Stores a set of "objects", and an individial object is identified
|
Stores a set of "objects", and an individual object is identified
|
||||||
by its object name. The objects usually live in `$GIT_DIR/objects/`.
|
by its object name. The objects usually live in `$GIT_DIR/objects/`.
|
||||||
|
|
||||||
blob object::
|
blob object::
|
||||||
|
@ -24,7 +24,7 @@ Then do
|
|||||||
git bisect bad master <- mark "master" as the bad state
|
git bisect bad master <- mark "master" as the bad state
|
||||||
git bisect good ORIG_HEAD <- mark ORIG_HEAD as good (or
|
git bisect good ORIG_HEAD <- mark ORIG_HEAD as good (or
|
||||||
whatever other known-good
|
whatever other known-good
|
||||||
thing you booted laste)
|
thing you booted last)
|
||||||
|
|
||||||
and at this point "git bisect" will churn for a while, and tell you what
|
and at this point "git bisect" will churn for a while, and tell you what
|
||||||
the mid-point between those two commits are, and check that state out as
|
the mid-point between those two commits are, and check that state out as
|
||||||
|
@ -21,7 +21,7 @@ outside world but sometimes useful for private repository.
|
|||||||
. You can be using `objects/info/alternates` mechanism, or
|
. You can be using `objects/info/alternates` mechanism, or
|
||||||
`$GIT_ALTERNATE_OBJECT_DIRECTORIES` mechanism to 'borrow'
|
`$GIT_ALTERNATE_OBJECT_DIRECTORIES` mechanism to 'borrow'
|
||||||
objects from other object stores. A repository with this kind
|
objects from other object stores. A repository with this kind
|
||||||
of incompete object store is not suitable to be published for
|
of incomplete object store is not suitable to be published for
|
||||||
use with dumb transports but otherwise is OK as long as
|
use with dumb transports but otherwise is OK as long as
|
||||||
`objects/info/alternates` points at the right object stores
|
`objects/info/alternates` points at the right object stores
|
||||||
it borrows from.
|
it borrows from.
|
||||||
@ -106,7 +106,7 @@ info/refs::
|
|||||||
up-to-date if the repository is published for dumb
|
up-to-date if the repository is published for dumb
|
||||||
transports. The `git-receive-pack` command, which is
|
transports. The `git-receive-pack` command, which is
|
||||||
run on a remote repository when you `git push` into it,
|
run on a remote repository when you `git push` into it,
|
||||||
runs `hooks/update` hook to help you achive this.
|
runs `hooks/update` hook to help you achieve this.
|
||||||
|
|
||||||
info/grafts::
|
info/grafts::
|
||||||
This file records fake commit ancestry information, to
|
This file records fake commit ancestry information, to
|
||||||
|
5
Makefile
5
Makefile
@ -55,7 +55,7 @@ all:
|
|||||||
# Define USE_STDEV below if you want git to care about the underlying device
|
# Define USE_STDEV below if you want git to care about the underlying device
|
||||||
# change being considered an inode change from the update-cache perspective.
|
# change being considered an inode change from the update-cache perspective.
|
||||||
|
|
||||||
GIT_VERSION = 1.0.0a
|
GIT_VERSION = 1.0.7
|
||||||
|
|
||||||
# CFLAGS and LDFLAGS are for the users to override from the command line.
|
# CFLAGS and LDFLAGS are for the users to override from the command line.
|
||||||
|
|
||||||
@ -397,6 +397,9 @@ $(patsubst %.py,%,$(SCRIPT_PYTHON)) : % : %.py
|
|||||||
git-cherry-pick: git-revert
|
git-cherry-pick: git-revert
|
||||||
cp $< $@
|
cp $< $@
|
||||||
|
|
||||||
|
# format-patch records GIT_VERSION
|
||||||
|
git-format-patch: Makefile
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(CC) -o $*.o -c $(ALL_CFLAGS) $<
|
$(CC) -o $*.o -c $(ALL_CFLAGS) $<
|
||||||
%.o: %.S
|
%.o: %.S
|
||||||
|
3
apply.c
3
apply.c
@ -1588,7 +1588,7 @@ static int try_create_file(const char *path, unsigned int mode, const char *buf,
|
|||||||
|
|
||||||
if (S_ISLNK(mode))
|
if (S_ISLNK(mode))
|
||||||
return symlink(buf, path);
|
return symlink(buf, path);
|
||||||
fd = open(path, O_CREAT | O_EXCL | O_WRONLY | O_TRUNC, (mode & 0100) ? 0777 : 0666);
|
fd = open(path, O_CREAT | O_EXCL | O_WRONLY, (mode & 0100) ? 0777 : 0666);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
return -1;
|
return -1;
|
||||||
while (size) {
|
while (size) {
|
||||||
@ -1635,6 +1635,7 @@ static void create_one_file(const char *path, unsigned mode, const char *buf, un
|
|||||||
}
|
}
|
||||||
if (errno != EEXIST)
|
if (errno != EEXIST)
|
||||||
break;
|
break;
|
||||||
|
++nr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
die("unable to write file %s mode %o", path, mode);
|
die("unable to write file %s mode %o", path, mode);
|
||||||
|
3
commit.c
3
commit.c
@ -560,6 +560,9 @@ void sort_in_topological_order(struct commit_list ** list)
|
|||||||
next = next->next;
|
next = next->next;
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!count)
|
||||||
|
return;
|
||||||
/* allocate an array to help sort the list */
|
/* allocate an array to help sort the list */
|
||||||
nodes = xcalloc(count, sizeof(*nodes));
|
nodes = xcalloc(count, sizeof(*nodes));
|
||||||
/* link the list to the array */
|
/* link the list to the array */
|
||||||
|
19
config.c
19
config.c
@ -409,8 +409,7 @@ int git_config_set_multivar(const char* key, const char* value,
|
|||||||
const char* value_regex, int multi_replace)
|
const char* value_regex, int multi_replace)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
struct stat st;
|
int fd, in_fd;
|
||||||
int fd;
|
|
||||||
char* config_filename = strdup(git_path("config"));
|
char* config_filename = strdup(git_path("config"));
|
||||||
char* lock_file = strdup(git_path("config.lock"));
|
char* lock_file = strdup(git_path("config.lock"));
|
||||||
const char* last_dot = strrchr(key, '.');
|
const char* last_dot = strrchr(key, '.');
|
||||||
@ -457,9 +456,17 @@ int git_config_set_multivar(const char* key, const char* value,
|
|||||||
/*
|
/*
|
||||||
* If .git/config does not exist yet, write a minimal version.
|
* If .git/config does not exist yet, write a minimal version.
|
||||||
*/
|
*/
|
||||||
if (stat(config_filename, &st)) {
|
in_fd = open(config_filename, O_RDONLY);
|
||||||
|
if ( in_fd < 0 ) {
|
||||||
free(store.key);
|
free(store.key);
|
||||||
|
|
||||||
|
if ( ENOENT != errno ) {
|
||||||
|
error("opening %s: %s", config_filename,
|
||||||
|
strerror(errno));
|
||||||
|
close(fd);
|
||||||
|
unlink(lock_file);
|
||||||
|
return 3; /* same as "invalid config file" */
|
||||||
|
}
|
||||||
/* if nothing to unset, error out */
|
/* if nothing to unset, error out */
|
||||||
if (value == NULL) {
|
if (value == NULL) {
|
||||||
close(fd);
|
close(fd);
|
||||||
@ -471,7 +478,7 @@ int git_config_set_multivar(const char* key, const char* value,
|
|||||||
store_write_section(fd, key);
|
store_write_section(fd, key);
|
||||||
store_write_pair(fd, key, value);
|
store_write_pair(fd, key, value);
|
||||||
} else{
|
} else{
|
||||||
int in_fd;
|
struct stat st;
|
||||||
char* contents;
|
char* contents;
|
||||||
int i, copy_begin, copy_end, new_line = 0;
|
int i, copy_begin, copy_end, new_line = 0;
|
||||||
|
|
||||||
@ -487,7 +494,7 @@ int git_config_set_multivar(const char* key, const char* value,
|
|||||||
store.value_regex = (regex_t*)malloc(sizeof(regex_t));
|
store.value_regex = (regex_t*)malloc(sizeof(regex_t));
|
||||||
if (regcomp(store.value_regex, value_regex,
|
if (regcomp(store.value_regex, value_regex,
|
||||||
REG_EXTENDED)) {
|
REG_EXTENDED)) {
|
||||||
fprintf(stderr, "Invalid pattern: %s",
|
fprintf(stderr, "Invalid pattern: %s\n",
|
||||||
value_regex);
|
value_regex);
|
||||||
free(store.value_regex);
|
free(store.value_regex);
|
||||||
return 6;
|
return 6;
|
||||||
@ -528,7 +535,7 @@ int git_config_set_multivar(const char* key, const char* value,
|
|||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
in_fd = open(config_filename, O_RDONLY, 0666);
|
fstat(in_fd, &st);
|
||||||
contents = mmap(NULL, st.st_size, PROT_READ,
|
contents = mmap(NULL, st.st_size, PROT_READ,
|
||||||
MAP_PRIVATE, in_fd, 0);
|
MAP_PRIVATE, in_fd, 0);
|
||||||
close(in_fd);
|
close(in_fd);
|
||||||
|
7
copy.c
7
copy.c
@ -22,13 +22,16 @@ int copy_fd(int ifd, int ofd)
|
|||||||
buf += written;
|
buf += written;
|
||||||
len -= written;
|
len -= written;
|
||||||
}
|
}
|
||||||
else if (!written)
|
else if (!written) {
|
||||||
|
close(ifd);
|
||||||
return error("copy-fd: write returned 0");
|
return error("copy-fd: write returned 0");
|
||||||
else
|
} else {
|
||||||
|
close(ifd);
|
||||||
return error("copy-fd: write returned %s",
|
return error("copy-fd: write returned %s",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
close(ifd);
|
close(ifd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
4
date.c
4
date.c
@ -326,7 +326,7 @@ static int match_digit(const char *date, struct tm *tm, int *offset, int *tm_gmt
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* NOTE! We will give precedence to day-of-month over month or
|
* NOTE! We will give precedence to day-of-month over month or
|
||||||
* year numebers in the 1-12 range. So 05 is always "mday 5",
|
* year numbers in the 1-12 range. So 05 is always "mday 5",
|
||||||
* unless we already have a mday..
|
* unless we already have a mday..
|
||||||
*
|
*
|
||||||
* IOW, 01 Apr 05 parses as "April 1st, 2005".
|
* IOW, 01 Apr 05 parses as "April 1st, 2005".
|
||||||
@ -640,7 +640,7 @@ unsigned long approxidate(const char *date)
|
|||||||
}
|
}
|
||||||
if (number > 0 && number < 32)
|
if (number > 0 && number < 32)
|
||||||
tm.tm_mday = number;
|
tm.tm_mday = number;
|
||||||
if (tm.tm_mon > now.tm_mon)
|
if (tm.tm_mon > now.tm_mon && tm.tm_year == now.tm_year)
|
||||||
tm.tm_year--;
|
tm.tm_year--;
|
||||||
return mktime(&tm);
|
return mktime(&tm);
|
||||||
}
|
}
|
||||||
|
18
debian/changelog
vendored
18
debian/changelog
vendored
@ -1,3 +1,21 @@
|
|||||||
|
git-core (1.0.4-0) unstable; urgency=low
|
||||||
|
|
||||||
|
* GIT 1.0.4.
|
||||||
|
|
||||||
|
-- Junio C Hamano <junkio@cox.net> Sat, 24 Dec 2005 00:01:20 -0800
|
||||||
|
|
||||||
|
git-core (1.0.3-0) unstable; urgency=low
|
||||||
|
|
||||||
|
* GIT 1.0.3 maintenance release.
|
||||||
|
|
||||||
|
-- Junio C Hamano <junkio@cox.net> Thu, 22 Dec 2005 18:13:33 -0800
|
||||||
|
|
||||||
|
git-core (1.0.0b-0) unstable; urgency=low
|
||||||
|
|
||||||
|
* GIT 1.0.0b to include two more fixes.
|
||||||
|
|
||||||
|
-- Junio C Hamano <junkio@cox.net> Wed, 21 Dec 2005 13:50:21 -0800
|
||||||
|
|
||||||
git-core (1.0.0a-0) unstable; urgency=low
|
git-core (1.0.0a-0) unstable; urgency=low
|
||||||
|
|
||||||
* GIT 1.0.0a to include the following fixes:
|
* GIT 1.0.0a to include the following fixes:
|
||||||
|
@ -116,7 +116,7 @@ static int diff_cache(struct cache_entry **ac, int entries, const char **pathspe
|
|||||||
/* We come here with ce pointing at stage 1
|
/* We come here with ce pointing at stage 1
|
||||||
* (original tree) and ac[1] pointing at stage
|
* (original tree) and ac[1] pointing at stage
|
||||||
* 3 (unmerged). show-modified with
|
* 3 (unmerged). show-modified with
|
||||||
* report-mising set to false does not say the
|
* report-missing set to false does not say the
|
||||||
* file is deleted but reports true if work
|
* file is deleted but reports true if work
|
||||||
* tree does not have it, in which case we
|
* tree does not have it, in which case we
|
||||||
* fall through to report the unmerged state.
|
* fall through to report the unmerged state.
|
||||||
|
10
diff.c
10
diff.c
@ -504,9 +504,9 @@ static void prepare_temp_file(const char *name,
|
|||||||
}
|
}
|
||||||
if (S_ISLNK(st.st_mode)) {
|
if (S_ISLNK(st.st_mode)) {
|
||||||
int ret;
|
int ret;
|
||||||
char *buf, buf_[1024];
|
char buf[PATH_MAX + 1]; /* ought to be SYMLINK_MAX */
|
||||||
buf = ((sizeof(buf_) < st.st_size) ?
|
if (sizeof(buf) <= st.st_size)
|
||||||
xmalloc(st.st_size) : buf_);
|
die("symlink too long: %s", name);
|
||||||
ret = readlink(name, buf, st.st_size);
|
ret = readlink(name, buf, st.st_size);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
die("readlink(%s)", name);
|
die("readlink(%s)", name);
|
||||||
@ -650,7 +650,7 @@ static void diff_fill_sha1_info(struct diff_filespec *one)
|
|||||||
if (DIFF_FILE_VALID(one)) {
|
if (DIFF_FILE_VALID(one)) {
|
||||||
if (!one->sha1_valid) {
|
if (!one->sha1_valid) {
|
||||||
struct stat st;
|
struct stat st;
|
||||||
if (stat(one->path, &st) < 0)
|
if (lstat(one->path, &st) < 0)
|
||||||
die("stat %s", one->path);
|
die("stat %s", one->path);
|
||||||
if (index_path(one->sha1, one->path, &st, 0))
|
if (index_path(one->sha1, one->path, &st, 0))
|
||||||
die("cannot hash %s\n", one->path);
|
die("cannot hash %s\n", one->path);
|
||||||
@ -787,7 +787,7 @@ int diff_setup_done(struct diff_options *options)
|
|||||||
* so it is safe for us to do this here. Also
|
* so it is safe for us to do this here. Also
|
||||||
* it does not smudge active_cache or active_nr
|
* it does not smudge active_cache or active_nr
|
||||||
* when it fails, so we do not have to worry about
|
* when it fails, so we do not have to worry about
|
||||||
* cleaning it up oufselves either.
|
* cleaning it up ourselves either.
|
||||||
*/
|
*/
|
||||||
read_cache();
|
read_cache();
|
||||||
}
|
}
|
||||||
|
@ -105,9 +105,13 @@ static int compare_pair_order(const void *a_, const void *b_)
|
|||||||
void diffcore_order(const char *orderfile)
|
void diffcore_order(const char *orderfile)
|
||||||
{
|
{
|
||||||
struct diff_queue_struct *q = &diff_queued_diff;
|
struct diff_queue_struct *q = &diff_queued_diff;
|
||||||
struct pair_order *o = xmalloc(sizeof(*o) * q->nr);
|
struct pair_order *o;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (!q->nr)
|
||||||
|
return;
|
||||||
|
|
||||||
|
o = xmalloc(sizeof(*o) * q->nr);
|
||||||
prepare_order(orderfile);
|
prepare_order(orderfile);
|
||||||
for (i = 0; i < q->nr; i++) {
|
for (i = 0; i < q->nr; i++) {
|
||||||
o[i].pair = q->queue[i];
|
o[i].pair = q->queue[i];
|
||||||
|
@ -48,6 +48,9 @@ void diffcore_pathspec(const char **pathspec)
|
|||||||
for (i = 0; pathspec[i]; i++)
|
for (i = 0; pathspec[i]; i++)
|
||||||
;
|
;
|
||||||
speccnt = i;
|
speccnt = i;
|
||||||
|
if (!speccnt)
|
||||||
|
return;
|
||||||
|
|
||||||
spec = xmalloc(sizeof(*spec) * speccnt);
|
spec = xmalloc(sizeof(*spec) * speccnt);
|
||||||
for (i = 0; pathspec[i]; i++) {
|
for (i = 0; pathspec[i]; i++) {
|
||||||
spec[i].spec = pathspec[i];
|
spec[i].spec = pathspec[i];
|
||||||
|
@ -282,7 +282,7 @@ void diffcore_rename(struct diff_options *options)
|
|||||||
else if (detect_rename == DIFF_DETECT_COPY)
|
else if (detect_rename == DIFF_DETECT_COPY)
|
||||||
register_rename_src(p->one, 1);
|
register_rename_src(p->one, 1);
|
||||||
}
|
}
|
||||||
if (rename_dst_nr == 0 ||
|
if (rename_dst_nr == 0 || rename_src_nr == 0 ||
|
||||||
(0 < rename_limit && rename_limit < rename_dst_nr))
|
(0 < rename_limit && rename_limit < rename_dst_nr))
|
||||||
goto cleanup; /* nothing to do */
|
goto cleanup; /* nothing to do */
|
||||||
|
|
||||||
|
2
entry.c
2
entry.c
@ -60,7 +60,7 @@ static void remove_subtree(const char *path)
|
|||||||
static int create_file(const char *path, unsigned int mode)
|
static int create_file(const char *path, unsigned int mode)
|
||||||
{
|
{
|
||||||
mode = (mode & 0100) ? 0777 : 0666;
|
mode = (mode & 0100) ? 0777 : 0666;
|
||||||
return open(path, O_WRONLY | O_TRUNC | O_CREAT | O_EXCL, mode);
|
return open(path, O_WRONLY | O_CREAT | O_EXCL, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int write_entry(struct cache_entry *ce, const char *path, struct checkout *state)
|
static int write_entry(struct cache_entry *ce, const char *path, struct checkout *state)
|
||||||
|
2
epoch.c
2
epoch.c
@ -190,7 +190,7 @@ static void free_mass_counter(struct mass_counter *counter)
|
|||||||
* enqueued, enqueuing the commit in a list of pending commits, in latest
|
* enqueued, enqueuing the commit in a list of pending commits, in latest
|
||||||
* commit date first order.
|
* commit date first order.
|
||||||
*
|
*
|
||||||
* The algorithm then preceeds to visit each commit in the pending queue.
|
* The algorithm then proceeds to visit each commit in the pending queue.
|
||||||
* Upon each visit, the pending mass is added to the mass already seen for that
|
* Upon each visit, the pending mass is added to the mass already seen for that
|
||||||
* commit and then divided into N equal portions, where N is the number of
|
* commit and then divided into N equal portions, where N is the number of
|
||||||
* parents of the commit being visited. The divided portions are then injected
|
* parents of the commit being visited. The divided portions are then injected
|
||||||
|
@ -47,7 +47,7 @@ static int finish_pack(const char *pack_tmp_name, const char *me)
|
|||||||
if (retval < 0) {
|
if (retval < 0) {
|
||||||
if (errno == EINTR)
|
if (errno == EINTR)
|
||||||
continue;
|
continue;
|
||||||
error("waitpid failed (%s)", strerror(retval));
|
error("waitpid failed (%s)", strerror(errno));
|
||||||
goto error_die;
|
goto error_die;
|
||||||
}
|
}
|
||||||
if (WIFSIGNALED(status)) {
|
if (WIFSIGNALED(status)) {
|
||||||
|
@ -148,7 +148,7 @@ esac
|
|||||||
|
|
||||||
if [ -f "$GIT_DIR/MERGE_HEAD" ]; then
|
if [ -f "$GIT_DIR/MERGE_HEAD" ]; then
|
||||||
echo "#"
|
echo "#"
|
||||||
echo "# It looks like your may be committing a MERGE."
|
echo "# It looks like you may be committing a MERGE."
|
||||||
echo "# If this is not correct, please remove the file"
|
echo "# If this is not correct, please remove the file"
|
||||||
echo "# $GIT_DIR/MERGE_HEAD"
|
echo "# $GIT_DIR/MERGE_HEAD"
|
||||||
echo "# and try again"
|
echo "# and try again"
|
||||||
@ -165,6 +165,7 @@ then
|
|||||||
then
|
then
|
||||||
pick_author_script='
|
pick_author_script='
|
||||||
/^author /{
|
/^author /{
|
||||||
|
s/'\''/'\''\\'\'\''/g
|
||||||
h
|
h
|
||||||
s/^author \([^<]*\) <[^>]*> .*$/\1/
|
s/^author \([^<]*\) <[^>]*> .*$/\1/
|
||||||
s/'\''/'\''\'\'\''/g
|
s/'\''/'\''\'\'\''/g
|
||||||
|
@ -63,6 +63,8 @@ extern char *gitstrcasestr(const char *haystack, const char *needle);
|
|||||||
static inline void *xmalloc(size_t size)
|
static inline void *xmalloc(size_t size)
|
||||||
{
|
{
|
||||||
void *ret = malloc(size);
|
void *ret = malloc(size);
|
||||||
|
if (!ret && !size)
|
||||||
|
ret = malloc(1);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
die("Out of memory, malloc failed");
|
die("Out of memory, malloc failed");
|
||||||
return ret;
|
return ret;
|
||||||
@ -71,6 +73,8 @@ static inline void *xmalloc(size_t size)
|
|||||||
static inline void *xrealloc(void *ptr, size_t size)
|
static inline void *xrealloc(void *ptr, size_t size)
|
||||||
{
|
{
|
||||||
void *ret = realloc(ptr, size);
|
void *ret = realloc(ptr, size);
|
||||||
|
if (!ret && !size)
|
||||||
|
ret = realloc(ptr, 1);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
die("Out of memory, realloc failed");
|
die("Out of memory, realloc failed");
|
||||||
return ret;
|
return ret;
|
||||||
@ -79,6 +83,8 @@ static inline void *xrealloc(void *ptr, size_t size)
|
|||||||
static inline void *xcalloc(size_t nmemb, size_t size)
|
static inline void *xcalloc(size_t nmemb, size_t size)
|
||||||
{
|
{
|
||||||
void *ret = calloc(nmemb, size);
|
void *ret = calloc(nmemb, size);
|
||||||
|
if (!ret && (!nmemb || !size))
|
||||||
|
ret = calloc(1, 1);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
die("Out of memory, calloc failed");
|
die("Out of memory, calloc failed");
|
||||||
return ret;
|
return ret;
|
||||||
|
19
git-fetch.sh
19
git-fetch.sh
@ -188,11 +188,20 @@ esac
|
|||||||
reflist=$(get_remote_refs_for_fetch "$@")
|
reflist=$(get_remote_refs_for_fetch "$@")
|
||||||
if test "$tags"
|
if test "$tags"
|
||||||
then
|
then
|
||||||
taglist=$(git-ls-remote --tags "$remote" |
|
taglist=$(IFS=" " &&
|
||||||
sed -e '
|
git-ls-remote --tags "$remote" |
|
||||||
/\^/d
|
while read sha1 name
|
||||||
s/^[^ ]* //
|
do
|
||||||
s/.*/&:&/')
|
case "$name" in
|
||||||
|
(*^*) continue ;;
|
||||||
|
esac
|
||||||
|
if git-check-ref-format "$name"
|
||||||
|
then
|
||||||
|
echo ".${name}:${name}"
|
||||||
|
else
|
||||||
|
echo >&2 "warning: tag ${name} ignored"
|
||||||
|
fi
|
||||||
|
done)
|
||||||
if test "$#" -gt 1
|
if test "$#" -gt 1
|
||||||
then
|
then
|
||||||
# remote URL plus explicit refspecs; we need to merge them.
|
# remote URL plus explicit refspecs; we need to merge them.
|
||||||
|
@ -173,6 +173,7 @@ titleScript='
|
|||||||
|
|
||||||
whosepatchScript='
|
whosepatchScript='
|
||||||
/^author /{
|
/^author /{
|
||||||
|
s/'\''/'\''\\'\'\''/g
|
||||||
s/author \(.*>\) \(.*\)$/au='\''\1'\'' ad='\''\2'\''/p
|
s/author \(.*>\) \(.*\)$/au='\''\1'\'' ad='\''\2'\''/p
|
||||||
q
|
q
|
||||||
}'
|
}'
|
||||||
|
@ -82,7 +82,7 @@ case "${1:-.}${2:-.}${3:-.}" in
|
|||||||
expr "$sz0" \< "$sz1" \* 2 >/dev/null || : >$orig
|
expr "$sz0" \< "$sz1" \* 2 >/dev/null || : >$orig
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Auto-merging $4."
|
echo "Auto-merging $4"
|
||||||
orig=`git-unpack-file $1`
|
orig=`git-unpack-file $1`
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@ -107,7 +107,7 @@ case "${1:-.}${2:-.}${3:-.}" in
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $ret -ne 0 ]; then
|
if [ $ret -ne 0 ]; then
|
||||||
echo "ERROR: Merge conflict in $4."
|
echo "ERROR: Merge conflict in $4"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
exec git-update-index -- "$4"
|
exec git-update-index -- "$4"
|
||||||
|
11
git-merge.sh
11
git-merge.sh
@ -209,6 +209,7 @@ case "$use_strategies" in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
result_tree= best_cnt=-1 best_strategy= wt_strategy=
|
result_tree= best_cnt=-1 best_strategy= wt_strategy=
|
||||||
|
merge_was_ok=
|
||||||
for strategy in $use_strategies
|
for strategy in $use_strategies
|
||||||
do
|
do
|
||||||
test "$wt_strategy" = '' || {
|
test "$wt_strategy" = '' || {
|
||||||
@ -228,6 +229,7 @@ do
|
|||||||
exit=$?
|
exit=$?
|
||||||
if test "$no_commit" = t && test "$exit" = 0
|
if test "$no_commit" = t && test "$exit" = 0
|
||||||
then
|
then
|
||||||
|
merge_was_ok=t
|
||||||
exit=1 ;# pretend it left conflicts.
|
exit=1 ;# pretend it left conflicts.
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -293,4 +295,11 @@ do
|
|||||||
done >"$GIT_DIR/MERGE_HEAD"
|
done >"$GIT_DIR/MERGE_HEAD"
|
||||||
echo $merge_msg >"$GIT_DIR/MERGE_MSG"
|
echo $merge_msg >"$GIT_DIR/MERGE_MSG"
|
||||||
|
|
||||||
die "Automatic merge failed/prevented; fix up by hand"
|
if test "$merge_was_ok" = t
|
||||||
|
then
|
||||||
|
echo >&2 \
|
||||||
|
"Automatic merge went well; stopped before committing as requested"
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
die "Automatic merge failed; fix up by hand"
|
||||||
|
fi
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
USAGE='[--mixed | --soft | --hard] [<commit-ish>]'
|
USAGE='[--mixed | --soft | --hard] [<commit-ish>]'
|
||||||
. git-sh-setup
|
. git-sh-setup
|
||||||
|
|
||||||
tmp=/var/tmp/reset.$$
|
tmp=${GIT_DIR}/reset.$$
|
||||||
trap 'rm -f $tmp-*' 0 1 2 3 15
|
trap 'rm -f $tmp-*' 0 1 2 3 15
|
||||||
|
|
||||||
reset_type=--mixed
|
reset_type=--mixed
|
||||||
|
@ -96,8 +96,10 @@ sub new {
|
|||||||
sub conn {
|
sub conn {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $repo = $self->{'fullrep'};
|
my $repo = $self->{'fullrep'};
|
||||||
my $s = SVN::Ra->new($repo);
|
my $auth = SVN::Core::auth_open ([SVN::Client::get_simple_provider,
|
||||||
|
SVN::Client::get_ssl_server_trust_file_provider,
|
||||||
|
SVN::Client::get_username_provider]);
|
||||||
|
my $s = SVN::Ra->new(url => $repo, auth => $auth);
|
||||||
die "SVN connection to $repo: $!\n" unless defined $s;
|
die "SVN connection to $repo: $!\n" unless defined $s;
|
||||||
$self->{'svn'} = $s;
|
$self->{'svn'} = $s;
|
||||||
$self->{'repo'} = $repo;
|
$self->{'repo'} = $repo;
|
||||||
|
7
git.c
7
git.c
@ -244,6 +244,11 @@ int main(int argc, char **argv, char **envp)
|
|||||||
for (i = 1; i < argc; i++) {
|
for (i = 1; i < argc; i++) {
|
||||||
char *arg = argv[i];
|
char *arg = argv[i];
|
||||||
|
|
||||||
|
if (!strcmp(arg, "help")) {
|
||||||
|
show_help = 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (strncmp(arg, "--", 2))
|
if (strncmp(arg, "--", 2))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -278,7 +283,7 @@ int main(int argc, char **argv, char **envp)
|
|||||||
if (*exec_path != '/') {
|
if (*exec_path != '/') {
|
||||||
if (!getcwd(git_command, sizeof(git_command))) {
|
if (!getcwd(git_command, sizeof(git_command))) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"git: cannot determine current directory");
|
"git: cannot determine current directory\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
len = strlen(git_command);
|
len = strlen(git_command);
|
||||||
|
12
http-fetch.c
12
http-fetch.c
@ -267,7 +267,8 @@ static void process_object_response(void *callback_data)
|
|||||||
obj_req->state = COMPLETE;
|
obj_req->state = COMPLETE;
|
||||||
|
|
||||||
/* Use alternates if necessary */
|
/* Use alternates if necessary */
|
||||||
if (obj_req->http_code == 404) {
|
if (obj_req->http_code == 404 ||
|
||||||
|
obj_req->curl_result == CURLE_FILE_COULDNT_READ_FILE) {
|
||||||
fetch_alternates(alt->base);
|
fetch_alternates(alt->base);
|
||||||
if (obj_req->repo->next != NULL) {
|
if (obj_req->repo->next != NULL) {
|
||||||
obj_req->repo =
|
obj_req->repo =
|
||||||
@ -475,7 +476,8 @@ static void process_alternates_response(void *callback_data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (slot->curl_result != CURLE_OK) {
|
} else if (slot->curl_result != CURLE_OK) {
|
||||||
if (slot->http_code != 404) {
|
if (slot->http_code != 404 &&
|
||||||
|
slot->curl_result != CURLE_FILE_COULDNT_READ_FILE) {
|
||||||
got_alternates = -1;
|
got_alternates = -1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -637,7 +639,8 @@ static int fetch_indices(struct alt_base *repo)
|
|||||||
if (start_active_slot(slot)) {
|
if (start_active_slot(slot)) {
|
||||||
run_active_slot(slot);
|
run_active_slot(slot);
|
||||||
if (slot->curl_result != CURLE_OK) {
|
if (slot->curl_result != CURLE_OK) {
|
||||||
if (slot->http_code == 404) {
|
if (slot->http_code == 404 ||
|
||||||
|
slot->curl_result == CURLE_FILE_COULDNT_READ_FILE) {
|
||||||
repo->got_indices = 1;
|
repo->got_indices = 1;
|
||||||
free(buffer.buffer);
|
free(buffer.buffer);
|
||||||
return 0;
|
return 0;
|
||||||
@ -802,7 +805,8 @@ static int fetch_object(struct alt_base *repo, unsigned char *sha1)
|
|||||||
ret = error("Request for %s aborted", hex);
|
ret = error("Request for %s aborted", hex);
|
||||||
} else if (obj_req->curl_result != CURLE_OK &&
|
} else if (obj_req->curl_result != CURLE_OK &&
|
||||||
obj_req->http_code != 416) {
|
obj_req->http_code != 416) {
|
||||||
if (obj_req->http_code == 404)
|
if (obj_req->http_code == 404 ||
|
||||||
|
obj_req->curl_result == CURLE_FILE_COULDNT_READ_FILE)
|
||||||
ret = -1; /* Be silent, it is probably in a pack. */
|
ret = -1; /* Be silent, it is probably in a pack. */
|
||||||
else
|
else
|
||||||
ret = error("%s (curl_result = %d, http_code = %ld, sha1 = %s)",
|
ret = error("%s (curl_result = %d, http_code = %ld, sha1 = %s)",
|
||||||
|
2
ident.c
2
ident.c
@ -140,7 +140,7 @@ static int copy(char *buf, int size, int offset, const char *src)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Copy the rest to the buffer, but avoid the special
|
* Copy the rest to the buffer, but avoid the special
|
||||||
* characters '\n' '<' and '>' that act as delimeters on
|
* characters '\n' '<' and '>' that act as delimiters on
|
||||||
* a identification line
|
* a identification line
|
||||||
*/
|
*/
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
|
14
index-pack.c
14
index-pack.c
@ -352,19 +352,25 @@ static int sha1_compare(const void *_a, const void *_b)
|
|||||||
static void write_index_file(const char *index_name, unsigned char *sha1)
|
static void write_index_file(const char *index_name, unsigned char *sha1)
|
||||||
{
|
{
|
||||||
struct sha1file *f;
|
struct sha1file *f;
|
||||||
struct object_entry **sorted_by_sha =
|
struct object_entry **sorted_by_sha, **list, **last;
|
||||||
xcalloc(nr_objects, sizeof(struct object_entry *));
|
|
||||||
struct object_entry **list = sorted_by_sha;
|
|
||||||
struct object_entry **last = sorted_by_sha + nr_objects;
|
|
||||||
unsigned int array[256];
|
unsigned int array[256];
|
||||||
int i;
|
int i;
|
||||||
SHA_CTX ctx;
|
SHA_CTX ctx;
|
||||||
|
|
||||||
|
if (nr_objects) {
|
||||||
|
sorted_by_sha =
|
||||||
|
xcalloc(nr_objects, sizeof(struct object_entry *));
|
||||||
|
list = sorted_by_sha;
|
||||||
|
last = sorted_by_sha + nr_objects;
|
||||||
for (i = 0; i < nr_objects; ++i)
|
for (i = 0; i < nr_objects; ++i)
|
||||||
sorted_by_sha[i] = &objects[i];
|
sorted_by_sha[i] = &objects[i];
|
||||||
qsort(sorted_by_sha, nr_objects, sizeof(sorted_by_sha[0]),
|
qsort(sorted_by_sha, nr_objects, sizeof(sorted_by_sha[0]),
|
||||||
sha1_compare);
|
sha1_compare);
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
sorted_by_sha = list = last = NULL;
|
||||||
|
|
||||||
unlink(index_name);
|
unlink(index_name);
|
||||||
f = sha1create("%s", index_name);
|
f = sha1create("%s", index_name);
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@ static int excluded_1(const char *pathname,
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* match with FNM_PATHNAME:
|
/* match with FNM_PATHNAME:
|
||||||
* exclude has base (baselen long) inplicitly
|
* exclude has base (baselen long) implicitly
|
||||||
* in front of it.
|
* in front of it.
|
||||||
*/
|
*/
|
||||||
int baselen = x->baselen;
|
int baselen = x->baselen;
|
||||||
@ -562,7 +562,7 @@ static void verify_pathspec(void)
|
|||||||
static const char ls_files_usage[] =
|
static const char ls_files_usage[] =
|
||||||
"git-ls-files [-z] [-t] (--[cached|deleted|others|stage|unmerged|killed|modified])* "
|
"git-ls-files [-z] [-t] (--[cached|deleted|others|stage|unmerged|killed|modified])* "
|
||||||
"[ --ignored ] [--exclude=<pattern>] [--exclude-from=<file>] "
|
"[ --ignored ] [--exclude=<pattern>] [--exclude-from=<file>] "
|
||||||
"[ --exclude-per-directory=<filename> ] [--] [<file>]*";
|
"[ --exclude-per-directory=<filename> ] [--full-name] [--] [<file>]*";
|
||||||
|
|
||||||
int main(int argc, const char **argv)
|
int main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
|
@ -472,7 +472,7 @@ static void convert_to_utf8(char *line, char *charset)
|
|||||||
char *in, *out;
|
char *in, *out;
|
||||||
size_t insize, outsize, nrc;
|
size_t insize, outsize, nrc;
|
||||||
char outbuf[4096]; /* cheat */
|
char outbuf[4096]; /* cheat */
|
||||||
static char latin_one[] = "latin-1";
|
static char latin_one[] = "latin1";
|
||||||
char *input_charset = *charset ? charset : latin_one;
|
char *input_charset = *charset ? charset : latin_one;
|
||||||
iconv_t conv = iconv_open(metainfo_charset, input_charset);
|
iconv_t conv = iconv_open(metainfo_charset, input_charset);
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ static unsigned long write_one(struct sha1file *f,
|
|||||||
return offset;
|
return offset;
|
||||||
e->offset = offset;
|
e->offset = offset;
|
||||||
offset += write_object(f, e);
|
offset += write_object(f, e);
|
||||||
/* if we are delitified, write out its base object. */
|
/* if we are deltified, write out its base object. */
|
||||||
if (e->delta)
|
if (e->delta)
|
||||||
offset = write_one(f, e->delta, offset);
|
offset = write_one(f, e->delta, offset);
|
||||||
return offset;
|
return offset;
|
||||||
|
6
quote.c
6
quote.c
@ -126,8 +126,10 @@ static int quote_c_style_counted(const char *name, int namelen,
|
|||||||
|
|
||||||
if (!no_dq)
|
if (!no_dq)
|
||||||
EMIT('"');
|
EMIT('"');
|
||||||
for (sp = name; (ch = *sp++) && (sp - name) <= namelen; ) {
|
for (sp = name; sp < name + namelen; sp++) {
|
||||||
|
ch = *sp;
|
||||||
|
if (!ch)
|
||||||
|
break;
|
||||||
if ((ch < ' ') || (ch == '"') || (ch == '\\') ||
|
if ((ch < ' ') || (ch == '"') || (ch == '\\') ||
|
||||||
(ch == 0177)) {
|
(ch == 0177)) {
|
||||||
needquote = 1;
|
needquote = 1;
|
||||||
|
@ -294,17 +294,20 @@ static int unpack_trees(merge_fn_t fn)
|
|||||||
{
|
{
|
||||||
int indpos = 0;
|
int indpos = 0;
|
||||||
unsigned len = object_list_length(trees);
|
unsigned len = object_list_length(trees);
|
||||||
struct tree_entry_list **posns =
|
struct tree_entry_list **posns;
|
||||||
xmalloc(len * sizeof(struct tree_entry_list *));
|
|
||||||
int i;
|
int i;
|
||||||
struct object_list *posn = trees;
|
struct object_list *posn = trees;
|
||||||
merge_size = len;
|
merge_size = len;
|
||||||
|
|
||||||
|
if (len) {
|
||||||
|
posns = xmalloc(len * sizeof(struct tree_entry_list *));
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
posns[i] = ((struct tree *) posn->item)->entries;
|
posns[i] = ((struct tree *) posn->item)->entries;
|
||||||
posn = posn->next;
|
posn = posn->next;
|
||||||
}
|
}
|
||||||
if (unpack_trees_rec(posns, len, "", fn, &indpos))
|
if (unpack_trees_rec(posns, len, "", fn, &indpos))
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (trivial_merges_only && nontrivial_merge)
|
if (trivial_merges_only && nontrivial_merge)
|
||||||
die("Merge requires file-level merging");
|
die("Merge requires file-level merging");
|
||||||
|
@ -79,7 +79,7 @@ static int run_update_hook(const char *refname,
|
|||||||
case -ERR_RUN_COMMAND_WAITPID_WRONG_PID:
|
case -ERR_RUN_COMMAND_WAITPID_WRONG_PID:
|
||||||
die("waitpid is confused");
|
die("waitpid is confused");
|
||||||
case -ERR_RUN_COMMAND_WAITPID_SIGNAL:
|
case -ERR_RUN_COMMAND_WAITPID_SIGNAL:
|
||||||
fprintf(stderr, "%s died of signal", update_hook);
|
fprintf(stderr, "%s died of signal\n", update_hook);
|
||||||
return -1;
|
return -1;
|
||||||
case -ERR_RUN_COMMAND_WAITPID_NOEXIT:
|
case -ERR_RUN_COMMAND_WAITPID_NOEXIT:
|
||||||
die("%s died strangely", update_hook);
|
die("%s died strangely", update_hook);
|
||||||
|
@ -6,7 +6,7 @@ static const char git_config_set_usage[] =
|
|||||||
|
|
||||||
static char* key = NULL;
|
static char* key = NULL;
|
||||||
static char* value = NULL;
|
static char* value = NULL;
|
||||||
static regex_t* regex = NULL;
|
static regex_t* regexp = NULL;
|
||||||
static int do_all = 0;
|
static int do_all = 0;
|
||||||
static int do_not_match = 0;
|
static int do_not_match = 0;
|
||||||
static int seen = 0;
|
static int seen = 0;
|
||||||
@ -14,9 +14,9 @@ static int seen = 0;
|
|||||||
static int show_config(const char* key_, const char* value_)
|
static int show_config(const char* key_, const char* value_)
|
||||||
{
|
{
|
||||||
if (!strcmp(key_, key) &&
|
if (!strcmp(key_, key) &&
|
||||||
(regex == NULL ||
|
(regexp == NULL ||
|
||||||
(do_not_match ^
|
(do_not_match ^
|
||||||
!regexec(regex, value_, 0, NULL, 0)))) {
|
!regexec(regexp, value_, 0, NULL, 0)))) {
|
||||||
if (do_all) {
|
if (do_all) {
|
||||||
printf("%s\n", value_);
|
printf("%s\n", value_);
|
||||||
return 0;
|
return 0;
|
||||||
@ -46,8 +46,8 @@ static int get_value(const char* key_, const char* regex_)
|
|||||||
regex_++;
|
regex_++;
|
||||||
}
|
}
|
||||||
|
|
||||||
regex = (regex_t*)malloc(sizeof(regex_t));
|
regexp = (regex_t*)malloc(sizeof(regex_t));
|
||||||
if (regcomp(regex, regex_, REG_EXTENDED)) {
|
if (regcomp(regexp, regex_, REG_EXTENDED)) {
|
||||||
fprintf(stderr, "Invalid pattern: %s\n", regex_);
|
fprintf(stderr, "Invalid pattern: %s\n", regex_);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -59,9 +59,9 @@ static int get_value(const char* key_, const char* regex_)
|
|||||||
free(value);
|
free(value);
|
||||||
}
|
}
|
||||||
free(key);
|
free(key);
|
||||||
if (regex) {
|
if (regexp) {
|
||||||
regfree(regex);
|
regfree(regexp);
|
||||||
free(regex);
|
free(regexp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (do_all)
|
if (do_all)
|
||||||
|
30
send-pack.c
30
send-pack.c
@ -231,23 +231,21 @@ static int send_pack(int in, int out, int nr_refspec, char **refspec)
|
|||||||
if (!force_update &&
|
if (!force_update &&
|
||||||
!is_zero_sha1(ref->old_sha1) &&
|
!is_zero_sha1(ref->old_sha1) &&
|
||||||
!ref->force) {
|
!ref->force) {
|
||||||
if (!has_sha1_file(ref->old_sha1)) {
|
if (!has_sha1_file(ref->old_sha1) ||
|
||||||
error("remote '%s' object %s does not "
|
!ref_newer(ref->peer_ref->new_sha1,
|
||||||
"exist on local",
|
|
||||||
ref->name, sha1_to_hex(ref->old_sha1));
|
|
||||||
ret = -2;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* We assume that local is fsck-clean. Otherwise
|
|
||||||
* you _could_ have an old tag which points at
|
|
||||||
* something you do not have, which may or may not
|
|
||||||
* be a commit.
|
|
||||||
*/
|
|
||||||
if (!ref_newer(ref->peer_ref->new_sha1,
|
|
||||||
ref->old_sha1)) {
|
ref->old_sha1)) {
|
||||||
error("remote ref '%s' is not a strict "
|
/* We do not have the remote ref, or
|
||||||
"subset of local ref '%s'.", ref->name,
|
* we know that the remote ref is not
|
||||||
|
* an ancestor of what we are trying to
|
||||||
|
* push. Either way this can be losing
|
||||||
|
* commits at the remote end and likely
|
||||||
|
* we were not up to date to begin with.
|
||||||
|
*/
|
||||||
|
error("remote '%s' is not a strict "
|
||||||
|
"subset of local ref '%s'. "
|
||||||
|
"maybe you are not up-to-date and "
|
||||||
|
"need to pull first?",
|
||||||
|
ref->name,
|
||||||
ref->peer_ref->name);
|
ref->peer_ref->name);
|
||||||
ret = -2;
|
ret = -2;
|
||||||
continue;
|
continue;
|
||||||
|
@ -99,7 +99,10 @@ static int read_pack_info_file(const char *infofile)
|
|||||||
while (fgets(line, sizeof(line), fp)) {
|
while (fgets(line, sizeof(line), fp)) {
|
||||||
int len = strlen(line);
|
int len = strlen(line);
|
||||||
if (line[len-1] == '\n')
|
if (line[len-1] == '\n')
|
||||||
line[len-1] = 0;
|
line[--len] = 0;
|
||||||
|
|
||||||
|
if (!len)
|
||||||
|
continue;
|
||||||
|
|
||||||
switch (line[0]) {
|
switch (line[0]) {
|
||||||
case 'P': /* P name */
|
case 'P': /* P name */
|
||||||
|
28
sha1_file.c
28
sha1_file.c
@ -81,6 +81,8 @@ char * sha1_to_hex(const unsigned char *sha1)
|
|||||||
*buf++ = hex[val >> 4];
|
*buf++ = hex[val >> 4];
|
||||||
*buf++ = hex[val & 0xf];
|
*buf++ = hex[val & 0xf];
|
||||||
}
|
}
|
||||||
|
*buf = '\0';
|
||||||
|
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -319,12 +321,16 @@ struct packed_git *packed_git;
|
|||||||
static int check_packed_git_idx(const char *path, unsigned long *idx_size_,
|
static int check_packed_git_idx(const char *path, unsigned long *idx_size_,
|
||||||
void **idx_map_)
|
void **idx_map_)
|
||||||
{
|
{
|
||||||
|
SHA_CTX ctx;
|
||||||
|
unsigned char sha1[20];
|
||||||
void *idx_map;
|
void *idx_map;
|
||||||
unsigned int *index;
|
unsigned int *index;
|
||||||
unsigned long idx_size;
|
unsigned long idx_size;
|
||||||
int nr, i;
|
int nr, i;
|
||||||
int fd = open(path, O_RDONLY);
|
int fd;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
||||||
|
fd = open(path, O_RDONLY);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (fstat(fd, &st)) {
|
if (fstat(fd, &st)) {
|
||||||
@ -362,6 +368,16 @@ static int check_packed_git_idx(const char *path, unsigned long *idx_size_,
|
|||||||
if (idx_size != 4*256 + nr * 24 + 20 + 20)
|
if (idx_size != 4*256 + nr * 24 + 20 + 20)
|
||||||
return error("wrong index file size");
|
return error("wrong index file size");
|
||||||
|
|
||||||
|
/*
|
||||||
|
* File checksum.
|
||||||
|
*/
|
||||||
|
SHA1_Init(&ctx);
|
||||||
|
SHA1_Update(&ctx, idx_map, idx_size-20);
|
||||||
|
SHA1_Final(sha1, &ctx);
|
||||||
|
|
||||||
|
if (memcmp(sha1, idx_map + idx_size - 20, 20))
|
||||||
|
return error("index checksum mismatch");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -464,7 +480,7 @@ struct packed_git *add_packed_git(char *path, int path_len, int local)
|
|||||||
p->pack_last_used = 0;
|
p->pack_last_used = 0;
|
||||||
p->pack_use_cnt = 0;
|
p->pack_use_cnt = 0;
|
||||||
p->pack_local = local;
|
p->pack_local = local;
|
||||||
if (!get_sha1_hex(path + path_len - 40 - 4, sha1))
|
if ((path_len > 44) && !get_sha1_hex(path + path_len - 44, sha1))
|
||||||
memcpy(p->sha1, sha1, 20);
|
memcpy(p->sha1, sha1, 20);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
@ -1274,7 +1290,7 @@ int move_temp_to_file(const char *tmpfile, char *filename)
|
|||||||
unlink(tmpfile);
|
unlink(tmpfile);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
if (ret != EEXIST) {
|
if (ret != EEXIST) {
|
||||||
fprintf(stderr, "unable to write sha1 filename %s: %s", filename, strerror(ret));
|
fprintf(stderr, "unable to write sha1 filename %s: %s\n", filename, strerror(ret));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/* FIXME!!! Collision check here ? */
|
/* FIXME!!! Collision check here ? */
|
||||||
@ -1313,7 +1329,7 @@ int write_sha1_file(void *buf, unsigned long len, const char *type, unsigned cha
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (errno != ENOENT) {
|
if (errno != ENOENT) {
|
||||||
fprintf(stderr, "sha1 file %s: %s", filename, strerror(errno));
|
fprintf(stderr, "sha1 file %s: %s\n", filename, strerror(errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1321,7 +1337,7 @@ int write_sha1_file(void *buf, unsigned long len, const char *type, unsigned cha
|
|||||||
|
|
||||||
fd = mkstemp(tmpfile);
|
fd = mkstemp(tmpfile);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
fprintf(stderr, "unable to create temporary sha1 filename %s: %s", tmpfile, strerror(errno));
|
fprintf(stderr, "unable to create temporary sha1 filename %s: %s\n", tmpfile, strerror(errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1410,7 +1426,7 @@ int write_sha1_to_fd(int fd, const unsigned char *sha1)
|
|||||||
size = write(fd, buf + posn, objsize - posn);
|
size = write(fd, buf + posn, objsize - posn);
|
||||||
if (size <= 0) {
|
if (size <= 0) {
|
||||||
if (!size) {
|
if (!size) {
|
||||||
fprintf(stderr, "write closed");
|
fprintf(stderr, "write closed\n");
|
||||||
} else {
|
} else {
|
||||||
perror("write ");
|
perror("write ");
|
||||||
}
|
}
|
||||||
|
@ -284,10 +284,54 @@ static void show_one_commit(struct commit *commit, int no_name)
|
|||||||
static char *ref_name[MAX_REVS + 1];
|
static char *ref_name[MAX_REVS + 1];
|
||||||
static int ref_name_cnt;
|
static int ref_name_cnt;
|
||||||
|
|
||||||
|
static const char *find_digit_prefix(const char *s, int *v)
|
||||||
|
{
|
||||||
|
const char *p;
|
||||||
|
int ver;
|
||||||
|
char ch;
|
||||||
|
|
||||||
|
for (p = s, ver = 0;
|
||||||
|
'0' <= (ch = *p) && ch <= '9';
|
||||||
|
p++)
|
||||||
|
ver = ver * 10 + ch - '0';
|
||||||
|
*v = ver;
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int version_cmp(const char *a, const char *b)
|
||||||
|
{
|
||||||
|
while (1) {
|
||||||
|
int va, vb;
|
||||||
|
|
||||||
|
a = find_digit_prefix(a, &va);
|
||||||
|
b = find_digit_prefix(b, &vb);
|
||||||
|
if (va != vb)
|
||||||
|
return va - vb;
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
int ca = *a;
|
||||||
|
int cb = *b;
|
||||||
|
if ('0' <= ca && ca <= '9')
|
||||||
|
ca = 0;
|
||||||
|
if ('0' <= cb && cb <= '9')
|
||||||
|
cb = 0;
|
||||||
|
if (ca != cb)
|
||||||
|
return ca - cb;
|
||||||
|
if (!ca)
|
||||||
|
break;
|
||||||
|
a++;
|
||||||
|
b++;
|
||||||
|
}
|
||||||
|
if (!*a && !*b)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static int compare_ref_name(const void *a_, const void *b_)
|
static int compare_ref_name(const void *a_, const void *b_)
|
||||||
{
|
{
|
||||||
const char * const*a = a_, * const*b = b_;
|
const char * const*a = a_, * const*b = b_;
|
||||||
return strcmp(*a, *b);
|
return version_cmp(*a, *b);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sort_ref_range(int bottom, int top)
|
static void sort_ref_range(int bottom, int top)
|
||||||
@ -299,11 +343,18 @@ static void sort_ref_range(int bottom, int top)
|
|||||||
static int append_ref(const char *refname, const unsigned char *sha1)
|
static int append_ref(const char *refname, const unsigned char *sha1)
|
||||||
{
|
{
|
||||||
struct commit *commit = lookup_commit_reference_gently(sha1, 1);
|
struct commit *commit = lookup_commit_reference_gently(sha1, 1);
|
||||||
|
int i;
|
||||||
|
|
||||||
if (!commit)
|
if (!commit)
|
||||||
return 0;
|
return 0;
|
||||||
|
/* Avoid adding the same thing twice */
|
||||||
|
for (i = 0; i < ref_name_cnt; i++)
|
||||||
|
if (!strcmp(refname, ref_name[i]))
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (MAX_REVS <= ref_name_cnt) {
|
if (MAX_REVS <= ref_name_cnt) {
|
||||||
fprintf(stderr, "warning: ignoring %s; "
|
fprintf(stderr, "warning: ignoring %s; "
|
||||||
"cannot handle more than %d refs",
|
"cannot handle more than %d refs\n",
|
||||||
refname, MAX_REVS);
|
refname, MAX_REVS);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -512,19 +563,17 @@ int main(int ac, char **av)
|
|||||||
if (1 < independent + merge_base + (extra != 0))
|
if (1 < independent + merge_base + (extra != 0))
|
||||||
usage(show_branch_usage);
|
usage(show_branch_usage);
|
||||||
|
|
||||||
|
/* If nothing is specified, show all branches by default */
|
||||||
|
if (ac + all_heads + all_tags == 0)
|
||||||
|
all_heads = 1;
|
||||||
|
|
||||||
if (all_heads + all_tags)
|
if (all_heads + all_tags)
|
||||||
snarf_refs(all_heads, all_tags);
|
snarf_refs(all_heads, all_tags);
|
||||||
|
|
||||||
if (ac) {
|
|
||||||
while (0 < ac) {
|
while (0 < ac) {
|
||||||
append_one_rev(*av);
|
append_one_rev(*av);
|
||||||
ac--; av++;
|
ac--; av++;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else {
|
|
||||||
/* If no revs given, then add heads */
|
|
||||||
snarf_refs(1, 0);
|
|
||||||
}
|
|
||||||
if (!ref_name_cnt) {
|
if (!ref_name_cnt) {
|
||||||
fprintf(stderr, "No revs to be shown.\n");
|
fprintf(stderr, "No revs to be shown.\n");
|
||||||
exit(0);
|
exit(0);
|
||||||
@ -537,7 +586,7 @@ int main(int ac, char **av)
|
|||||||
if (MAX_REVS <= num_rev)
|
if (MAX_REVS <= num_rev)
|
||||||
die("cannot handle more than %d revs.", MAX_REVS);
|
die("cannot handle more than %d revs.", MAX_REVS);
|
||||||
if (get_sha1(ref_name[num_rev], revkey))
|
if (get_sha1(ref_name[num_rev], revkey))
|
||||||
die("'%s' is not a valid ref.\n", ref_name[num_rev]);
|
die("'%s' is not a valid ref.", ref_name[num_rev]);
|
||||||
commit = lookup_commit_reference(revkey);
|
commit = lookup_commit_reference(revkey);
|
||||||
if (!commit)
|
if (!commit)
|
||||||
die("cannot find commit %s (%s)",
|
die("cannot find commit %s (%s)",
|
||||||
|
@ -9,9 +9,6 @@ This test tries pathnames with funny characters in the working
|
|||||||
tree, index, and tree objects.
|
tree, index, and tree objects.
|
||||||
'
|
'
|
||||||
|
|
||||||
# since FAT/NTFS does not allow tabs in filenames, skip this test
|
|
||||||
test "$(uname -o 2>/dev/null)" = Cygwin && exit 0
|
|
||||||
|
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
p0='no-funny'
|
p0='no-funny'
|
||||||
@ -27,6 +24,12 @@ EOF
|
|||||||
cat >"$p1" "$p0"
|
cat >"$p1" "$p0"
|
||||||
echo 'Foo Bar Baz' >"$p2"
|
echo 'Foo Bar Baz' >"$p2"
|
||||||
|
|
||||||
|
test -f "$p1" && cmp "$p0" "$p1" || {
|
||||||
|
# since FAT/NTFS does not allow tabs in filenames, skip this test
|
||||||
|
say 'Your filesystem does not allow tabs in filenames, test skipped.'
|
||||||
|
test_done
|
||||||
|
}
|
||||||
|
|
||||||
echo 'just space
|
echo 'just space
|
||||||
no-funny' >expected
|
no-funny' >expected
|
||||||
test_expect_success 'git-ls-files no-funny' \
|
test_expect_success 'git-ls-files no-funny' \
|
||||||
|
@ -26,6 +26,14 @@ rm -f path1
|
|||||||
test_expect_success \
|
test_expect_success \
|
||||||
'git-diff-files -p after editing work tree.' \
|
'git-diff-files -p after editing work tree.' \
|
||||||
'git-diff-files -p >current'
|
'git-diff-files -p >current'
|
||||||
|
|
||||||
|
# that's as far as it comes
|
||||||
|
if [ "$(git repo-config --get core.filemode)" = false ]
|
||||||
|
then
|
||||||
|
say 'filemode disabled on the filesystem'
|
||||||
|
test_done
|
||||||
|
fi
|
||||||
|
|
||||||
cat >expected <<\EOF
|
cat >expected <<\EOF
|
||||||
diff --git a/path0 b/path0
|
diff --git a/path0 b/path0
|
||||||
old mode 100644
|
old mode 100644
|
||||||
|
@ -15,11 +15,21 @@ test_expect_success \
|
|||||||
tree=`git-write-tree` &&
|
tree=`git-write-tree` &&
|
||||||
echo $tree'
|
echo $tree'
|
||||||
|
|
||||||
test_expect_success \
|
if [ "$(git repo-config --get core.filemode)" = false ]
|
||||||
|
then
|
||||||
|
say 'filemode disabled on the filesystem, using update-index --chmod=+x'
|
||||||
|
test_expect_success \
|
||||||
|
'git-update-index --chmod=+x' \
|
||||||
|
'git-update-index rezrov &&
|
||||||
|
git-update-index --chmod=+x rezrov &&
|
||||||
|
git-diff-index $tree >current'
|
||||||
|
else
|
||||||
|
test_expect_success \
|
||||||
'chmod' \
|
'chmod' \
|
||||||
'chmod +x rezrov &&
|
'chmod +x rezrov &&
|
||||||
git-update-index rezrov &&
|
git-update-index rezrov &&
|
||||||
git-diff-index $tree >current'
|
git-diff-index $tree >current'
|
||||||
|
fi
|
||||||
|
|
||||||
_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
|
_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
|
||||||
_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
|
_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
|
||||||
|
85
t/t4011-diff-symlink.sh
Executable file
85
t/t4011-diff-symlink.sh
Executable file
@ -0,0 +1,85 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Copyright (c) 2005 Johannes Schindelin
|
||||||
|
#
|
||||||
|
|
||||||
|
test_description='Test diff of symlinks.
|
||||||
|
|
||||||
|
'
|
||||||
|
. ./test-lib.sh
|
||||||
|
. ../diff-lib.sh
|
||||||
|
|
||||||
|
cat > expected << EOF
|
||||||
|
diff --git a/frotz b/frotz
|
||||||
|
new file mode 120000
|
||||||
|
index 0000000..7c465af
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/frotz
|
||||||
|
@@ -0,0 +1 @@
|
||||||
|
+xyzzy
|
||||||
|
\ No newline at end of file
|
||||||
|
EOF
|
||||||
|
|
||||||
|
test_expect_success \
|
||||||
|
'diff new symlink' \
|
||||||
|
'ln -s xyzzy frotz &&
|
||||||
|
git-update-index &&
|
||||||
|
tree=$(git-write-tree) &&
|
||||||
|
git-update-index --add frotz &&
|
||||||
|
GIT_DIFF_OPTS=--unified=0 git-diff-index -M -p $tree > current &&
|
||||||
|
compare_diff_patch current expected'
|
||||||
|
|
||||||
|
test_expect_success \
|
||||||
|
'diff unchanged symlink' \
|
||||||
|
'tree=$(git-write-tree) &&
|
||||||
|
git-update-index frotz &&
|
||||||
|
test -z "$(git-diff-index --name-only $tree)"'
|
||||||
|
|
||||||
|
cat > expected << EOF
|
||||||
|
diff --git a/frotz b/frotz
|
||||||
|
deleted file mode 120000
|
||||||
|
index 7c465af..0000000
|
||||||
|
--- a/frotz
|
||||||
|
+++ /dev/null
|
||||||
|
@@ -1 +0,0 @@
|
||||||
|
-xyzzy
|
||||||
|
\ No newline at end of file
|
||||||
|
EOF
|
||||||
|
|
||||||
|
test_expect_success \
|
||||||
|
'diff removed symlink' \
|
||||||
|
'rm frotz &&
|
||||||
|
git-diff-index -M -p $tree > current &&
|
||||||
|
compare_diff_patch current expected'
|
||||||
|
|
||||||
|
cat > expected << EOF
|
||||||
|
diff --git a/frotz b/frotz
|
||||||
|
EOF
|
||||||
|
|
||||||
|
test_expect_success \
|
||||||
|
'diff identical, but newly created symlink' \
|
||||||
|
'sleep 1 &&
|
||||||
|
ln -s xyzzy frotz &&
|
||||||
|
git-diff-index -M -p $tree > current &&
|
||||||
|
compare_diff_patch current expected'
|
||||||
|
|
||||||
|
cat > expected << EOF
|
||||||
|
diff --git a/frotz b/frotz
|
||||||
|
index 7c465af..df1db54 120000
|
||||||
|
--- a/frotz
|
||||||
|
+++ b/frotz
|
||||||
|
@@ -1 +1 @@
|
||||||
|
-xyzzy
|
||||||
|
\ No newline at end of file
|
||||||
|
+yxyyz
|
||||||
|
\ No newline at end of file
|
||||||
|
EOF
|
||||||
|
|
||||||
|
test_expect_success \
|
||||||
|
'diff different symlink' \
|
||||||
|
'rm frotz &&
|
||||||
|
ln -s yxyyz frotz &&
|
||||||
|
git-diff-index -M -p $tree > current &&
|
||||||
|
compare_diff_patch current expected'
|
||||||
|
|
||||||
|
test_done
|
@ -31,7 +31,12 @@ test_expect_success setup \
|
|||||||
test_expect_success apply \
|
test_expect_success apply \
|
||||||
'git-apply --index --stat --summary --apply test-patch'
|
'git-apply --index --stat --summary --apply test-patch'
|
||||||
|
|
||||||
test_expect_success validate \
|
if [ "$(git repo-config --get core.filemode)" = false ]
|
||||||
|
then
|
||||||
|
say 'filemode disabled on the filesystem'
|
||||||
|
else
|
||||||
|
test_expect_success validate \
|
||||||
'test -f bar && ls -l bar | grep "^-..x......"'
|
'test -f bar && ls -l bar | grep "^-..x......"'
|
||||||
|
fi
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
@ -142,6 +142,7 @@ test_expect_success \
|
|||||||
else :;
|
else :;
|
||||||
fi &&
|
fi &&
|
||||||
|
|
||||||
|
: PACK_SIGNATURE &&
|
||||||
cp test-1-${packname_1}.pack test-3.pack &&
|
cp test-1-${packname_1}.pack test-3.pack &&
|
||||||
dd if=/dev/zero of=test-3.pack count=1 bs=1 conv=notrunc seek=2 &&
|
dd if=/dev/zero of=test-3.pack count=1 bs=1 conv=notrunc seek=2 &&
|
||||||
if git-verify-pack test-3.idx
|
if git-verify-pack test-3.idx
|
||||||
@ -149,6 +150,7 @@ test_expect_success \
|
|||||||
else :;
|
else :;
|
||||||
fi &&
|
fi &&
|
||||||
|
|
||||||
|
: PACK_VERSION &&
|
||||||
cp test-1-${packname_1}.pack test-3.pack &&
|
cp test-1-${packname_1}.pack test-3.pack &&
|
||||||
dd if=/dev/zero of=test-3.pack count=1 bs=1 conv=notrunc seek=7 &&
|
dd if=/dev/zero of=test-3.pack count=1 bs=1 conv=notrunc seek=7 &&
|
||||||
if git-verify-pack test-3.idx
|
if git-verify-pack test-3.idx
|
||||||
@ -156,6 +158,7 @@ test_expect_success \
|
|||||||
else :;
|
else :;
|
||||||
fi &&
|
fi &&
|
||||||
|
|
||||||
|
: TYPE/SIZE byte of the first packed object data &&
|
||||||
cp test-1-${packname_1}.pack test-3.pack &&
|
cp test-1-${packname_1}.pack test-3.pack &&
|
||||||
dd if=/dev/zero of=test-3.pack count=1 bs=1 conv=notrunc seek=12 &&
|
dd if=/dev/zero of=test-3.pack count=1 bs=1 conv=notrunc seek=12 &&
|
||||||
if git-verify-pack test-3.idx
|
if git-verify-pack test-3.idx
|
||||||
@ -163,6 +166,16 @@ test_expect_success \
|
|||||||
else :;
|
else :;
|
||||||
fi &&
|
fi &&
|
||||||
|
|
||||||
|
: sum of the index file itself &&
|
||||||
|
l=`wc -c <test-3.idx` &&
|
||||||
|
l=`expr $l - 20` &&
|
||||||
|
cp test-1-${packname_1}.pack test-3.pack &&
|
||||||
|
dd if=/dev/zero of=test-3.idx count=20 bs=1 conv=notrunc seek=$l &&
|
||||||
|
if git-verify-pack test-3.pack
|
||||||
|
then false
|
||||||
|
else :;
|
||||||
|
fi &&
|
||||||
|
|
||||||
:'
|
:'
|
||||||
|
|
||||||
test_expect_success \
|
test_expect_success \
|
||||||
|
@ -8,13 +8,6 @@ test_description='Tests git-rev-list --merge-order functionality'
|
|||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
. ../t6000lib.sh # t6xxx specific functions
|
. ../t6000lib.sh # t6xxx specific functions
|
||||||
|
|
||||||
if git-rev-list --merge-order 2>&1 | grep 'OpenSSL not linked' >/dev/null
|
|
||||||
then
|
|
||||||
test_expect_success 'skipping merge-order test' :
|
|
||||||
test_done
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
# test-case specific test function
|
# test-case specific test function
|
||||||
check_adjacency()
|
check_adjacency()
|
||||||
{
|
{
|
||||||
@ -110,10 +103,17 @@ save_tag g4 unique_commit g6 tree -p g3 -p h2
|
|||||||
|
|
||||||
git-update-ref HEAD $(tag l5)
|
git-update-ref HEAD $(tag l5)
|
||||||
|
|
||||||
test_expect_success 'rev-list has correct number of entries' 'git-rev-list HEAD | wc -l | tr -s " "' <<EOF
|
test_output_expect_success 'rev-list has correct number of entries' 'git-rev-list HEAD | wc -l | tr -d \" \"' <<EOF
|
||||||
19
|
19
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
if git-rev-list --merge-order HEAD 2>&1 | grep 'OpenSSL not linked' >/dev/null
|
||||||
|
then
|
||||||
|
test_expect_success 'skipping merge-order test' :
|
||||||
|
test_done
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
normal_adjacency_count=$(git-rev-list HEAD | check_adjacency | grep -c "\^" | tr -d ' ')
|
normal_adjacency_count=$(git-rev-list HEAD | check_adjacency | grep -c "\^" | tr -d ' ')
|
||||||
merge_order_adjacency_count=$(git-rev-list --merge-order HEAD | check_adjacency | grep -c "\^" | tr -d ' ')
|
merge_order_adjacency_count=$(git-rev-list --merge-order HEAD | check_adjacency | grep -c "\^" | tr -d ' ')
|
||||||
test_expect_success '--merge-order produces as many or fewer discontinuities' '[ $merge_order_adjacency_count -le $normal_adjacency_count ]'
|
test_expect_success '--merge-order produces as many or fewer discontinuities' '[ $merge_order_adjacency_count -le $normal_adjacency_count ]'
|
||||||
|
@ -79,7 +79,7 @@ save_tag g4 unique_commit g6 tree -p g3 -p h2
|
|||||||
|
|
||||||
git-update-ref HEAD $(tag l5)
|
git-update-ref HEAD $(tag l5)
|
||||||
|
|
||||||
test_expect_success 'rev-list has correct number of entries' 'git-rev-list HEAD | wc -l | tr -s " "' <<EOF
|
test_output_expect_success 'rev-list has correct number of entries' 'git-rev-list HEAD | wc -l | tr -d \" \"' <<EOF
|
||||||
19
|
19
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
@ -195,7 +195,7 @@ test -d ../templates/blt || {
|
|||||||
test=trash
|
test=trash
|
||||||
rm -fr "$test"
|
rm -fr "$test"
|
||||||
mkdir "$test"
|
mkdir "$test"
|
||||||
cd "$test"
|
cd "$test" || error "Cannot setup test environment"
|
||||||
"$GIT_EXEC_PATH/git" init-db --template=../../templates/blt/ 2>/dev/null ||
|
"$GIT_EXEC_PATH/git" init-db --template=../../templates/blt/ 2>/dev/null ||
|
||||||
error "cannot run git init-db -- have you built things yet?"
|
error "cannot run git init-db -- have you built things yet?"
|
||||||
|
|
||||||
|
@ -263,6 +263,10 @@ void diff_tree_setup_paths(const char **p)
|
|||||||
|
|
||||||
paths = p;
|
paths = p;
|
||||||
nr_paths = count_paths(paths);
|
nr_paths = count_paths(paths);
|
||||||
|
if (nr_paths == 0) {
|
||||||
|
pathlens = NULL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
pathlens = xmalloc(nr_paths * sizeof(int));
|
pathlens = xmalloc(nr_paths * sizeof(int));
|
||||||
for (i=0; i<nr_paths; i++)
|
for (i=0; i<nr_paths; i++)
|
||||||
pathlens[i] = strlen(paths[i]);
|
pathlens[i] = strlen(paths[i]);
|
||||||
|
Reference in New Issue
Block a user