Compare commits
58 Commits
v1.7.4-rc0
...
v1.7.4-rc2
Author | SHA1 | Date | |
---|---|---|---|
adf872e783 | |||
477039c53c | |||
17e1c9e2fd | |||
17fd68d0d8 | |||
857ba709df | |||
7810c6b6d6 | |||
37ee62bc6b | |||
4b297df9b2 | |||
4f93fc745a | |||
3e70e37e72 | |||
9cf3f14766 | |||
d2f15e29a6 | |||
3f14246899 | |||
7fad99e14a | |||
a6fd3d4925 | |||
54f4cd9e8c | |||
7a876edf5d | |||
567323d387 | |||
ab4356111a | |||
0316bba80f | |||
ea640cc691 | |||
920a5d436b | |||
fc7642a096 | |||
2cf08b6a0a | |||
5b5d53cbe5 | |||
a28adc2d79 | |||
906a9a7d1d | |||
a31d066524 | |||
b393515f8e | |||
e17aa8a9dc | |||
9cfdbf9bef | |||
bc2d159421 | |||
ed40ec551d | |||
e83c267f71 | |||
685e9d9145 | |||
8594495cd6 | |||
6e97ef31ce | |||
bf9b46c16d | |||
d3cae60efc | |||
9e98354ab9 | |||
0c30ed0cb5 | |||
3ca7353cab | |||
3ce19eb857 | |||
cc7e81674b | |||
3aa3047106 | |||
60d5985dab | |||
f2665ec9fa | |||
081f84ee9e | |||
469bfc962d | |||
6822052427 | |||
9d9f5e72dc | |||
57da204264 | |||
a25e47377d | |||
71a5d4bc0e | |||
4290f69067 | |||
a2b665de4b | |||
549ad6d2f3 | |||
b3e5bce1aa |
@ -157,7 +157,7 @@ Writing Documentation:
|
||||
--sort=<key>
|
||||
--abbrev[=<n>]
|
||||
|
||||
Possibility of multiple occurences is indicated by three dots:
|
||||
Possibility of multiple occurrences is indicated by three dots:
|
||||
<file>...
|
||||
(One or more of <file>.)
|
||||
|
||||
|
@ -30,3 +30,5 @@ Git 1.7.3.5 Release Notes
|
||||
* "git rebase --skip" to skip the last commit in a series used to fail
|
||||
to run post-rewrite hook and to copy notes from old commits that have
|
||||
successfully been rebased so far. Now it do (backmerge ef88ad2).
|
||||
|
||||
* "gitweb" tried to show a wrong feed logo when none was specified.
|
||||
|
@ -8,15 +8,14 @@ Updates since v1.7.3
|
||||
docbook-xsl >= 1.73. If you have older versions, you can set
|
||||
ASCIIDOC7 and ASCIIDOC_ROFF, respectively.
|
||||
|
||||
* The option parsers of various commands that create new branch (or
|
||||
* The option parsers of various commands that create new branches (or
|
||||
rename existing ones to a new name) were too loose and users were
|
||||
allowed to call a branch with a name that begins with a dash by
|
||||
creative abuse of their command line options, which only lead to
|
||||
burn themselves. The name of a branch cannot begin with a dash
|
||||
now.
|
||||
allowed to give a branch a name that begins with a dash by creative
|
||||
abuse of their command line options, which only led to burning
|
||||
themselves. The name of a branch cannot begin with a dash now.
|
||||
|
||||
* System-wide fallback default attributes can be stored in
|
||||
/etc/gitattributes; core.attributesfile configuration variable can
|
||||
/etc/gitattributes; the core.attributesfile configuration variable can
|
||||
be used to customize the path to this file.
|
||||
|
||||
* The thread structure generated by "git send-email" has changed
|
||||
@ -26,34 +25,39 @@ Updates since v1.7.3
|
||||
cover letter of the previous series; this has been changed to make
|
||||
the patches in the new series replies to the new cover letter.
|
||||
|
||||
* Bash completion script in contrib/ has been adjusted to be usable with
|
||||
Bash 4 (options with '=value' didn't complete) It has been also made
|
||||
* The Bash completion script in contrib/ has been adjusted to be usable with
|
||||
Bash 4 (options with '=value' didn't complete). It has been also made
|
||||
usable with zsh.
|
||||
|
||||
* Different pagers can be chosen depending on which subcommand is
|
||||
being run under the pager, using "pager.<subcommand>" variable.
|
||||
being run under the pager, using the "pager.<subcommand>" variable.
|
||||
|
||||
* The hardcoded tab-width of 8 used in whitespace breakage checks is now
|
||||
* The hardcoded tab-width of 8 that is used in whitespace breakage checks is now
|
||||
configurable via the attributes mechanism.
|
||||
|
||||
* Support of case insensitive filesystems (i.e. "core.ignorecase") has
|
||||
been improved. For example, the gitignore mechanism didn't pay attention
|
||||
to the case insensitivity.
|
||||
to case insensitivity.
|
||||
|
||||
* The <tree>:<path> syntax to name a blob in a tree, and :<path>
|
||||
syntax to name a blob in the index (e.g. "master:Makefile",
|
||||
* The <tree>:<path> syntax for naming a blob in a tree, and the :<path>
|
||||
syntax for naming a blob in the index (e.g. "master:Makefile",
|
||||
":hello.c") have been extended. You can start <path> with "./" to
|
||||
implicitly have the (sub)directory you are in prefixed to the
|
||||
lookup. Similarly, ":../Makefile" from a subdirectory would mean
|
||||
"the Makefile of the parent directory in the index".
|
||||
|
||||
* "git blame" learned --show-email option to display the e-mail
|
||||
* "git blame" learned the --show-email option to display the e-mail
|
||||
addresses instead of the names of authors.
|
||||
|
||||
* "git commit" learned --fixup and --squash options to help later invocation
|
||||
of the interactive rebase.
|
||||
* "git commit" learned the --fixup and --squash options to help later invocation
|
||||
of interactive rebase.
|
||||
|
||||
* "git daemon" can be built in MinGW environment.
|
||||
* Command line options to "git cvsimport" whose names are in capital
|
||||
letters (-A, -M, -R and -S) can now be specified as the default in
|
||||
the .git/config file by their longer names (cvsimport.authorsFile,
|
||||
cvsimport.mergeRegex, cvsimport.trackRevisions, cvsimport.ignorePaths).
|
||||
|
||||
* "git daemon" can be built in the MinGW environment.
|
||||
|
||||
* "git daemon" can take more than one --listen option to listen to
|
||||
multiple addresses.
|
||||
@ -61,13 +65,13 @@ Updates since v1.7.3
|
||||
* "git describe --exact-match" was optimized not to read commit
|
||||
objects unnecessarily.
|
||||
|
||||
* "git diff" and "git grep" learned how functions and subroutines
|
||||
in Fortran look like.
|
||||
* "git diff" and "git grep" learned what functions and subroutines
|
||||
in Fortran and Perl look like.
|
||||
|
||||
* "git fetch" learned "--recurse-submodules" option.
|
||||
* "git fetch" learned the "--recurse-submodules" option.
|
||||
|
||||
* "git mergetool" tells vim/gvim to show three-way diff by default
|
||||
(use vimdiff2/gvimdiff2 as the tool name for old behaviour).
|
||||
* "git mergetool" tells vim/gvim to show a three-way diff by default
|
||||
(use vimdiff2/gvimdiff2 as the tool name for old behavior).
|
||||
|
||||
* "git log -G<pattern>" limits the output to commits whose change has
|
||||
added or deleted lines that match the given pattern.
|
||||
@ -87,12 +91,20 @@ Updates since v1.7.3
|
||||
directory in one branch while a new file is created in place of that
|
||||
directory in the other branch.
|
||||
|
||||
* "git rebase --autosquash" can use SHA-1 object names to name which
|
||||
commit to fix up (e.g. "fixup! e83c5163").
|
||||
* "git merge" learned the "--abort" option, synonymous to
|
||||
"git reset --merge" when a merge is in progress.
|
||||
|
||||
* The default "recursive" merge strategy learned --rename-threshold
|
||||
* "git notes" learned the "merge" subcommand to merge notes refs.
|
||||
In addition to the default manual conflict resolution, there are
|
||||
also several notes merge strategies for automatically resolving
|
||||
notes merge conflicts.
|
||||
|
||||
* "git rebase --autosquash" can use SHA-1 object names to name the
|
||||
commit which is to be fixed up (e.g. "fixup! e83c5163").
|
||||
|
||||
* The default "recursive" merge strategy learned the --rename-threshold
|
||||
option to influence the rename detection, similar to the -M option
|
||||
of "git diff". From "git merge" frontend, "-X<strategy option>"
|
||||
of "git diff". From the "git merge" frontend, the "-X<strategy option>"
|
||||
interface, e.g. "git merge -Xrename-threshold=50% ...", can be used
|
||||
to trigger this.
|
||||
|
||||
@ -100,21 +112,21 @@ Updates since v1.7.3
|
||||
changes; the most notable is -Xignore-space-at-eol.
|
||||
|
||||
* "git send-email" learned "--to-cmd", similar to "--cc-cmd", to read
|
||||
recipient list from a command output.
|
||||
the recipient list from a command output.
|
||||
|
||||
* "git send-email" learned to read and use "To:" from its input files.
|
||||
|
||||
* you can extend "git shell", which is often used on boxes that allow
|
||||
git-only login over ssh as login shell, with custom set of
|
||||
git-only login over ssh as login shell, with a custom set of
|
||||
commands.
|
||||
|
||||
* The current branch name in "git status" output can be colored differently
|
||||
from the generic header color by setting "color.status.branch" variable.
|
||||
from the generic header color by setting the "color.status.branch" variable.
|
||||
|
||||
* "git submodule sync" updates metainformation for all submodules,
|
||||
not just the ones that have been checked out.
|
||||
|
||||
* gitweb can use custom 'highlight' command with its configuration file.
|
||||
* gitweb can use a custom 'highlight' command with its configuration file.
|
||||
|
||||
* other gitweb updates.
|
||||
|
||||
@ -125,7 +137,7 @@ Also contains various documentation updates.
|
||||
Fixes since v1.7.3
|
||||
------------------
|
||||
|
||||
All of the fixes in v1.7.3.X maintenance series are included in this
|
||||
All of the fixes in the v1.7.3.X maintenance series are included in this
|
||||
release, unless otherwise noted.
|
||||
|
||||
* "git log --author=me --author=her" did not find commits written by
|
||||
@ -142,6 +154,6 @@ release, unless otherwise noted.
|
||||
|
||||
---
|
||||
exec >/var/tmp/1
|
||||
O=v1.7.3.4-687-g2cd900f
|
||||
O=v1.7.4-rc2
|
||||
echo O=$(git describe master)
|
||||
git shortlog --no-merges ^maint ^$O master
|
||||
|
@ -892,7 +892,7 @@ diff.wordRegex::
|
||||
|
||||
fetch.recurseSubmodules::
|
||||
A boolean value which changes the behavior for fetch and pull, the
|
||||
default is to not recursively fetch populated sumodules unless
|
||||
default is to not recursively fetch populated submodules unless
|
||||
configured otherwise.
|
||||
|
||||
fetch.unpackLimit::
|
||||
@ -1811,7 +1811,7 @@ submodule.<name>.update::
|
||||
|
||||
submodule.<name>.fetchRecurseSubmodules::
|
||||
This option can be used to enable/disable recursive fetching of this
|
||||
submodule. It can be overriden by using the --[no-]recurse-submodules
|
||||
submodule. It can be overridden by using the --[no-]recurse-submodules
|
||||
command line option to "git fetch" and "git pull".
|
||||
This setting will override that from in the linkgit:gitmodules[5]
|
||||
file.
|
||||
|
@ -333,7 +333,7 @@ likely to introduce confusing changes to the index.
|
||||
There are also more complex operations that can be performed. But beware
|
||||
that because the patch is applied only to the index and not the working
|
||||
tree, the working tree will appear to "undo" the change in the index.
|
||||
For example, introducing a a new line into the index that is in neither
|
||||
For example, introducing a new line into the index that is in neither
|
||||
the HEAD nor the working tree will stage the new line for commit, but
|
||||
the line will appear to be reverted in the working tree.
|
||||
|
||||
|
@ -116,7 +116,7 @@ Note that attributes are by default taken from the `.gitattributes` files
|
||||
in the tree that is being archived. If you want to tweak the way the
|
||||
output is generated after the fact (e.g. you committed without adding an
|
||||
appropriate export-ignore in its `.gitattributes`), adjust the checked out
|
||||
`.gitattributes` file as necessary and use `--work-tree-attributes`
|
||||
`.gitattributes` file as necessary and use `--worktree-attributes`
|
||||
option. Alternatively you can keep necessary attributes that should apply
|
||||
while archiving any tree in your `$GIT_DIR/info/attributes` file.
|
||||
|
||||
|
@ -59,7 +59,7 @@ unbundle <file>::
|
||||
|
||||
<git-rev-list-args>::
|
||||
A list of arguments, acceptable to 'git rev-parse' and
|
||||
'git rev-list' (and containg a named ref, see SPECIFYING REFERENCES
|
||||
'git rev-list' (and containing a named ref, see SPECIFYING REFERENCES
|
||||
below), that specifies the specific objects and references
|
||||
to transport. For example, `master{tilde}10..master` causes the
|
||||
current master reference to be packaged along with all objects
|
||||
|
@ -57,7 +57,7 @@ merge.log::
|
||||
In addition to branch names, populate the log message with at
|
||||
most the specified number of one-line descriptions from the
|
||||
actual commits that are being merged. Defaults to false, and
|
||||
true is a synoym for 20.
|
||||
true is a synonym for 20.
|
||||
|
||||
merge.summary::
|
||||
Synonym to `merge.log`; this is deprecated and will be removed in
|
||||
|
@ -15,12 +15,12 @@ This remote helper uses the specified 'program' to connect
|
||||
to a remote git server.
|
||||
|
||||
Data written to stdin of this specified 'program' is assumed
|
||||
to be sent to git:// server, git-upload-pack, git-receive-pack
|
||||
to be sent to a git:// server, git-upload-pack, git-receive-pack
|
||||
or git-upload-archive (depending on situation), and data read
|
||||
from stdout of this program is assumed to be received from
|
||||
the same service.
|
||||
|
||||
Command and arguments are separated by unescaped space.
|
||||
Command and arguments are separated by an unescaped space.
|
||||
|
||||
The following sequences have a special meaning:
|
||||
|
||||
@ -39,19 +39,19 @@ The following sequences have a special meaning:
|
||||
git-upload-pack, or git-upload-archive) of the service
|
||||
git wants to invoke.
|
||||
|
||||
'%G' (must be first characters in argument)::
|
||||
'%G' (must be the first characters in an argument)::
|
||||
This argument will not be passed to 'program'. Instead, it
|
||||
will cause helper to start by sending git:// service request to
|
||||
remote side with service field set to approiate value and
|
||||
repository field set to rest of the argument. Default is not to send
|
||||
such request.
|
||||
will cause the helper to start by sending git:// service requests to
|
||||
the remote side with the service field set to an appropriate value and
|
||||
the repository field set to rest of the argument. Default is not to send
|
||||
such a request.
|
||||
+
|
||||
This is useful if remote side is git:// server accessed over
|
||||
some tunnel.
|
||||
|
||||
'%V' (must be first characters in argument)::
|
||||
This argument will not be passed to 'program'. Instead it sets
|
||||
the vhost field in git:// service request (to rest of the argument).
|
||||
the vhost field in the git:// service request (to rest of the argument).
|
||||
Default is not to send vhost in such request (if sent).
|
||||
|
||||
ENVIRONMENT VARIABLES:
|
||||
|
@ -11,20 +11,20 @@ SYNOPSIS
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
This helper uses specified file descriptors to connect to remote git server.
|
||||
This helper uses specified file descriptors to connect to a remote git server.
|
||||
This is not meant for end users but for programs and scripts calling git
|
||||
fetch, push or archive.
|
||||
|
||||
If only <infd> is given, it is assumed to be bidirectional socket connected
|
||||
If only <infd> is given, it is assumed to be a bidirectional socket connected
|
||||
to remote git server (git-upload-pack, git-receive-pack or
|
||||
git-upload-achive). If both <infd> and <outfd> are given, they are assumed
|
||||
to be pipes connected to remote git server (<infd> being the inbound pipe
|
||||
to be pipes connected to a remote git server (<infd> being the inbound pipe
|
||||
and <outfd> being the outbound pipe.
|
||||
|
||||
It is assumed that any handshaking procedures have already been completed
|
||||
(such as sending service request for git://) before this helper is started.
|
||||
|
||||
<anything> can be any string. It is ignored. It is meant for provoding
|
||||
<anything> can be any string. It is ignored. It is meant for providing
|
||||
information to user in the URL in case that URL is displayed in some
|
||||
context.
|
||||
|
||||
|
@ -613,7 +613,7 @@ old references to SVN revision numbers in existing documentation, bug
|
||||
reports and archives. If you plan to eventually migrate from SVN to git
|
||||
and are certain about dropping SVN history, consider
|
||||
linkgit:git-filter-branch[1] instead. filter-branch also allows
|
||||
reformating of metadata for ease-of-reading and rewriting authorship
|
||||
reformatting of metadata for ease-of-reading and rewriting authorship
|
||||
info for non-"svn.authorsFile" users.
|
||||
|
||||
svn.useSvmProps::
|
||||
@ -729,8 +729,11 @@ have each person clone that repository with 'git clone':
|
||||
cd project
|
||||
git init
|
||||
git remote add origin server:/pub/project
|
||||
git config --add remote.origin.fetch '+refs/remotes/*:refs/remotes/*'
|
||||
git config --replace-all remote.origin.fetch '+refs/remotes/*:refs/remotes/*'
|
||||
git fetch
|
||||
# Prevent fetch/pull from remote git server in the future,
|
||||
# we only want to use git svn for future updates
|
||||
git config --remove-section remote.origin
|
||||
# Create a local branch from one of the branches just fetched
|
||||
git checkout -b master FETCH_HEAD
|
||||
# Initialize 'git svn' locally (be sure to use the same URL and -T/-b/-t options as were used on server)
|
||||
|
@ -44,9 +44,10 @@ unreleased) version of git, that is available from 'master'
|
||||
branch of the `git.git` repository.
|
||||
Documentation for older releases are available here:
|
||||
|
||||
* link:v1.7.3.4/git.html[documentation for release 1.7.3.4]
|
||||
* link:v1.7.3.5/git.html[documentation for release 1.7.3.5]
|
||||
|
||||
* release notes for
|
||||
link:RelNotes/1.7.3.5.txt[1.7.3.5],
|
||||
link:RelNotes/1.7.3.4.txt[1.7.3.4],
|
||||
link:RelNotes/1.7.3.3.txt[1.7.3.3],
|
||||
link:RelNotes/1.7.3.2.txt[1.7.3.2],
|
||||
|
@ -335,6 +335,16 @@ input that is already correctly indented. In this case, the lack of a
|
||||
smudge filter means that the clean filter _must_ accept its own output
|
||||
without modifying it.
|
||||
|
||||
Sequence "%f" on the filter command line is replaced with the name of
|
||||
the file the filter is working on. A filter might use this in keyword
|
||||
substitution. For example:
|
||||
|
||||
------------------------
|
||||
[filter "p4"]
|
||||
clean = git-p4-filter --clean %f
|
||||
smudge = git-p4-filter --smudge %f
|
||||
------------------------
|
||||
|
||||
|
||||
Interaction between checkin/checkout attributes
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -494,6 +504,8 @@ patterns are available:
|
||||
|
||||
- `pascal` suitable for source code in the Pascal/Delphi language.
|
||||
|
||||
- `perl` suitable for source code in the Perl language.
|
||||
|
||||
- `php` suitable for source code in the PHP language.
|
||||
|
||||
- `python` suitable for source code in the Python language.
|
||||
@ -581,6 +593,39 @@ and now produces better output), you can remove the cache
|
||||
manually with `git update-ref -d refs/notes/textconv/jpg` (where
|
||||
"jpg" is the name of the diff driver, as in the example above).
|
||||
|
||||
Marking files as binary
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Git usually guesses correctly whether a blob contains text or binary
|
||||
data by examining the beginning of the contents. However, sometimes you
|
||||
may want to override its decision, either because a blob contains binary
|
||||
data later in the file, or because the content, while technically
|
||||
composed of text characters, is opaque to a human reader. For example,
|
||||
many postscript files contain only ascii characters, but produce noisy
|
||||
and meaningless diffs.
|
||||
|
||||
The simplest way to mark a file as binary is to unset the diff
|
||||
attribute in the `.gitattributes` file:
|
||||
|
||||
------------------------
|
||||
*.ps -diff
|
||||
------------------------
|
||||
|
||||
This will cause git to generate `Binary files differ` (or a binary
|
||||
patch, if binary patches are enabled) instead of a regular diff.
|
||||
|
||||
However, one may also want to specify other diff driver attributes. For
|
||||
example, you might want to use `textconv` to convert postscript files to
|
||||
an ascii representation for human viewing, but otherwise treat them as
|
||||
binary files. You cannot specify both `-diff` and `diff=ps` attributes.
|
||||
The solution is to use the `diff.*.binary` config option:
|
||||
|
||||
------------------------
|
||||
[diff "ps"]
|
||||
textconv = ps2ascii
|
||||
binary = true
|
||||
------------------------
|
||||
|
||||
Performing a three-way merge
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
@ -350,10 +350,6 @@ rebase::
|
||||
The commits are guaranteed to be listed in the order that they were
|
||||
processed by rebase.
|
||||
|
||||
There is no default 'post-rewrite' hook, but see the
|
||||
`post-receive-copy-notes` script in `contrib/hooks` for an example
|
||||
that copies your git-notes to the rewritten commits.
|
||||
|
||||
|
||||
GIT
|
||||
---
|
||||
|
@ -49,7 +49,7 @@ submodule.<name>.fetchRecurseSubmodules::
|
||||
submodule. If this option is also present in the submodules entry in
|
||||
.git/config of the superproject, the setting there will override the
|
||||
one found in .gitmodules.
|
||||
Both settings can be overriden on the command line by using the
|
||||
Both settings can be overridden on the command line by using the
|
||||
"--[no-]recurse-submodules" option to "git fetch" and "git pull"..
|
||||
|
||||
submodule.<name>.ignore::
|
||||
|
@ -10,7 +10,7 @@ merge.log::
|
||||
In addition to branch names, populate the log message with at
|
||||
most the specified number of one-line descriptions from the
|
||||
actual commits that are being merged. Defaults to false, and
|
||||
true is a synoym for 20.
|
||||
true is a synonym for 20.
|
||||
|
||||
merge.renameLimit::
|
||||
The number of files to consider when performing rename detection
|
||||
|
@ -32,7 +32,7 @@ and installation code should look something like:
|
||||
}
|
||||
------------------------------------------
|
||||
|
||||
Handlers are given the typdef of sigchain_fun. This is the same type
|
||||
Handlers are given the typedef of sigchain_fun. This is the same type
|
||||
that is given to signal() or sigaction(). It is perfectly reasonable to
|
||||
push SIG_DFL or SIG_IGN onto the stack.
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
GVF=GIT-VERSION-FILE
|
||||
DEF_VER=v1.7.4-rc0
|
||||
DEF_VER=v1.7.4-rc2
|
||||
|
||||
LF='
|
||||
'
|
||||
|
@ -45,9 +45,9 @@ static const char implicit_ident_advice[] =
|
||||
" git config --global user.name \"Your Name\"\n"
|
||||
" git config --global user.email you@example.com\n"
|
||||
"\n"
|
||||
"If the identity used for this commit is wrong, you can fix it with:\n"
|
||||
"After doing this, you may fix the identity used for this commit with:\n"
|
||||
"\n"
|
||||
" git commit --amend --author='Your Name <you@example.com>'\n";
|
||||
" git commit --amend --reset-author\n";
|
||||
|
||||
static const char empty_amend_advice[] =
|
||||
"You asked to amend the most recent commit, but doing so would make\n"
|
||||
|
23
convert.c
23
convert.c
@ -1,6 +1,7 @@
|
||||
#include "cache.h"
|
||||
#include "attr.h"
|
||||
#include "run-command.h"
|
||||
#include "quote.h"
|
||||
|
||||
/*
|
||||
* convert.c - convert a file when checking it out and checking it in.
|
||||
@ -318,6 +319,7 @@ struct filter_params {
|
||||
const char *src;
|
||||
unsigned long size;
|
||||
const char *cmd;
|
||||
const char *path;
|
||||
};
|
||||
|
||||
static int filter_buffer(int in, int out, void *data)
|
||||
@ -330,7 +332,23 @@ static int filter_buffer(int in, int out, void *data)
|
||||
int write_err, status;
|
||||
const char *argv[] = { NULL, NULL };
|
||||
|
||||
argv[0] = params->cmd;
|
||||
/* apply % substitution to cmd */
|
||||
struct strbuf cmd = STRBUF_INIT;
|
||||
struct strbuf path = STRBUF_INIT;
|
||||
struct strbuf_expand_dict_entry dict[] = {
|
||||
{ "f", NULL, },
|
||||
{ NULL, NULL, },
|
||||
};
|
||||
|
||||
/* quote the path to preserve spaces, etc. */
|
||||
sq_quote_buf(&path, params->path);
|
||||
dict[0].value = path.buf;
|
||||
|
||||
/* expand all %f with the quoted path */
|
||||
strbuf_expand(&cmd, params->cmd, strbuf_expand_dict_cb, &dict);
|
||||
strbuf_release(&path);
|
||||
|
||||
argv[0] = cmd.buf;
|
||||
|
||||
memset(&child_process, 0, sizeof(child_process));
|
||||
child_process.argv = argv;
|
||||
@ -350,6 +368,8 @@ static int filter_buffer(int in, int out, void *data)
|
||||
status = finish_command(&child_process);
|
||||
if (status)
|
||||
error("external filter %s failed %d", params->cmd, status);
|
||||
|
||||
strbuf_release(&cmd);
|
||||
return (write_err || status);
|
||||
}
|
||||
|
||||
@ -377,6 +397,7 @@ static int apply_filter(const char *path, const char *src, size_t len,
|
||||
params.src = src;
|
||||
params.size = len;
|
||||
params.cmd = cmd;
|
||||
params.path = path;
|
||||
|
||||
fflush(NULL);
|
||||
if (start_async(&async))
|
||||
|
7
daemon.c
7
daemon.c
@ -1226,9 +1226,10 @@ int main(int argc, char **argv)
|
||||
|
||||
/* prepare argv for serving-processes */
|
||||
cld_argv = xmalloc(sizeof (char *) * (argc + 2));
|
||||
for (i = 0; i < argc; ++i)
|
||||
cld_argv[i] = argv[i];
|
||||
cld_argv[argc] = "--serve";
|
||||
cld_argv[0] = argv[0]; /* git-daemon */
|
||||
cld_argv[1] = "--serve";
|
||||
for (i = 1; i < argc; ++i)
|
||||
cld_argv[i+1] = argv[i];
|
||||
cld_argv[argc+1] = NULL;
|
||||
|
||||
return serve(&listen_addr, listen_port, cred);
|
||||
|
@ -90,23 +90,40 @@ sub write_author_info($) {
|
||||
}
|
||||
|
||||
# convert getopts specs for use by git config
|
||||
my %longmap = (
|
||||
'A:' => 'authors-file',
|
||||
'M:' => 'merge-regex',
|
||||
'P:' => undef,
|
||||
'R' => 'track-revisions',
|
||||
'S:' => 'ignore-paths',
|
||||
);
|
||||
|
||||
sub read_repo_config {
|
||||
# Split the string between characters, unless there is a ':'
|
||||
# So "abc:de" becomes ["a", "b", "c:", "d", "e"]
|
||||
# Split the string between characters, unless there is a ':'
|
||||
# So "abc:de" becomes ["a", "b", "c:", "d", "e"]
|
||||
my @opts = split(/ *(?!:)/, shift);
|
||||
foreach my $o (@opts) {
|
||||
my $key = $o;
|
||||
$key =~ s/://g;
|
||||
my $arg = 'git config';
|
||||
$arg .= ' --bool' if ($o !~ /:$/);
|
||||
my $ckey = $key;
|
||||
|
||||
chomp(my $tmp = `$arg --get cvsimport.$key`);
|
||||
if (exists $longmap{$o}) {
|
||||
# An uppercase option like -R cannot be
|
||||
# expressed in the configuration, as the
|
||||
# variable names are downcased.
|
||||
$ckey = $longmap{$o};
|
||||
next if (! defined $ckey);
|
||||
$ckey =~ s/-//g;
|
||||
}
|
||||
chomp(my $tmp = `$arg --get cvsimport.$ckey`);
|
||||
if ($tmp && !($arg =~ /--bool/ && $tmp eq 'false')) {
|
||||
no strict 'refs';
|
||||
my $opt_name = "opt_" . $key;
|
||||
if (!$$opt_name) {
|
||||
$$opt_name = $tmp;
|
||||
}
|
||||
no strict 'refs';
|
||||
my $opt_name = "opt_" . $key;
|
||||
if (!$$opt_name) {
|
||||
$$opt_name = $tmp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -37,12 +37,24 @@ resolve_relative_url ()
|
||||
die "remote ($remote) does not have a url defined in .git/config"
|
||||
url="$1"
|
||||
remoteurl=${remoteurl%/}
|
||||
sep=/
|
||||
while test -n "$url"
|
||||
do
|
||||
case "$url" in
|
||||
../*)
|
||||
url="${url#../}"
|
||||
remoteurl="${remoteurl%/*}"
|
||||
case "$remoteurl" in
|
||||
*/*)
|
||||
remoteurl="${remoteurl%/*}"
|
||||
;;
|
||||
*:*)
|
||||
remoteurl="${remoteurl%:*}"
|
||||
sep=:
|
||||
;;
|
||||
*)
|
||||
die "cannot strip one component off url '$remoteurl'"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
./*)
|
||||
url="${url#./}"
|
||||
@ -51,7 +63,7 @@ resolve_relative_url ()
|
||||
break;;
|
||||
esac
|
||||
done
|
||||
echo "$remoteurl/${url%/}"
|
||||
echo "$remoteurl$sep${url%/}"
|
||||
}
|
||||
|
||||
#
|
||||
|
0
gitk-git/gitk
Normal file → Executable file
0
gitk-git/gitk
Normal file → Executable file
@ -250,13 +250,14 @@ our %highlight_ext = (
|
||||
# main extensions, defining name of syntax;
|
||||
# see files in /usr/share/highlight/langDefs/ directory
|
||||
map { $_ => $_ }
|
||||
qw(py c cpp rb java css php sh pl js tex bib xml awk bat ini spec tcl),
|
||||
qw(py c cpp rb java css php sh pl js tex bib xml awk bat ini spec tcl sql make),
|
||||
# alternate extensions, see /etc/highlight/filetypes.conf
|
||||
'h' => 'c',
|
||||
map { $_ => 'sh' } qw(bash zsh ksh),
|
||||
map { $_ => 'cpp' } qw(cxx c++ cc),
|
||||
map { $_ => 'php' } qw(php3 php4),
|
||||
map { $_ => 'php' } qw(php3 php4 php5 phps),
|
||||
map { $_ => 'pl' } qw(perl pm), # perhaps also 'cgi'
|
||||
'mak' => 'make',
|
||||
map { $_ => 'make'} qw(mak mk),
|
||||
map { $_ => 'xml' } qw(xhtml html htm),
|
||||
);
|
||||
|
||||
@ -3464,8 +3465,7 @@ sub run_highlighter {
|
||||
my ($fd, $highlight, $syntax) = @_;
|
||||
return $fd unless ($highlight && defined $syntax);
|
||||
|
||||
close $fd
|
||||
or die_error(404, "Reading blob failed");
|
||||
close $fd;
|
||||
open $fd, quote_command(git_cmd(), "cat-file", "blob", $hash)." | ".
|
||||
quote_command($highlight_bin).
|
||||
" --xhtml --fragment --syntax $syntax |"
|
||||
@ -3601,10 +3601,15 @@ EOF
|
||||
insert_file($site_header);
|
||||
}
|
||||
|
||||
print "<div class=\"page_header\">\n" .
|
||||
$cgi->a({-href => esc_url($logo_url),
|
||||
-title => $logo_label},
|
||||
qq(<img src=").esc_url($logo).qq(" width="72" height="27" alt="git" class="logo"/>));
|
||||
print "<div class=\"page_header\">\n";
|
||||
if (defined $logo) {
|
||||
print $cgi->a({-href => esc_url($logo_url),
|
||||
-title => $logo_label},
|
||||
$cgi->img({-src => esc_url($logo),
|
||||
-width => 72, -height => 27,
|
||||
-alt => "git",
|
||||
-class => "logo"}));
|
||||
}
|
||||
print $cgi->a({-href => esc_url($home_link)}, $home_link_str) . " / ";
|
||||
if (defined $project) {
|
||||
print $cgi->a({-href => href(action=>"summary")}, esc_html($project));
|
||||
@ -7169,7 +7174,7 @@ XML
|
||||
if (defined $favicon) {
|
||||
print "<icon>" . esc_url($favicon) . "</icon>\n";
|
||||
}
|
||||
if (defined $logo_url) {
|
||||
if (defined $logo) {
|
||||
# not twice as wide as tall: 72 x 27 pixels
|
||||
print "<logo>" . esc_url($logo) . "</logo>\n";
|
||||
}
|
||||
|
@ -68,8 +68,7 @@ svn_cmd () {
|
||||
svn "$orig_svncmd" --config-dir "$svnconf" "$@"
|
||||
}
|
||||
|
||||
if test -n "$SVN_HTTPD_PORT"
|
||||
then
|
||||
prepare_httpd () {
|
||||
for d in \
|
||||
"$SVN_HTTPD_PATH" \
|
||||
/usr/sbin/apache2 \
|
||||
@ -83,8 +82,8 @@ then
|
||||
done
|
||||
if test -z "$SVN_HTTPD_PATH"
|
||||
then
|
||||
skip_all='skipping git svn tests, Apache not found'
|
||||
test_done
|
||||
echo >&2 '*** error: Apache not found'
|
||||
return 1
|
||||
fi
|
||||
for d in \
|
||||
"$SVN_HTTPD_MODULE_PATH" \
|
||||
@ -99,23 +98,16 @@ then
|
||||
done
|
||||
if test -z "$SVN_HTTPD_MODULE_PATH"
|
||||
then
|
||||
skip_all='skipping git svn tests, Apache module dir not found'
|
||||
test_done
|
||||
echo >&2 '*** error: Apache module dir not found'
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
start_httpd () {
|
||||
repo_base_path="$1"
|
||||
if test -z "$SVN_HTTPD_PORT"
|
||||
if test ! -f "$SVN_HTTPD_MODULE_PATH/mod_dav_svn.so"
|
||||
then
|
||||
echo >&2 'SVN_HTTPD_PORT is not defined!'
|
||||
return
|
||||
fi
|
||||
if test -z "$repo_base_path"
|
||||
then
|
||||
repo_base_path=svn
|
||||
echo >&2 '*** error: Apache module "mod_dav_svn" not found'
|
||||
return 1
|
||||
fi
|
||||
|
||||
repo_base_path="${1-svn}"
|
||||
mkdir "$GIT_DIR"/logs
|
||||
|
||||
cat > "$GIT_DIR/httpd.conf" <<EOF
|
||||
@ -132,12 +124,24 @@ LoadModule dav_svn_module $SVN_HTTPD_MODULE_PATH/mod_dav_svn.so
|
||||
SVNPath "$rawsvnrepo"
|
||||
</Location>
|
||||
EOF
|
||||
}
|
||||
|
||||
start_httpd () {
|
||||
if test -z "$SVN_HTTPD_PORT"
|
||||
then
|
||||
echo >&2 'SVN_HTTPD_PORT is not defined!'
|
||||
return
|
||||
fi
|
||||
|
||||
prepare_httpd "$1" || return 1
|
||||
|
||||
"$SVN_HTTPD_PATH" -f "$GIT_DIR"/httpd.conf -k start
|
||||
svnrepo="http://127.0.0.1:$SVN_HTTPD_PORT/$repo_base_path"
|
||||
}
|
||||
|
||||
stop_httpd () {
|
||||
test -z "$SVN_HTTPD_PORT" && return
|
||||
test ! -f "$GIT_DIR/httpd.conf" && return
|
||||
"$SVN_HTTPD_PATH" -f "$GIT_DIR"/httpd.conf -k stop
|
||||
}
|
||||
|
||||
|
@ -80,11 +80,11 @@ EOF
|
||||
chmod +x passing-todo.sh &&
|
||||
./passing-todo.sh >out 2>err &&
|
||||
! test -s err &&
|
||||
cat >expect <<EOF &&
|
||||
ok 1 - pretend we have fixed a known breakage # TODO known breakage
|
||||
# fixed 1 known breakage(s)
|
||||
# passed all 1 test(s)
|
||||
1..1
|
||||
sed -e 's/^> //' >expect <<EOF &&
|
||||
> ok 1 - pretend we have fixed a known breakage # TODO known breakage
|
||||
> # fixed 1 known breakage(s)
|
||||
> # passed all 1 test(s)
|
||||
> 1..1
|
||||
EOF
|
||||
test_cmp expect out)
|
||||
"
|
||||
@ -164,19 +164,19 @@ EOF
|
||||
test_must_fail ./failing-cleanup.sh >out 2>err &&
|
||||
! test -s err &&
|
||||
! test -f \"trash directory.failing-cleanup/clean-after-failure\" &&
|
||||
sed -e 's/Z$//' >expect <<\EOF &&
|
||||
not ok - 1 tests clean up even after a failure
|
||||
# Z
|
||||
# touch clean-after-failure &&
|
||||
# test_when_finished rm clean-after-failure &&
|
||||
# (exit 1)
|
||||
# Z
|
||||
not ok - 2 failure to clean up causes the test to fail
|
||||
# Z
|
||||
# test_when_finished \"(exit 2)\"
|
||||
# Z
|
||||
# failed 2 among 2 test(s)
|
||||
1..2
|
||||
sed -e 's/Z$//' -e 's/^> //' >expect <<\EOF &&
|
||||
> not ok - 1 tests clean up even after a failure
|
||||
> # Z
|
||||
> # touch clean-after-failure &&
|
||||
> # test_when_finished rm clean-after-failure &&
|
||||
> # (exit 1)
|
||||
> # Z
|
||||
> not ok - 2 failure to clean up causes the test to fail
|
||||
> # Z
|
||||
> # test_when_finished \"(exit 2)\"
|
||||
> # Z
|
||||
> # failed 2 among 2 test(s)
|
||||
> 1..2
|
||||
EOF
|
||||
test_cmp expect out)
|
||||
"
|
||||
|
@ -35,7 +35,7 @@ test_expect_success 'plain' '
|
||||
|
||||
test_expect_success 'plain nested in bare' '
|
||||
(
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
git init --bare bare-ancestor.git &&
|
||||
cd bare-ancestor.git &&
|
||||
mkdir plain-nested &&
|
||||
@ -47,7 +47,7 @@ test_expect_success 'plain nested in bare' '
|
||||
|
||||
test_expect_success 'plain through aliased command, outside any git repo' '
|
||||
(
|
||||
unset GIT_DIR GIT_WORK_TREE GIT_CONFIG_NOGLOBAL &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE GIT_CONFIG_NOGLOBAL &&
|
||||
HOME=$(pwd)/alias-config &&
|
||||
export HOME &&
|
||||
mkdir alias-config &&
|
||||
@ -65,7 +65,7 @@ test_expect_success 'plain through aliased command, outside any git repo' '
|
||||
|
||||
test_expect_failure 'plain nested through aliased command' '
|
||||
(
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
git init plain-ancestor-aliased &&
|
||||
cd plain-ancestor-aliased &&
|
||||
echo "[alias] aliasedinit = init" >>.git/config &&
|
||||
@ -78,7 +78,7 @@ test_expect_failure 'plain nested through aliased command' '
|
||||
|
||||
test_expect_failure 'plain nested in bare through aliased command' '
|
||||
(
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
git init --bare bare-ancestor-aliased.git &&
|
||||
cd bare-ancestor-aliased.git &&
|
||||
echo "[alias] aliasedinit = init" >>config &&
|
||||
|
@ -93,4 +93,47 @@ test_expect_success expanded_in_repo '
|
||||
cmp expanded-keywords expected-output
|
||||
'
|
||||
|
||||
# The use of %f in a filter definition is expanded to the path to
|
||||
# the filename being smudged or cleaned. It must be shell escaped.
|
||||
# First, set up some interesting file names and pet them in
|
||||
# .gitattributes.
|
||||
test_expect_success 'filter shell-escaped filenames' '
|
||||
cat >argc.sh <<-EOF &&
|
||||
#!$SHELL_PATH
|
||||
cat >/dev/null
|
||||
echo argc: \$# "\$@"
|
||||
EOF
|
||||
normal=name-no-magic &&
|
||||
special="name with '\''sq'\'' and \$x" &&
|
||||
echo some test text >"$normal" &&
|
||||
echo some test text >"$special" &&
|
||||
git add "$normal" "$special" &&
|
||||
git commit -q -m "add files" &&
|
||||
echo "name* filter=argc" >.gitattributes &&
|
||||
|
||||
# delete the files and check them out again, using a smudge filter
|
||||
# that will count the args and echo the command-line back to us
|
||||
git config filter.argc.smudge "sh ./argc.sh %f" &&
|
||||
rm "$normal" "$special" &&
|
||||
git checkout -- "$normal" "$special" &&
|
||||
|
||||
# make sure argc.sh counted the right number of args
|
||||
echo "argc: 1 $normal" >expect &&
|
||||
test_cmp expect "$normal" &&
|
||||
echo "argc: 1 $special" >expect &&
|
||||
test_cmp expect "$special" &&
|
||||
|
||||
# do the same thing, but with more args in the filter expression
|
||||
git config filter.argc.smudge "sh ./argc.sh %f --my-extra-arg" &&
|
||||
rm "$normal" "$special" &&
|
||||
git checkout -- "$normal" "$special" &&
|
||||
|
||||
# make sure argc.sh counted the right number of args
|
||||
echo "argc: 2 $normal --my-extra-arg" >expect &&
|
||||
test_cmp expect "$normal" &&
|
||||
echo "argc: 2 $special --my-extra-arg" >expect &&
|
||||
test_cmp expect "$special" &&
|
||||
:
|
||||
'
|
||||
|
||||
test_done
|
||||
|
@ -80,7 +80,7 @@ test_repo() {
|
||||
# - cwd can't be outside worktree
|
||||
|
||||
test_expect_success '#0: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 0 0/sub &&
|
||||
cd 0 && git init && cd ..
|
||||
'
|
||||
@ -123,7 +123,7 @@ EOF
|
||||
# GIT_WORK_TREE is ignored -> #0
|
||||
|
||||
test_expect_success '#1: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 1 1/sub 1.wt 1.wt/sub 1/wt 1/wt/sub &&
|
||||
cd 1 &&
|
||||
git init &&
|
||||
@ -174,7 +174,7 @@ EOF
|
||||
# - cwd can't be outside worktree
|
||||
|
||||
test_expect_success '#2: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 2 2/sub &&
|
||||
cd 2 && git init && cd ..
|
||||
'
|
||||
@ -241,7 +241,7 @@ EOF
|
||||
# - cwd can be outside worktree
|
||||
|
||||
test_expect_success '#3: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 3 3/sub 3/sub/sub 3.wt 3.wt/sub 3/wt 3/wt/sub &&
|
||||
cd 3 && git init && cd ..
|
||||
'
|
||||
@ -504,7 +504,7 @@ EOF
|
||||
# core.worktree is ignored -> #0
|
||||
|
||||
test_expect_success '#4: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 4 4/sub &&
|
||||
cd 4 &&
|
||||
git init &&
|
||||
@ -550,7 +550,7 @@ EOF
|
||||
# GIT_WORK_TREE/core.worktree are ignored -> #0
|
||||
|
||||
test_expect_success '#5: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 5 5/sub &&
|
||||
cd 5 &&
|
||||
git init &&
|
||||
@ -602,7 +602,7 @@ EOF
|
||||
# - cwd can be outside worktree
|
||||
|
||||
test_expect_success '#6: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 6 6/sub 6/sub/sub 6.wt 6.wt/sub 6/wt 6/wt/sub &&
|
||||
cd 6 && git init && cd ..
|
||||
'
|
||||
@ -889,7 +889,7 @@ EOF
|
||||
# core.worktree is overridden by GIT_WORK_TREE -> #3
|
||||
|
||||
test_expect_success '#7: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 7 7/sub 7/sub/sub 7.wt 7.wt/sub 7/wt 7/wt/sub &&
|
||||
cd 7 &&
|
||||
git init &&
|
||||
@ -1155,7 +1155,7 @@ EOF
|
||||
# #0 except that git_dir is set by .git file
|
||||
|
||||
test_expect_success '#8: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 8 8/sub &&
|
||||
cd 8 &&
|
||||
git init &&
|
||||
@ -1202,7 +1202,7 @@ EOF
|
||||
# #1 except that git_dir is set by .git file
|
||||
|
||||
test_expect_success '#9: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 9 9/sub 9.wt 9.wt/sub 9/wt 9/wt/sub &&
|
||||
cd 9 &&
|
||||
git init &&
|
||||
@ -1251,7 +1251,7 @@ EOF
|
||||
# #2 except that git_dir is set by .git file
|
||||
|
||||
test_expect_success '#10: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 10 10/sub &&
|
||||
cd 10 &&
|
||||
git init &&
|
||||
@ -1318,7 +1318,7 @@ EOF
|
||||
# #3 except that git_dir is set by .git file
|
||||
|
||||
test_expect_success '#11: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 11 11/sub 11/sub/sub 11.wt 11.wt/sub 11/wt 11/wt/sub &&
|
||||
cd 11 &&
|
||||
git init &&
|
||||
@ -1586,7 +1586,7 @@ EOF
|
||||
|
||||
|
||||
test_expect_success '#12: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 12 12/sub 12/sub/sub 12.wt 12.wt/sub 12/wt 12/wt/sub &&
|
||||
cd 12 &&
|
||||
git init &&
|
||||
@ -1634,7 +1634,7 @@ EOF
|
||||
# #5 except that git_dir is set by .git file
|
||||
|
||||
test_expect_success '#13: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 13 13/sub 13/sub/sub 13.wt 13.wt/sub 13/wt 13/wt/sub &&
|
||||
cd 13 &&
|
||||
git init &&
|
||||
@ -1684,7 +1684,7 @@ EOF
|
||||
# #6 except that git_dir is set by .git file
|
||||
|
||||
test_expect_success '#14: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 14 14/sub 14/sub/sub 14.wt 14.wt/sub 14/wt 14/wt/sub &&
|
||||
cd 14 &&
|
||||
git init &&
|
||||
@ -1975,7 +1975,7 @@ EOF
|
||||
# #7 except that git_dir is set by .git file
|
||||
|
||||
test_expect_success '#15: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 15 15/sub 15/sub/sub 15.wt 15.wt/sub 15/wt 15/wt/sub &&
|
||||
cd 15 &&
|
||||
git init &&
|
||||
@ -2247,7 +2247,7 @@ EOF
|
||||
# - cwd can't be outside worktree
|
||||
|
||||
test_expect_success '#16.1: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 16 16/sub &&
|
||||
cd 16 &&
|
||||
git init &&
|
||||
@ -2378,7 +2378,7 @@ EOF
|
||||
# GIT_WORK_TREE is ignored -> #16.1 (with warnings perhaps)
|
||||
|
||||
test_expect_success '#17.1: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 17 17/sub &&
|
||||
cd 17 &&
|
||||
git init &&
|
||||
@ -2511,7 +2511,7 @@ EOF
|
||||
# - cwd can't be outside worktree
|
||||
|
||||
test_expect_success '#18: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 18 18/sub &&
|
||||
cd 18 &&
|
||||
git init &&
|
||||
@ -2578,7 +2578,7 @@ EOF
|
||||
# bare repo is overridden by GIT_WORK_TREE -> #3
|
||||
|
||||
test_expect_success '#19: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 19 19/sub 19/sub/sub 19.wt 19.wt/sub 19/wt 19/wt/sub &&
|
||||
cd 19 &&
|
||||
git init &&
|
||||
@ -2844,7 +2844,7 @@ EOF
|
||||
# core.worktree is ignored -> #16.1
|
||||
|
||||
test_expect_success '#20.1: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 20 20/sub &&
|
||||
cd 20 &&
|
||||
git init &&
|
||||
@ -2972,7 +2972,7 @@ EOF
|
||||
# GIT_WORK_TREE/core.worktree are ignored -> #20.1
|
||||
|
||||
test_expect_success '#21.1: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 21 21/sub &&
|
||||
cd 21 &&
|
||||
git init &&
|
||||
@ -3108,7 +3108,7 @@ EOF
|
||||
# - cwd can be outside worktree
|
||||
|
||||
test_expect_success '#22.1: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 22 &&
|
||||
cd 22 &&
|
||||
git init &&
|
||||
@ -3439,7 +3439,7 @@ test_expect_success '#22.2: at root' '
|
||||
# core.worktree is overridden by GIT_WORK_TREE -> #19
|
||||
|
||||
test_expect_success '#23: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 23 23/sub 23/sub/sub 23.wt 23.wt/sub 23/wt 23/wt/sub &&
|
||||
cd 23 &&
|
||||
git init &&
|
||||
@ -3706,7 +3706,7 @@ EOF
|
||||
# #16.2 except git_dir is set according to .git file
|
||||
|
||||
test_expect_success '#24: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 24 24/sub &&
|
||||
cd 24 &&
|
||||
git init &&
|
||||
@ -3754,7 +3754,7 @@ EOF
|
||||
# #17.2 except git_dir is set according to .git file
|
||||
|
||||
test_expect_success '#25: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 25 25/sub &&
|
||||
cd 25 &&
|
||||
git init &&
|
||||
@ -3804,7 +3804,7 @@ EOF
|
||||
# #18 except git_dir is set according to .git file
|
||||
|
||||
test_expect_success '#26: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 26 26/sub &&
|
||||
cd 26 &&
|
||||
git init &&
|
||||
@ -3872,7 +3872,7 @@ EOF
|
||||
# #19 except git_dir is set according to .git file
|
||||
|
||||
test_expect_success '#27: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 27 27/sub 27/sub/sub 27.wt 27.wt/sub 27/wt 27/wt/sub &&
|
||||
cd 27 &&
|
||||
git init &&
|
||||
@ -4140,7 +4140,7 @@ EOF
|
||||
# core.worktree is ignored -> #24
|
||||
|
||||
test_expect_success '#28: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 28 28/sub &&
|
||||
cd 28 &&
|
||||
git init &&
|
||||
@ -4189,7 +4189,7 @@ EOF
|
||||
# GIT_WORK_TREE/core.worktree are ignored -> #28
|
||||
|
||||
test_expect_success '#29: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 29 29/sub &&
|
||||
cd 29 &&
|
||||
git init &&
|
||||
@ -4239,7 +4239,7 @@ EOF
|
||||
# core.worktree and core.bare conflict, won't fly.
|
||||
|
||||
test_expect_success '#30: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 30 &&
|
||||
cd 30 &&
|
||||
git init &&
|
||||
@ -4278,7 +4278,7 @@ test_expect_success '#30: at root' '
|
||||
# #23 except git_dir is set according to .git file
|
||||
|
||||
test_expect_success '#31: setup' '
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||
mkdir 31 31/sub 31/sub/sub 31.wt 31.wt/sub 31/wt 31/wt/sub &&
|
||||
cd 31 &&
|
||||
git init &&
|
||||
|
@ -13,16 +13,19 @@ test_description='merge-recursive options
|
||||
|
||||
. ./test-lib.sh
|
||||
|
||||
test_have_prereq SED_STRIPS_CR && SED_OPTIONS=-b
|
||||
test_have_prereq MINGW && export GREP_OPTIONS=-U
|
||||
|
||||
test_expect_success 'setup' '
|
||||
conflict_hunks () {
|
||||
sed -n -e "
|
||||
/^<<<</ b inconflict
|
||||
sed $SED_OPTIONS -n -e "
|
||||
/^<<<</ b conflict
|
||||
b
|
||||
: inconflict
|
||||
: conflict
|
||||
p
|
||||
/^>>>>/ b
|
||||
n
|
||||
b inconflict
|
||||
b conflict
|
||||
" "$@"
|
||||
} &&
|
||||
|
||||
|
@ -1067,7 +1067,7 @@ test_expect_success 'git notes copy diagnoses too many or too few parameters' '
|
||||
|
||||
test_expect_success 'git notes get-ref (no overrides)' '
|
||||
git config --unset core.notesRef &&
|
||||
unset GIT_NOTES_REF &&
|
||||
sane_unset GIT_NOTES_REF &&
|
||||
test "$(git notes get-ref)" = "refs/notes/commits"
|
||||
'
|
||||
|
||||
|
@ -32,7 +32,7 @@ EOF
|
||||
|
||||
sed 's/beer\\/beer,\\/' < Beer.java > Beer-correct.java
|
||||
|
||||
builtin_patterns="bibtex cpp csharp fortran html java objc pascal php python ruby tex"
|
||||
builtin_patterns="bibtex cpp csharp fortran html java objc pascal perl php python ruby tex"
|
||||
for p in $builtin_patterns
|
||||
do
|
||||
test_expect_success "builtin $p pattern compiles" '
|
||||
|
@ -14,7 +14,7 @@ test_description='CRLF merge conflict across text=auto change
|
||||
|
||||
. ./test-lib.sh
|
||||
|
||||
test_have_prereq MINGW && SED_OPTIONS=-b
|
||||
test_have_prereq SED_STRIPS_CR && SED_OPTIONS=-b
|
||||
|
||||
test_expect_success setup '
|
||||
git config core.autocrlf false &&
|
||||
|
@ -446,4 +446,42 @@ test_expect_success 'add should fail when path is used by an existing directory'
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success 'set up for relative path tests' '
|
||||
mkdir reltest &&
|
||||
(
|
||||
cd reltest &&
|
||||
git init &&
|
||||
mkdir sub &&
|
||||
(
|
||||
cd sub &&
|
||||
git init &&
|
||||
test_commit foo
|
||||
) &&
|
||||
git add sub &&
|
||||
git config -f .gitmodules submodule.sub.path sub &&
|
||||
git config -f .gitmodules submodule.sub.url ../subrepo &&
|
||||
cp .git/config pristine-.git-config
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success 'relative path works with URL' '
|
||||
(
|
||||
cd reltest &&
|
||||
cp pristine-.git-config .git/config &&
|
||||
git config remote.origin.url ssh://hostname/repo &&
|
||||
git submodule init &&
|
||||
test "$(git config submodule.sub.url)" = ssh://hostname/subrepo
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success 'relative path works with user@host:path' '
|
||||
(
|
||||
cd reltest &&
|
||||
cp pristine-.git-config .git/config &&
|
||||
git config remote.origin.url user@host:repo &&
|
||||
git submodule init &&
|
||||
test "$(git config submodule.sub.url)" = user@host:subrepo
|
||||
)
|
||||
'
|
||||
|
||||
test_done
|
||||
|
@ -265,7 +265,7 @@ test_expect_success $PREREQ 'Author From: in message body' '
|
||||
--to=nobody@example.com \
|
||||
--smtp-server="$(pwd)/fake.sendmail" \
|
||||
$patches &&
|
||||
sed "1,/^\$/d" < msgtxt1 > msgbody1
|
||||
sed "1,/^\$/d" < msgtxt1 > msgbody1 &&
|
||||
grep "From: A <author@example.com>" msgbody1
|
||||
'
|
||||
|
||||
@ -276,7 +276,7 @@ test_expect_success $PREREQ 'Author From: not in message body' '
|
||||
--to=nobody@example.com \
|
||||
--smtp-server="$(pwd)/fake.sendmail" \
|
||||
$patches &&
|
||||
sed "1,/^\$/d" < msgtxt1 > msgbody1
|
||||
sed "1,/^\$/d" < msgtxt1 > msgbody1 &&
|
||||
! grep "From: A <author@example.com>" msgbody1
|
||||
'
|
||||
|
||||
@ -298,7 +298,7 @@ test_expect_success $PREREQ 'Invalid In-Reply-To' '
|
||||
--in-reply-to=" " \
|
||||
--smtp-server="$(pwd)/fake.sendmail" \
|
||||
$patches \
|
||||
2>errors
|
||||
2>errors &&
|
||||
! grep "^In-Reply-To: < *>" msgtxt1
|
||||
'
|
||||
|
||||
@ -617,7 +617,7 @@ EOF
|
||||
"
|
||||
|
||||
test_expect_success $PREREQ '--suppress-cc=sob' '
|
||||
git config --unset sendemail.cccmd
|
||||
test_might_fail git config --unset sendemail.cccmd &&
|
||||
test_suppression sob
|
||||
'
|
||||
|
||||
@ -1135,7 +1135,7 @@ test_expect_success $PREREQ '--8bit-encoding also treats subject' '
|
||||
# Note that the patches in this test are deliberately out of order; we
|
||||
# want to make sure it works even if the cover-letter is not in the
|
||||
# first mail.
|
||||
test_expect_success 'refusing to send cover letter template' '
|
||||
test_expect_success $PREREQ 'refusing to send cover letter template' '
|
||||
clean_fake_sendmail &&
|
||||
rm -fr outdir &&
|
||||
git format-patch --cover-letter -2 -o outdir &&
|
||||
@ -1151,7 +1151,7 @@ test_expect_success 'refusing to send cover letter template' '
|
||||
test -z "$(ls msgtxt*)"
|
||||
'
|
||||
|
||||
test_expect_success '--force sends cover letter template anyway' '
|
||||
test_expect_success $PREREQ '--force sends cover letter template anyway' '
|
||||
clean_fake_sendmail &&
|
||||
rm -fr outdir &&
|
||||
git format-patch --cover-letter -2 -o outdir &&
|
||||
|
@ -4,45 +4,55 @@ test_description='check svn dumpfile importer'
|
||||
|
||||
. ./test-lib.sh
|
||||
|
||||
if ! svnadmin -h >/dev/null 2>&1
|
||||
then
|
||||
skip_all='skipping svn-fe tests, svn not available'
|
||||
test_done
|
||||
fi
|
||||
reinit_git () {
|
||||
rm -fr .git &&
|
||||
git init
|
||||
}
|
||||
|
||||
svnconf=$PWD/svnconf
|
||||
export svnconf
|
||||
>empty
|
||||
|
||||
svn_cmd () {
|
||||
subcommand=$1 &&
|
||||
shift &&
|
||||
test_expect_success 'empty dump' '
|
||||
reinit_git &&
|
||||
echo "SVN-fs-dump-format-version: 2" >input &&
|
||||
test-svn-fe input >stream &&
|
||||
git fast-import <stream
|
||||
'
|
||||
|
||||
test_expect_success 'v3 dumps not supported' '
|
||||
reinit_git &&
|
||||
echo "SVN-fs-dump-format-version: 3" >input &&
|
||||
test_must_fail test-svn-fe input >stream &&
|
||||
test_cmp empty stream
|
||||
'
|
||||
|
||||
test_expect_success 'set up svn repo' '
|
||||
svnconf=$PWD/svnconf &&
|
||||
mkdir -p "$svnconf" &&
|
||||
svn "$subcommand" --config-dir "$svnconf" "$@"
|
||||
}
|
||||
|
||||
test_dump () {
|
||||
label=$1
|
||||
dump=$2
|
||||
test_expect_success "$dump" '
|
||||
svnadmin create "$label-svn" &&
|
||||
svnadmin load "$label-svn" < "$TEST_DIRECTORY/$dump" &&
|
||||
svn_cmd export "file://$PWD/$label-svn" "$label-svnco" &&
|
||||
git init "$label-git" &&
|
||||
test-svn-fe "$TEST_DIRECTORY/$dump" >"$label.fe" &&
|
||||
(
|
||||
cd "$label-git" &&
|
||||
git fast-import < ../"$label.fe"
|
||||
) &&
|
||||
(
|
||||
cd "$label-svnco" &&
|
||||
git init &&
|
||||
git add . &&
|
||||
git fetch "../$label-git" master &&
|
||||
git diff --exit-code FETCH_HEAD
|
||||
)
|
||||
'
|
||||
}
|
||||
if
|
||||
svnadmin -h >/dev/null 2>&1 &&
|
||||
svnadmin create simple-svn &&
|
||||
svnadmin load simple-svn <"$TEST_DIRECTORY/t9135/svn.dump" &&
|
||||
svn export --config-dir "$svnconf" "file://$PWD/simple-svn" simple-svnco
|
||||
then
|
||||
test_set_prereq SVNREPO
|
||||
fi
|
||||
'
|
||||
|
||||
test_dump simple t9135/svn.dump
|
||||
test_expect_success SVNREPO 't9135/svn.dump' '
|
||||
git init simple-git &&
|
||||
test-svn-fe "$TEST_DIRECTORY/t9135/svn.dump" >simple.fe &&
|
||||
(
|
||||
cd simple-git &&
|
||||
git fast-import <../simple.fe
|
||||
) &&
|
||||
(
|
||||
cd simple-svnco &&
|
||||
git init &&
|
||||
git add . &&
|
||||
git fetch ../simple-git master &&
|
||||
git diff --exit-code FETCH_HEAD
|
||||
)
|
||||
'
|
||||
|
||||
test_done
|
||||
|
@ -6,6 +6,14 @@
|
||||
test_description='git svn merge detection'
|
||||
. ./lib-git-svn.sh
|
||||
|
||||
svn_ver="$(svn --version --quiet)"
|
||||
case $svn_ver in
|
||||
0.* | 1.[0-4].*)
|
||||
skip_all="skipping git-svn test - SVN too old ($svn_ver)"
|
||||
test_done
|
||||
;;
|
||||
esac
|
||||
|
||||
test_expect_success 'initialize source svn repo' '
|
||||
svn_cmd mkdir -m x "$svnrepo"/trunk &&
|
||||
svn_cmd mkdir -m x "$svnrepo"/branches &&
|
||||
|
@ -89,7 +89,8 @@ EOF
|
||||
test_expect_success PERL 'update git module' '
|
||||
|
||||
(cd module-git &&
|
||||
git cvsimport -a -R -z 0 module &&
|
||||
git config cvsimport.trackRevisions true &&
|
||||
git cvsimport -a -z 0 module &&
|
||||
git merge origin
|
||||
) &&
|
||||
test_cmp module-cvs/o_fortuna module-git/o_fortuna
|
||||
@ -117,7 +118,8 @@ test_expect_success PERL 'cvsimport.module config works' '
|
||||
|
||||
(cd module-git &&
|
||||
git config cvsimport.module module &&
|
||||
git cvsimport -a -R -z0 &&
|
||||
git config cvsimport.trackRevisions true &&
|
||||
git cvsimport -a -z0 &&
|
||||
git merge origin
|
||||
) &&
|
||||
test_cmp module-cvs/tick module-git/tick
|
||||
@ -137,6 +139,7 @@ test_expect_success PERL 'import from a CVS working tree' '
|
||||
|
||||
$CVS co -d import-from-wt module &&
|
||||
(cd import-from-wt &&
|
||||
git config cvsimport.trackRevisions false &&
|
||||
git cvsimport -a -z0 &&
|
||||
echo 1 >expect &&
|
||||
git log -1 --pretty=format:%s%n >actual &&
|
||||
|
@ -1057,6 +1057,13 @@ case $(uname -s) in
|
||||
# backslashes in pathspec are converted to '/'
|
||||
# exec does not inherit the PID
|
||||
test_set_prereq MINGW
|
||||
test_set_prereq SED_STRIPS_CR
|
||||
;;
|
||||
*CYGWIN*)
|
||||
test_set_prereq POSIXPERM
|
||||
test_set_prereq EXECKEEPSPID
|
||||
test_set_prereq NOT_MINGW
|
||||
test_set_prereq SED_STRIPS_CR
|
||||
;;
|
||||
*)
|
||||
test_set_prereq POSIXPERM
|
||||
|
9
trace.c
9
trace.c
@ -154,6 +154,7 @@ static const char *quote_crnl(const char *path)
|
||||
/* FIXME: move prefix to startup_info struct and get rid of this arg */
|
||||
void trace_repo_setup(const char *prefix)
|
||||
{
|
||||
const char *git_work_tree;
|
||||
char cwd[PATH_MAX];
|
||||
char *trace = getenv("GIT_TRACE");
|
||||
|
||||
@ -164,8 +165,14 @@ void trace_repo_setup(const char *prefix)
|
||||
if (!getcwd(cwd, PATH_MAX))
|
||||
die("Unable to get current working directory");
|
||||
|
||||
if (!(git_work_tree = get_git_work_tree()))
|
||||
git_work_tree = "(null)";
|
||||
|
||||
if (!prefix)
|
||||
prefix = "(null)";
|
||||
|
||||
trace_printf("setup: git_dir: %s\n", quote_crnl(get_git_dir()));
|
||||
trace_printf("setup: worktree: %s\n", quote_crnl(get_git_work_tree()));
|
||||
trace_printf("setup: worktree: %s\n", quote_crnl(git_work_tree));
|
||||
trace_printf("setup: cwd: %s\n", quote_crnl(cwd));
|
||||
trace_printf("setup: prefix: %s\n", quote_crnl(prefix));
|
||||
}
|
||||
|
17
userdiff.c
17
userdiff.c
@ -61,6 +61,23 @@ PATTERNS("pascal",
|
||||
"|[-+0-9.e]+|0[xXbB]?[0-9a-fA-F]+"
|
||||
"|<>|<=|>=|:=|\\.\\."
|
||||
"|[^[:space:]]|[\x80-\xff]+"),
|
||||
PATTERNS("perl",
|
||||
"^[ \t]*package .*;\n"
|
||||
"^[ \t]*sub .* \\{\n"
|
||||
"^[A-Z]+ \\{\n" /* BEGIN, END, ... */
|
||||
"^=head[0-9] ", /* POD */
|
||||
/* -- */
|
||||
"[[:alpha:]_'][[:alnum:]_']*"
|
||||
"|0[xb]?[0-9a-fA-F_]*"
|
||||
/* taking care not to interpret 3..5 as (3.)(.5) */
|
||||
"|[0-9a-fA-F_]+(\\.[0-9a-fA-F_]+)?([eE][-+]?[0-9_]+)?"
|
||||
"|=>|-[rwxoRWXOezsfdlpSugkbctTBMAC>]|~~|::"
|
||||
"|&&=|\\|\\|=|//=|\\*\\*="
|
||||
"|&&|\\|\\||//|\\+\\+|--|\\*\\*|\\.\\.\\.?"
|
||||
"|[-+*/%.^&<>=!|]="
|
||||
"|=~|!~"
|
||||
"|<<|<>|<=>|>>"
|
||||
"|[^[:space:]]"),
|
||||
PATTERNS("php",
|
||||
"^[\t ]*(((public|protected|private|static)[\t ]+)*function.*)$\n"
|
||||
"^[\t ]*(class.*)$",
|
||||
|
@ -51,14 +51,14 @@ static struct {
|
||||
} rev_ctx;
|
||||
|
||||
static struct {
|
||||
uint32_t uuid, url;
|
||||
uint32_t version, uuid, url;
|
||||
} dump_ctx;
|
||||
|
||||
static struct {
|
||||
uint32_t svn_log, svn_author, svn_date, svn_executable, svn_special, uuid,
|
||||
revision_number, node_path, node_kind, node_action,
|
||||
node_copyfrom_path, node_copyfrom_rev, text_content_length,
|
||||
prop_content_length, content_length;
|
||||
prop_content_length, content_length, svn_fs_dump_format_version;
|
||||
} keys;
|
||||
|
||||
static void reset_node_ctx(char *fname)
|
||||
@ -85,6 +85,7 @@ static void reset_rev_ctx(uint32_t revision)
|
||||
static void reset_dump_ctx(uint32_t url)
|
||||
{
|
||||
dump_ctx.url = url;
|
||||
dump_ctx.version = 1;
|
||||
dump_ctx.uuid = ~0;
|
||||
}
|
||||
|
||||
@ -105,6 +106,7 @@ static void init_keys(void)
|
||||
keys.text_content_length = pool_intern("Text-content-length");
|
||||
keys.prop_content_length = pool_intern("Prop-content-length");
|
||||
keys.content_length = pool_intern("Content-length");
|
||||
keys.svn_fs_dump_format_version = pool_intern("SVN-fs-dump-format-version");
|
||||
}
|
||||
|
||||
static void read_props(void)
|
||||
@ -206,7 +208,12 @@ void svndump_read(const char *url)
|
||||
*val++ = '\0';
|
||||
key = pool_intern(t);
|
||||
|
||||
if (key == keys.uuid) {
|
||||
if (key == keys.svn_fs_dump_format_version) {
|
||||
dump_ctx.version = atoi(val);
|
||||
if (dump_ctx.version > 2)
|
||||
die("expected svn dump format version <= 2, found %d",
|
||||
dump_ctx.version);
|
||||
} else if (key == keys.uuid) {
|
||||
dump_ctx.uuid = pool_intern(val);
|
||||
} else if (key == keys.revision_number) {
|
||||
if (active_ctx == NODE_CTX)
|
||||
|
Reference in New Issue
Block a user