Merge commit 'mingw/master' into devel

Conflicts:
	gitk-git/gitk
This commit is contained in:
Steffen Prohaska
2008-08-08 22:45:39 +02:00
75 changed files with 2306 additions and 1563 deletions

View File

@@ -36,7 +36,7 @@ Updates since v1.5.1
expansion). These conversions apply when checking files in
or out, and exporting via git-archive.
* The packfile format now optionally suports 64-bit index.
* The packfile format now optionally supports 64-bit index.
This release supports the "version 2" format of the .idx
file. This is automatically enabled when a huge packfile

View File

@@ -86,7 +86,7 @@ Updates since v1.5.2
- "git rev-list" learned --regexp-ignore-case and
--extended-regexp options to tweak its matching logic used
for --grep fitering.
for --grep filtering.
- "git describe --contains" is a handier way to call more
obscure command "git name-rev --tags".
@@ -243,7 +243,7 @@ Updates since v1.5.2
- We used to have core.legacyheaders configuration, when
set to false, allowed git to write loose objects in a format
that mimicks the format used by objects stored in packs. It
that mimics the format used by objects stored in packs. It
turns out that this was not so useful. Although we will
continue to read objects written in that format, we do not
honor that configuration anymore and create loose objects in
@@ -302,7 +302,7 @@ Updates since v1.5.2
small enough delta results it creates while looking for the
best delta candidates.
- "git pack-objects" learned a new heuristcs to prefer delta
- "git pack-objects" learned a new heuristic to prefer delta
that is shallower in depth over the smallest delta
possible. This improves both overall packfile access
performance and packfile density.

View File

@@ -55,7 +55,7 @@ Fixes since v1.5.4.3
* "git log --merge" did not work well with --left-right option.
* "git svn" promprted for client cert password every time it accessed the
* "git svn" prompted for client cert password every time it accessed the
server.
* The reset command in "git fast-import" data stream was documented to

View File

@@ -9,7 +9,7 @@ Fixes since v1.5.4.4
1.5.4).
* Bogus refspec configuration such as "remote.there.fetch = =" were not
detected as errors (regressionin 1.5.4).
detected as errors (regression in 1.5.4).
* You couldn't specify a custom editor whose path contains a whitespace
via GIT_EDITOR (and core.editor).

View File

@@ -0,0 +1,29 @@
GIT v1.5.6.5 Release Notes
==========================
Fixes since v1.5.6.4
--------------------
* "git cvsimport" used to spit out "UNKNOWN LINE..." diagnostics to stdout.
* "git commit -F filename" and "git tag -F filename" run from subdirectories
did not read the right file.
* "git init --template=" with blank "template" parameter linked files
under root directories to .git, which was a total nonsense. Instead, it
means "I do not want to use anything from the template directory".
* "git diff-tree" and other diff plumbing ignored diff.renamelimit configuration
variable when the user explicitly asked for rename detection.
* "git name-rev --name-only" did not work when "--stdin" option was in effect.
* "git show-branch" mishandled its 8th branch.
* Addition of "git update-index --ignore-submodules" that happened during
1.5.6 cycle broke "git update-index --ignore-missing".
* "git send-email" did not parse charset from an existing Content-type:
header properly.
Contains other various documentation fixes.

View File

@@ -142,6 +142,10 @@ Updates since v1.5.6
* git-archive uses the zlib default compression level when creating
zip archive.
* git-archive's command line options --exec and --remote can take their
parameters as separate command line arguments, similar to other commands.
IOW, both "--exec=path" and "--exec path" are now supported.
* With -v option, git-branch describes the remote tracking statistics
similar to the way git-checkout reports by how many commits your branch
is ahead/behind.
@@ -161,10 +165,16 @@ Updates since v1.5.6
* git-clone can clone from a remote whose URL would be rewritten by
configuration stored in $HOME/.gitconfig now.
* "git-clone --mirror" is a handy way to set up a bare mirror repository.
* git-cvsserver learned to respond to "cvs co -c".
* git-diff --check now checks leftover merge conflict markers.
* "git-diff -p" learned to grab a better hunk header lines in
Pascal/Delphi and Ruby source files, and also pays attention to
chapter and part boundary in TeX documents.
* When remote side used to have branch 'foo' and git-fetch finds that now
it has branch 'foo/bar', it refuses to lose the existing remote tracking
branch and its reflog. The error message has been improved to suggest
@@ -176,6 +186,10 @@ Updates since v1.5.6
* fast-import and fast-export learned to export and import gitlinks.
* "gitk" left background process behind after begin asked to dig very deep
history and the user killed the UI; the process is killed when the UI goes
away now.
* git-rebase records the original tip of branch in ORIG_HEAD before it is
rewound.
@@ -187,7 +201,7 @@ Updates since v1.5.6
command internally uses rev-parse to interpret its arguments.
* git-rev-list learned --children option to show child commits it
encountered during the traversal, instead of shoing parent commits.
encountered during the traversal, instead of showing parent commits.
* git-send-mail can talk not just over SSL but over TLS now.
@@ -234,6 +248,6 @@ this release, unless otherwise noted.
---
exec >/var/tmp/1
O=v1.6.0-rc0-104-g81dc230
O=v1.6.0-rc1-113-gf44bc33
echo O=$(git describe refs/heads/master)
git shortlog --no-merges $O..refs/heads/master ^refs/heads/maint

View File

@@ -693,7 +693,7 @@ gitcvs.usecrlfattr
files to determine the '-k' modes to use. If `crlf` is set,
the '-k' mode will be left blank, so cvs clients will
treat it as text. If `crlf` is explicitly unset, the file
will be set with '-kb' mode, which supresses any newline munging
will be set with '-kb' mode, which suppresses any newline munging
the client might otherwise do. If `crlf` is not specified,
then 'gitcvs.allbinary' is used. See linkgit:gitattributes[5].

View File

@@ -81,7 +81,7 @@ object specified on stdin:
------------
If '--batch-check' is specified, output of the following form is printed for
each object specified fon stdin:
each object specified on stdin:
------------
<sha1> SP <type> SP <size> LF

View File

@@ -8,7 +8,7 @@ git-clean - Remove untracked files from the working tree
SYNOPSIS
--------
[verse]
'git clean' [-d] [-f] [-n] [-q] [-x | -X] [--] <paths>...
'git clean' [-d] [-f] [-n] [-q] [-x | -X] [--] <path>...
DESCRIPTION
-----------
@@ -16,8 +16,8 @@ Removes files unknown to git. This allows to clean the working tree
from files that are not under version control. If the '-x' option is
specified, ignored files are also removed, allowing to remove all
build products.
When optional `<paths>...` arguments are given, the paths
affected are further limited to those that match them.
If any optional `<path>...` arguments are given, only those paths
are affected.
OPTIONS

View File

@@ -10,7 +10,7 @@ SYNOPSIS
--------
[verse]
'git clone' [--template=<template_directory>]
[-l] [-s] [--no-hardlinks] [-q] [-n] [--bare]
[-l] [-s] [--no-hardlinks] [-q] [-n] [--bare] [--mirror]
[-o <name>] [-u <upload-pack>] [--reference <repository>]
[--depth <depth>] [--] <repository> [<directory>]
@@ -106,6 +106,9 @@ then the cloned repository will become corrupt.
used, neither remote-tracking branches nor the related
configuration variables are created.
--mirror::
Set up a mirror of the remote repository. This implies --bare.
--origin <name>::
-o <name>::
Instead of using the remote name 'origin' to keep track

View File

@@ -21,8 +21,8 @@ abbreviated object name of the most recent commit.
OPTIONS
-------
<committish>::
The object name of the committish.
<committish>...::
Committish object names to describe.
--all::
Instead of using only the annotated tags, use any ref

View File

@@ -49,13 +49,13 @@ include::diff-options.txt[]
--stdin::
When '--stdin' is specified, the command does not take
<tree-ish> arguments from the command line. Instead, it
reads either one <commit> or a pair of <tree-ish>
reads either one <commit> or a list of <commit>
separated with a single space from its standard input.
+
When a single commit is given on one line of such input, it compares
the commit with its parents. The following flags further affects its
behavior. This does not apply to the case where two <tree-ish>
separated with a single space are given.
behavior. The remaining commits, when given, are used as if they are
parents of the first commit.
-m::
By default, 'git-diff-tree --stdin' does not show

View File

@@ -167,7 +167,7 @@ to other tags will be rewritten to point to the underlying commit.
directory or when there are already refs starting with
'refs/original/', unless forced.
<rev-list-options>::
<rev-list options>...::
When options are given after the new branch name, they will
be passed to 'git-rev-list'. Only commits in the resulting
output will be filtered, although the filtered commits can still

View File

@@ -47,9 +47,9 @@ OPTIONS
`xx`; for example `%00` interpolates to `\0` (NUL),
`%09` to `\t` (TAB) and `%0a` to `\n` (LF).
<pattern>::
<pattern>...::
If one or more patterns are given, only refs are shown that
match againt at least one pattern, either using fnmatch(3) or
match against at least one pattern, either using fnmatch(3) or
literally, in the latter case matching completely or from the
beginning up to a slash.

View File

@@ -41,10 +41,10 @@ include::diff-options.txt[]
Print out the ref names of any commits that are shown.
--full-diff::
Without this flag, "git log -p <paths>..." shows commits that
Without this flag, "git log -p <path>..." shows commits that
touch the specified paths, and diffs about the same specified
paths. With this, the full diff is shown for commits that touch
the specified paths; this means that "<paths>..." limits only
the specified paths; this means that "<path>..." limits only
commits, and doesn't limit diff for those commits.
--follow::
@@ -57,7 +57,7 @@ include::diff-options.txt[]
Note that only message is considered, if also a diff is shown
its size is not included.
<paths>...::
<path>...::
Show only commits that affect any of the specified paths.

View File

@@ -32,8 +32,8 @@ include::merge-options.txt[]
it is created). The 'git-fmt-merge-msg' script can be used
to give a good default for automated 'git-merge' invocations.
<remote>::
Other branch head merged into our branch. You need at
<remote>...::
Other branch heads to merge into our branch. You need at
least one <remote>. Specifying more than one <remote>
obviously means you are trying an Octopus.

View File

@@ -40,7 +40,7 @@ tool is available in PATH.
+
Instead of running one of the known merge tool programs
'git-mergetool' can be customized to run an alternative program
by specifying the command line to invoke in a configration
by specifying the command line to invoke in a configuration
variable `mergetool.<tool>.cmd`.
+
When 'git-mergetool' is invoked with this tool (either through the

View File

@@ -38,8 +38,7 @@ OPTIONS
Instead of printing both the SHA-1 and the name, print only
the name. If given with --tags the usual tag prefix of
"tags/" is also omitted from the name, matching the output
of 'git-describe' more closely. This option
cannot be combined with --stdin.
of `git-describe` more closely.
--no-undefined::
Die with error code != 0 when a reference is undefined,

View File

@@ -56,7 +56,7 @@ The --cc option must be repeated for each user you want on the cc list.
--from::
Specify the sender of the emails. This will default to
the value GIT_COMMITTER_IDENT, as returned by "git-var -l".
the value GIT_COMMITTER_IDENT, as returned by "git var -l".
The user will still be prompted to confirm this entry.
--in-reply-to::

View File

@@ -84,7 +84,7 @@ OPTIONS
(5) otherwise output the line.
<pattern>::
<pattern>...::
Show references matching one or more patterns.

View File

@@ -33,8 +33,8 @@ This manual page describes only the most frequently used options.
OPTIONS
-------
<object>::
The name of the object to show.
<object>...::
The names of objects to show.
For a more complete list of ways to spell object names, see
"SPECIFYING REVISIONS" section in linkgit:git-rev-parse[1].

View File

@@ -146,8 +146,8 @@ OPTIONS
(the default). This limit only applies to modified submodules. The
size is always limited to 1 for added/deleted/typechanged submodules.
<path>::
Path to submodule(s). When specified this will restrict the command
<path>...::
Paths to submodule(s). When specified this will restrict the command
to only operate on the submodules found at the specified paths.
(This argument is required with add).

View File

@@ -13,7 +13,7 @@ DESCRIPTION
-----------
'git-svn' is a simple conduit for changesets between Subversion and git.
It provides a bidirectional flow of changes between a Subversion and a git
respository.
repository.
'git-svn' can track a single Subversion branch simply by using a
URL to the branch, follow branches laid out in the Subversion recommended
@@ -209,7 +209,7 @@ Any other arguments are passed directly to 'git-log'
Recursively finds the svn:ignore property on directories and
creates matching .gitignore files. The resulting files are staged to
be committed, but are not committed. Use -r/--revision to refer to a
specfic revision.
specific revision.
'show-ignore'::
Recursively finds and lists the svn:ignore property on

View File

@@ -15,8 +15,8 @@ Validates the gpg signature created by 'git-tag'.
OPTIONS
-------
<tag>::
SHA1 identifier of a git tag object.
<tag>...::
SHA1 identifiers of git tag objects.
Author
------

View File

@@ -43,9 +43,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.5.6.4/git.html[documentation for release 1.5.6.4]
* link:v1.5.6.5/git.html[documentation for release 1.5.6.5]
* release notes for
link:RelNotes-1.5.6.5.txt[1.5.6.5],
link:RelNotes-1.5.6.4.txt[1.5.6.4],
link:RelNotes-1.5.6.3.txt[1.5.6.3],
link:RelNotes-1.5.6.2.txt[1.5.6.2],
@@ -602,7 +603,7 @@ contributors on the git-list <git@vger.kernel.org>.
SEE ALSO
--------
linkgit:gittutorial[7], linkgit:gittutorial-2[7],
linkgit:everyday[7], linkgit:gitcvs-migration[7],
link:everyday.html[Everyday Git], linkgit:gitcvs-migration[7],
linkgit:gitglossary[7], linkgit:gitcore-tutorial[7],
linkgit:gitcli[7], link:user-manual.html[The Git User's Manual]

View File

@@ -58,7 +58,7 @@ frequently used options.
For a more complete list of ways to spell object names, see
"SPECIFYING REVISIONS" section in linkgit:git-rev-parse[1].
<path>::
<path>...::
Limit commits to the ones touching files in the given paths. Note, to
avoid ambiguity wrt. revision names use "--" to separate the paths

View File

@@ -1,5 +1,5 @@
merge.stat::
Whether to print the diffstat berween ORIG_HEAD and merge result
Whether to print the diffstat between ORIG_HEAD and merge result
at the end of the merge. True by default.
merge.log::
@@ -16,7 +16,7 @@ merge.tool::
linkgit:git-mergetool[1]. Valid built-in values are: "kdiff3",
"tkdiff", "meld", "xxdiff", "emerge", "vimdiff", "gvimdiff", and
"opendiff". Any other value is treated is custom merge tool
and there must be a corresponing mergetool.<tool>.cmd option.
and there must be a corresponding mergetool.<tool>.cmd option.
merge.verbosity::
Controls the amount of output shown by the recursive merge

View File

@@ -479,10 +479,10 @@ Bisecting: 3537 revisions left to test after this
-------------------------------------------------
If you run "git branch" at this point, you'll see that git has
temporarily moved you to a new branch named "bisect". This branch
points to a commit (with commit id 65934...) that is reachable from
"master" but not from v2.6.18. Compile and test it, and see whether
it crashes. Assume it does crash. Then:
temporarily moved you in "(no branch)". HEAD is now detached from any
branch and points directly to a commit (with commit id 65934...) that
is reachable from "master" but not from v2.6.18. Compile and test it,
and see whether it crashes. Assume it does crash. Then:
-------------------------------------------------
$ git bisect bad
@@ -504,8 +504,7 @@ report with the commit id. Finally, run
$ git bisect reset
-------------------------------------------------
to return you to the branch you were on before and delete the
temporary "bisect" branch.
to return you to the branch you were on before.
Note that the version which git-bisect checks out for you at each
point is just a suggestion, and you're free to try a different
@@ -528,6 +527,22 @@ $ git reset --hard fb47ddb2db...
then test, run "bisect good" or "bisect bad" as appropriate, and
continue.
Instead of "git bisect visualize" and then "git reset --hard
fb47ddb2db...", you might just want to tell git that you want to skip
the current commit:
-------------------------------------------------
$ git bisect skip
-------------------------------------------------
In this case, though, git may not eventually be able to tell the first
bad one between some first skipped commits and a latter bad commit.
There are also ways to automate the bisecting process if you have a
test script that can tell a good from a bad commit. See
linkgit:git-bisect[1] for more information about this and other "git
bisect" features.
[[naming-commits]]
Naming commits
--------------

View File

@@ -30,7 +30,7 @@ Issues of note:
around 1997), it changed its name to gnuit and the name conflict is no
longer a problem.
NOTE: When compiled with backward compatiblity option, the GNU
NOTE: When compiled with backward compatibility option, the GNU
Interactive Tools package still can install "git", but you can build it
with --disable-transition option to avoid this.
@@ -73,7 +73,7 @@ Issues of note:
- "ssh" is used to push and pull over the net
- "perl" and POSIX-compliant shells are needed to use most of
the barebone Porcelainish scripts.
the bare-bones Porcelainish scripts.
- Some platform specific issues are dealt with Makefile rules,
but depending on your specific installation, you may not

104
archive.c
View File

@@ -3,9 +3,15 @@
#include "tree-walk.h"
#include "attr.h"
#include "archive.h"
#include "parse-options.h"
static const char archive_usage[] = \
"git archive --format=<fmt> [--prefix=<prefix>/] [--verbose] [<extra>] <tree-ish> [path...]";
static char const * const archive_usage[] = {
"git archive [options] <tree-ish> [path...]",
"git archive --list",
"git archive --remote <repo> [--exec <cmd>] [options] <tree-ish> [path...]",
"git archive --remote <repo> [--exec <cmd>] --list",
NULL
};
#define USES_ZLIB_COMPRESSION 1
@@ -175,6 +181,9 @@ static const struct archiver *lookup_archiver(const char *name)
{
int i;
if (!name)
return NULL;
for (i = 0; i < ARRAY_SIZE(archivers); i++) {
if (!strcmp(name, archivers[i].name))
return &archivers[i];
@@ -232,51 +241,70 @@ static void parse_treeish_arg(const char **argv,
ar_args->time = archive_time;
}
#define OPT__COMPR(s, v, h, p) \
{ OPTION_SET_INT, (s), NULL, (v), NULL, (h), \
PARSE_OPT_NOARG | PARSE_OPT_NONEG, NULL, (p) }
#define OPT__COMPR_HIDDEN(s, v, p) \
{ OPTION_SET_INT, (s), NULL, (v), NULL, "", \
PARSE_OPT_NOARG | PARSE_OPT_NONEG | PARSE_OPT_HIDDEN, NULL, (p) }
static int parse_archive_args(int argc, const char **argv,
const struct archiver **ar, struct archiver_args *args)
{
const char *format = "tar";
const char *base = "";
const char *base = NULL;
const char *remote = NULL;
const char *exec = NULL;
int compression_level = -1;
int verbose = 0;
int i;
int list = 0;
struct option opts[] = {
OPT_GROUP(""),
OPT_STRING(0, "format", &format, "fmt", "archive format"),
OPT_STRING(0, "prefix", &base, "prefix",
"prepend prefix to each pathname in the archive"),
OPT__VERBOSE(&verbose),
OPT__COMPR('0', &compression_level, "store only", 0),
OPT__COMPR('1', &compression_level, "compress faster", 1),
OPT__COMPR_HIDDEN('2', &compression_level, 2),
OPT__COMPR_HIDDEN('3', &compression_level, 3),
OPT__COMPR_HIDDEN('4', &compression_level, 4),
OPT__COMPR_HIDDEN('5', &compression_level, 5),
OPT__COMPR_HIDDEN('6', &compression_level, 6),
OPT__COMPR_HIDDEN('7', &compression_level, 7),
OPT__COMPR_HIDDEN('8', &compression_level, 8),
OPT__COMPR('9', &compression_level, "compress better", 9),
OPT_GROUP(""),
OPT_BOOLEAN('l', "list", &list,
"list supported archive formats"),
OPT_GROUP(""),
OPT_STRING(0, "remote", &remote, "repo",
"retrieve the archive from remote repository <repo>"),
OPT_STRING(0, "exec", &exec, "cmd",
"path to the remote git-upload-archive command"),
OPT_END()
};
for (i = 1; i < argc; i++) {
const char *arg = argv[i];
argc = parse_options(argc, argv, opts, archive_usage, 0);
if (!strcmp(arg, "--list") || !strcmp(arg, "-l")) {
for (i = 0; i < ARRAY_SIZE(archivers); i++)
printf("%s\n", archivers[i].name);
exit(0);
}
if (!strcmp(arg, "--verbose") || !strcmp(arg, "-v")) {
verbose = 1;
continue;
}
if (!prefixcmp(arg, "--format=")) {
format = arg + 9;
continue;
}
if (!prefixcmp(arg, "--prefix=")) {
base = arg + 9;
continue;
}
if (!strcmp(arg, "--")) {
i++;
break;
}
if (arg[0] == '-' && isdigit(arg[1]) && arg[2] == '\0') {
compression_level = arg[1] - '0';
continue;
}
if (arg[0] == '-')
die("Unknown argument: %s", arg);
break;
if (remote)
die("Unexpected option --remote");
if (exec)
die("Option --exec can only be used together with --remote");
if (!base)
base = "";
if (list) {
for (i = 0; i < ARRAY_SIZE(archivers); i++)
printf("%s\n", archivers[i].name);
exit(0);
}
/* We need at least one parameter -- tree-ish */
if (argc - 1 < i)
usage(archive_usage);
if (argc < 1)
usage_with_options(archive_usage, opts);
*ar = lookup_archiver(format);
if (!*ar)
die("Unknown archive format '%s'", format);
@@ -294,7 +322,7 @@ static int parse_archive_args(int argc, const char **argv,
args->base = base;
args->baselen = strlen(base);
return i;
return argc;
}
int write_archive(int argc, const char **argv, const char *prefix,
@@ -302,13 +330,11 @@ int write_archive(int argc, const char **argv, const char *prefix,
{
const struct archiver *ar = NULL;
struct archiver_args args;
int tree_idx;
tree_idx = parse_archive_args(argc, argv, &ar, &args);
argc = parse_archive_args(argc, argv, &ar, &args);
if (setup_prefix && prefix == NULL)
prefix = setup_git_directory();
argv += tree_idx;
parse_treeish_arg(argv, &args, prefix);
parse_pathspec_arg(argv + 1, &args);

View File

@@ -2346,6 +2346,10 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
parse_done:
argc = parse_options_end(&ctx);
if (DIFF_OPT_TST(&revs.diffopt, FIND_COPIES_HARDER))
opt |= (PICKAXE_BLAME_COPY | PICKAXE_BLAME_MOVE |
PICKAXE_BLAME_COPY_HARDER);
if (!blame_move_score)
blame_move_score = BLAME_DEFAULT_MOVE_SCORE;
if (!blame_copy_score)

View File

@@ -33,7 +33,7 @@ static const char * const builtin_clone_usage[] = {
NULL
};
static int option_quiet, option_no_checkout, option_bare;
static int option_quiet, option_no_checkout, option_bare, option_mirror;
static int option_local, option_no_hardlinks, option_shared;
static char *option_template, *option_reference, *option_depth;
static char *option_origin = NULL;
@@ -45,6 +45,8 @@ static struct option builtin_clone_options[] = {
"don't create a checkout"),
OPT_BOOLEAN(0, "bare", &option_bare, "create a bare repository"),
OPT_BOOLEAN(0, "naked", &option_bare, "create a bare repository"),
OPT_BOOLEAN(0, "mirror", &option_mirror,
"create a mirror repository (implies bare)"),
OPT_BOOLEAN('l', "local", &option_local,
"to clone from a local repository"),
OPT_BOOLEAN(0, "no-hardlinks", &option_no_hardlinks,
@@ -93,7 +95,7 @@ static char *get_repo_path(const char *repo, int *is_bundle)
return NULL;
}
static char *guess_dir_name(const char *repo, int is_bundle)
static char *guess_dir_name(const char *repo, int is_bundle, int is_bare)
{
const char *end = repo + strlen(repo), *start;
@@ -129,6 +131,12 @@ static char *guess_dir_name(const char *repo, int is_bundle)
end -= 4;
}
if (is_bare) {
char *result = xmalloc(end - start + 5);
sprintf(result, "%.*s.git", (int)(end - start), start);
return result;
}
return xstrndup(start, end - start);
}
@@ -345,6 +353,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
char branch_top[256], key[256], value[256];
struct strbuf reflog_msg;
struct transport *transport = NULL;
char *src_ref_prefix = "refs/heads/";
struct refspec refspec;
@@ -359,6 +368,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
if (option_no_hardlinks)
use_local_hardlinks = 0;
if (option_mirror)
option_bare = 1;
if (option_bare) {
if (option_origin)
die("--bare and --origin %s options are incompatible.",
@@ -383,7 +395,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
if (argc == 2)
dir = xstrdup(argv[1]);
else
dir = guess_dir_name(repo_name, is_bundle);
dir = guess_dir_name(repo_name, is_bundle, option_bare);
if (!stat(dir, &buf))
die("destination directory '%s' already exists.", dir);
@@ -440,26 +452,36 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
git_config(git_default_config, NULL);
if (option_bare) {
strcpy(branch_top, "refs/heads/");
if (option_mirror)
src_ref_prefix = "refs/";
strcpy(branch_top, src_ref_prefix);
git_config_set("core.bare", "true");
} else {
snprintf(branch_top, sizeof(branch_top),
"refs/remotes/%s/", option_origin);
}
if (option_mirror || !option_bare) {
/* Configure the remote */
if (option_mirror) {
snprintf(key, sizeof(key),
"remote.%s.mirror", option_origin);
git_config_set(key, "true");
}
snprintf(key, sizeof(key), "remote.%s.url", option_origin);
git_config_set(key, repo);
snprintf(key, sizeof(key), "remote.%s.fetch", option_origin);
snprintf(value, sizeof(value),
"+refs/heads/*:%s*", branch_top);
"+%s*:%s*", src_ref_prefix, branch_top);
git_config_set_multivar(key, value, "^$", 0);
}
refspec.force = 0;
refspec.pattern = 1;
refspec.src = "refs/heads/";
refspec.src = src_ref_prefix;
refspec.dst = branch_top;
if (path && !is_bundle)

View File

@@ -46,7 +46,7 @@ static enum {
COMMIT_PARTIAL,
} commit_style;
static char *logfile, *force_author;
static const char *logfile, *force_author;
static const char *template_file;
static char *edit_message, *use_message;
static char *author_name, *author_email, *author_date;
@@ -554,14 +554,18 @@ static int prepare_to_commit(const char *index_file, const char *prefix)
fprintf(fp,
"\n"
"# Please enter the commit message for your changes.\n"
"# To abort the commit, use an empty commit message.\n"
"# (Comment lines starting with '#' will ");
"# Please enter the commit message for your changes.");
if (cleanup_mode == CLEANUP_ALL)
fprintf(fp, "not be included)\n");
fprintf(fp,
" Lines starting\n"
"# with '#' will be ignored, and an empty"
" message aborts the commit.\n");
else /* CLEANUP_SPACE, that is. */
fprintf(fp, "be kept.\n"
"# You can remove them yourself if you want to)\n");
fprintf(fp,
" Lines starting\n"
"# with '#' will be kept; you may remove them"
" yourself if you want to.\n"
"# An empty message aborts the commit.\n");
if (only_include_assumed)
fprintf(fp, "# %s\n", only_include_assumed);
@@ -707,11 +711,14 @@ static int message_is_empty(struct strbuf *sb, int start)
}
static int parse_and_validate_options(int argc, const char *argv[],
const char * const usage[])
const char * const usage[],
const char *prefix)
{
int f = 0;
argc = parse_options(argc, argv, builtin_commit_options, usage, 0);
logfile = parse_options_fix_filename(prefix, logfile);
template_file = parse_options_fix_filename(prefix, template_file);
if (logfile || message.len || use_message)
use_editor = 0;
@@ -832,7 +839,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
if (wt_status_use_color == -1)
wt_status_use_color = git_use_color_default;
argc = parse_and_validate_options(argc, argv, builtin_status_usage);
argc = parse_and_validate_options(argc, argv, builtin_status_usage, prefix);
index_file = prepare_index(argc, argv, prefix);
@@ -925,7 +932,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
git_config(git_commit_config, NULL);
argc = parse_and_validate_options(argc, argv, builtin_commit_usage);
argc = parse_and_validate_options(argc, argv, builtin_commit_usage, prefix);
index_file = prepare_index(argc, argv, prefix);
@@ -1004,7 +1011,8 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
stripspace(&sb, cleanup_mode == CLEANUP_ALL);
if (sb.len < header_len || message_is_empty(&sb, header_len)) {
rollback_index_files();
die("no commit message? aborting commit.");
fprintf(stderr, "Aborting commit due to empty commit message.\n");
exit(1);
}
strbuf_addch(&sb, '\0');
if (is_encoding_utf8(git_commit_encoding) && !is_utf8(sb.buf))

View File

@@ -385,7 +385,7 @@ static void fsck_dir(int i, char *path)
add_sha1_list(sha1, DIRENT_SORT_HINT(de));
continue;
}
if (prefixcmp(de->d_name, "tmp_obj_"))
if (!prefixcmp(de->d_name, "tmp_obj_"))
continue;
fprintf(stderr, "bad sha1 file: %s/%s\n", path, de->d_name);
}

View File

@@ -66,17 +66,16 @@ static int show_tree(const unsigned char *sha1, const char *base, int baselen,
/*
* Maybe we want to have some recursive version here?
*
* Something like:
* Something similar to this incomplete example:
*
if (show_subprojects(base, baselen, pathname)) {
if (fork()) {
chdir(base);
exec ls-tree;
}
waitpid();
struct child_process ls_tree;
ls_tree.dir = base;
ls_tree.argv = ls-tree;
start_command(&ls_tree);
}
*
* ..or similar..
*/
type = commit_type;
} else if (S_ISDIR(mode)) {

View File

@@ -176,6 +176,48 @@ static char const * const name_rev_usage[] = {
NULL
};
static void name_rev_line(char *p, struct name_ref_data *data)
{
int forty = 0;
char *p_start;
for (p_start = p; *p; p++) {
#define ishex(x) (isdigit((x)) || ((x) >= 'a' && (x) <= 'f'))
if (!ishex(*p))
forty = 0;
else if (++forty == 40 &&
!ishex(*(p+1))) {
unsigned char sha1[40];
const char *name = NULL;
char c = *(p+1);
int p_len = p - p_start + 1;
forty = 0;
*(p+1) = 0;
if (!get_sha1(p - 39, sha1)) {
struct object *o =
lookup_object(sha1);
if (o)
name = get_rev_name(o);
}
*(p+1) = c;
if (!name)
continue;
if (data->name_only)
printf("%.*s%s", p_len - 40, p_start, name);
else
printf("%.*s (%s)", p_len, p_start, name);
p_start = p + 1;
}
}
/* flush */
if (p_start != p)
fwrite(p_start, p - p_start, 1, stdout);
}
int cmd_name_rev(int argc, const char **argv, const char *prefix)
{
struct object_array revs = { 0, 0, NULL };
@@ -234,47 +276,12 @@ int cmd_name_rev(int argc, const char **argv, const char *prefix)
if (transform_stdin) {
char buffer[2048];
char *p, *p_start;
while (!feof(stdin)) {
int forty = 0;
p = fgets(buffer, sizeof(buffer), stdin);
char *p = fgets(buffer, sizeof(buffer), stdin);
if (!p)
break;
for (p_start = p; *p; p++) {
#define ishex(x) (isdigit((x)) || ((x) >= 'a' && (x) <= 'f'))
if (!ishex(*p))
forty = 0;
else if (++forty == 40 &&
!ishex(*(p+1))) {
unsigned char sha1[40];
const char *name = NULL;
char c = *(p+1);
forty = 0;
*(p+1) = 0;
if (!get_sha1(p - 39, sha1)) {
struct object *o =
lookup_object(sha1);
if (o)
name = get_rev_name(o);
}
*(p+1) = c;
if (!name)
continue;
fwrite(p_start, p - p_start + 1, 1, stdout);
printf(" (%s)", name);
p_start = p + 1;
}
}
/* flush */
if (p_start != p)
fwrite(p_start, p - p_start, 1, stdout);
name_rev_line(p, &data);
}
} else if (all) {
int i, max;

View File

@@ -69,11 +69,6 @@ static int prune_dir(int i, char *path)
if (de->d_name[0] != '.')
break;
continue;
case 14:
if (prefixcmp(de->d_name, "tmp_obj_"))
break;
prune_tmp_object(path, de->d_name);
continue;
case 38:
sprintf(name, "%02x", i);
memcpy(name+2, de->d_name, len+1);
@@ -90,6 +85,10 @@ static int prune_dir(int i, char *path)
prune_object(path, de->d_name, sha1);
continue;
}
if (!prefixcmp(de->d_name, "tmp_obj_")) {
prune_tmp_object(path, de->d_name);
continue;
}
fprintf(stderr, "bad sha1 file: %s/%s\n", path, de->d_name);
}
if (!show_only)

View File

@@ -115,7 +115,7 @@ static int add(int argc, const char **argv)
if (mirror) {
strbuf_reset(&buf);
strbuf_addf(&buf, "remote.%s.mirror", name);
if (git_config_set(buf.buf, "yes"))
if (git_config_set(buf.buf, "true"))
return 1;
}

View File

@@ -180,7 +180,7 @@ static void set_author_ident_env(const char *message)
email++;
timestamp = strchr(email, '>');
if (!timestamp)
die ("Could not extract author email from %s",
die ("Could not extract author time from %s",
sha1_to_hex(commit->object.sha1));
*timestamp = '\0';
for (timestamp++; *timestamp && isspace(*timestamp);

View File

@@ -346,7 +346,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
int annotate = 0, sign = 0, force = 0, lines = 0,
list = 0, delete = 0, verify = 0;
char *msgfile = NULL, *keyid = NULL;
const char *msgfile = NULL, *keyid = NULL;
struct msg_arg msg = { 0, STRBUF_INIT };
struct option options[] = {
OPT_BOOLEAN('l', NULL, &list, "list tag names"),
@@ -372,6 +372,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
git_config(git_tag_config, NULL);
argc = parse_options(argc, argv, options, git_tag_usage, 0);
msgfile = parse_options_fix_filename(prefix, msgfile);
if (keyid) {
sign = 1;

View File

@@ -561,6 +561,29 @@ _git_add ()
COMPREPLY=()
}
_git_archive ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--format=*)
__gitcomp "$(git archive --list)" "" "${cur##--format=}"
return
;;
--remote=*)
__gitcomp "$(__git_remotes)" "" "${cur##--remote=}"
return
;;
--*)
__gitcomp "
--format= --list --verbose
--prefix= --remote= --exec=
"
return
;;
esac
__git_complete_file
}
_git_bisect ()
{
__git_has_doubledash && return
@@ -667,6 +690,45 @@ _git_cherry_pick ()
esac
}
_git_clean ()
{
__git_has_doubledash && return
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--*)
__gitcomp "--dry-run --quiet"
return
;;
esac
COMPREPLY=()
}
_git_clone ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--*)
__gitcomp "
--local
--no-hardlinks
--shared
--reference
--quiet
--no-checkout
--bare
--mirror
--origin
--upload-pack
--template=
--depth
"
return
;;
esac
COMPREPLY=()
}
_git_commit ()
{
__git_has_doubledash && return
@@ -721,11 +783,6 @@ _git_diff ()
__git_complete_file
}
_git_diff_tree ()
{
__gitcomp "$(__git_refs)"
}
_git_fetch ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
@@ -796,6 +853,29 @@ _git_gc ()
COMPREPLY=()
}
_git_grep ()
{
__git_has_doubledash && return
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--*)
__gitcomp "
--cached
--text --ignore-case --word-regexp --invert-match
--full-name
--extended-regexp --basic-regexp --fixed-strings
--files-with-matches --name-only
--files-without-match
--count
--and --or --not --all-match
"
return
;;
esac
COMPREPLY=()
}
_git_help ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
@@ -808,6 +888,44 @@ _git_help ()
__gitcomp "$(__git_all_commands)"
}
_git_init ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--shared=*)
__gitcomp "
false true umask group all world everybody
" "" "${cur##--shared=}"
return
;;
--*)
__gitcomp "--quiet --bare --template= --shared --shared="
return
;;
esac
COMPREPLY=()
}
_git_ls_files ()
{
__git_has_doubledash && return
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--*)
__gitcomp "--cached --deleted --modified --others --ignored
--stage --directory --no-empty-directory --unmerged
--killed --exclude= --exclude-from=
--exclude-per-directory= --exclude-standard
--error-unmatch --with-tree= --full-name
--abbrev --ignored --exclude-per-directory
"
return
;;
esac
COMPREPLY=()
}
_git_ls_remote ()
{
__gitcomp "$(__git_remotes)"
@@ -853,6 +971,7 @@ _git_log ()
--stat --numstat --shortstat
--decorate --diff-filter=
--color-words --walk-reflogs
--parents --children --full-history
"
return
;;
@@ -887,6 +1006,18 @@ _git_merge_base ()
__gitcomp "$(__git_refs)"
}
_git_mv ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--*)
__gitcomp "--dry-run"
return
;;
esac
COMPREPLY=()
}
_git_name_rev ()
{
__gitcomp "--tags --all --stdin"
@@ -1211,6 +1342,18 @@ _git_reset ()
__gitcomp "$(__git_refs)"
}
_git_revert ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--*)
__gitcomp "--edit --mainline --no-edit --no-commit --signoff"
return
;;
esac
COMPREPLY=()
}
_git_rm ()
{
__git_has_doubledash && return
@@ -1283,7 +1426,7 @@ _git_show_branch ()
_git_stash ()
{
local subcommands='save list show apply clear drop pop create'
local subcommands='save list show apply clear drop pop create branch'
local subcommand="$(__git_find_subcommand "$subcommands")"
if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
@@ -1293,6 +1436,16 @@ _git_stash ()
save,--*)
__gitcomp "--keep-index"
;;
apply,--*)
__gitcomp "--index"
;;
show,--*|apply,--*|drop,--*|pop,--*|branch,--*)
COMPREPLY=()
;;
show,*|apply,*|drop,*|pop,*|branch,*)
__gitcomp "$(git --git-dir="$(__gitdir)" stash list \
| sed -n -e 's/:.*//p')"
;;
*)
COMPREPLY=()
;;
@@ -1473,12 +1626,15 @@ _git ()
am) _git_am ;;
add) _git_add ;;
apply) _git_apply ;;
archive) _git_archive ;;
bisect) _git_bisect ;;
bundle) _git_bundle ;;
branch) _git_branch ;;
checkout) _git_checkout ;;
cherry) _git_cherry ;;
cherry-pick) _git_cherry_pick ;;
clean) _git_clean ;;
clone) _git_clone ;;
commit) _git_commit ;;
config) _git_config ;;
describe) _git_describe ;;
@@ -1486,18 +1642,23 @@ _git ()
fetch) _git_fetch ;;
format-patch) _git_format_patch ;;
gc) _git_gc ;;
grep) _git_grep ;;
help) _git_help ;;
init) _git_init ;;
log) _git_log ;;
ls-files) _git_ls_files ;;
ls-remote) _git_ls_remote ;;
ls-tree) _git_ls_tree ;;
merge) _git_merge;;
merge-base) _git_merge_base ;;
mv) _git_mv ;;
name-rev) _git_name_rev ;;
pull) _git_pull ;;
push) _git_push ;;
rebase) _git_rebase ;;
remote) _git_remote ;;
reset) _git_reset ;;
revert) _git_revert ;;
rm) _git_rm ;;
send-email) _git_send_email ;;
shortlog) _git_shortlog ;;

View File

@@ -443,7 +443,7 @@ fi | git stripspace >"$GIT_DIR"/COMMIT_EDITMSG
case "$signoff" in
t)
sign=$(git-var GIT_COMMITTER_IDENT | sed -e '
sign=$(git var GIT_COMMITTER_IDENT | sed -e '
s/>.*/>/
s/^/Signed-off-by: /
')
@@ -535,8 +535,8 @@ esac
case "$no_edit" in
'')
git-var GIT_AUTHOR_IDENT > /dev/null || die
git-var GIT_COMMITTER_IDENT > /dev/null || die
git var GIT_AUTHOR_IDENT > /dev/null || die
git var GIT_COMMITTER_IDENT > /dev/null || die
git_editor "$GIT_DIR/COMMIT_EDITMSG"
;;
esac

View File

@@ -164,7 +164,7 @@ git check-ref-format "tags/$name" ||
object=$(git rev-parse --verify --default HEAD "$@") || exit 1
type=$(git cat-file -t $object) || exit 1
tagger=$(git-var GIT_COMMITTER_IDENT) || exit 1
tagger=$(git var GIT_COMMITTER_IDENT) || exit 1
test -n "$username" ||
username=$(git config user.signingkey) ||

18
diff.c
View File

@@ -131,10 +131,6 @@ static int parse_funcname_pattern(const char *var, const char *ep, const char *v
*/
int git_diff_ui_config(const char *var, const char *value, void *cb)
{
if (!strcmp(var, "diff.renamelimit")) {
diff_rename_limit_default = git_config_int(var, value);
return 0;
}
if (!strcmp(var, "diff.color") || !strcmp(var, "color.diff")) {
diff_use_color_default = git_config_colorbool(var, value, -1);
return 0;
@@ -167,6 +163,11 @@ int git_diff_ui_config(const char *var, const char *value, void *cb)
int git_diff_basic_config(const char *var, const char *value, void *cb)
{
if (!strcmp(var, "diff.renamelimit")) {
diff_rename_limit_default = git_config_int(var, value);
return 0;
}
if (!prefixcmp(var, "diff.color.") || !prefixcmp(var, "color.diff.")) {
int slot = parse_diff_color_slot(var, 11);
if (!value)
@@ -1380,7 +1381,14 @@ static struct builtin_funcname_pattern {
"^[ ]*\\(\\([ ]*"
"[A-Za-z_][A-Za-z_0-9]*\\)\\{2,\\}"
"[ ]*([^;]*\\)$" },
{ "tex", "^\\(\\\\\\(sub\\)*section{.*\\)$" },
{ "pascal", "^\\(\\(procedure\\|function\\|constructor\\|"
"destructor\\|interface\\|implementation\\|"
"initialization\\|finalization\\)[ \t]*.*\\)$"
"\\|"
"^\\(.*=[ \t]*\\(class\\|record\\).*\\)$"
},
{ "tex", "^\\(\\\\\\(\\(sub\\)*section\\|chapter\\|part\\)\\*\\{0,1\\}{.*\\)$" },
{ "ruby", "^\\s*\\(\\(class\\|module\\|def\\)\\s.*\\)$" },
};
static const char *diff_funcname_pattern(struct diff_filespec *one)

View File

@@ -291,7 +291,7 @@ fi
ws=`cat "$dotest/whitespace"`
if test "$(cat "$dotest/sign")" = t
then
SIGNOFF=`git-var GIT_COMMITTER_IDENT | sed -e '
SIGNOFF=`git var GIT_COMMITTER_IDENT | sed -e '
s/>.*/>/
s/^/Signed-off-by: /'
`

View File

@@ -952,7 +952,7 @@ while (<CVS>) {
} elsif (/^-+$/) { # end of unknown-line processing
$state = 1;
} elsif ($state != 11) { # ignore stuff when skipping
print "* UNKNOWN LINE * $_\n";
print STDERR "* UNKNOWN LINE * $_\n";
}
}
commit() if $branch and $state != 11;

View File

@@ -52,7 +52,11 @@ catch {rename send {}} ; # What an evil concept...
set oguilib {@@GITGUI_LIBDIR@@}
set oguirel {@@GITGUI_RELATIVE@@}
if {$oguirel eq {1}} {
set oguilib [file dirname [file dirname [file normalize $argv0]]]
set oguilib [file dirname [file normalize $argv0]]
if {[file tail $oguilib] eq {git-core}} {
set oguilib [file dirname $oguilib]
}
set oguilib [file dirname $oguilib]
set oguilib [file join $oguilib share git-gui lib]
set oguimsg [file join $oguilib msgs]
} elseif {[string match @@* $oguirel]} {

View File

@@ -101,7 +101,7 @@ matching msgid lines. A few tips:
"printf()"-like functions. Make sure "%s", "%d", and "%%" in your
translated messages match the original.
When you have to change the order of words, you can add "<number>\$"
When you have to change the order of words, you can add "<number>$"
between '%' and the conversion ('s', 'd', etc.) to say "<number>-th
parameter to the format string is used at this point". For example,
if the original message is like this:
@@ -111,12 +111,17 @@ matching msgid lines. A few tips:
and if for whatever reason your translation needs to say weight first
and then length, you can say something like:
"WEIGHT IS %2\$d, LENGTH IS %1\$d"
"WEIGHT IS %2$d, LENGTH IS %1$d"
The reason you need a backslash before dollar sign is because
this is a double quoted string in Tcl language, and without
it the letter introduces a variable interpolation, which you
do not want here.
A format specification with a '*' (asterisk) refers to *two* arguments
instead of one, hence the succeeding argument number is two higher
instead of one. So, a message like this
"%s ... %*i of %*i %s (%3i%%)"
is equivalent to
"%1$s ... %2$*i of %4$*i %6$s (%7$3i%%)"
- A long message can be split across multiple lines by ending the
string with a double quote, and starting another string on the next

View File

@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: git-gui\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-03-14 07:18+0100\n"
"PO-Revision-Date: 2008-05-01 11:51+0200\n"
"POT-Creation-Date: 2008-08-02 08:58+0200\n"
"PO-Revision-Date: 2008-08-02 09:09+0200\n"
"Last-Translator: Christian Stimming <stimming@tuhh.de>\n"
"Language-Team: German\n"
"MIME-Version: 1.0\n"
@@ -134,18 +134,11 @@ msgstr "Konfliktauflösung nötig"
msgid "Starting gitk... please wait..."
msgstr "Gitk wird gestartet... bitte warten."
#: git-gui.sh:1653
#, tcl-format
msgid ""
"Unable to start gitk:\n"
"\n"
"%s does not exist"
msgstr ""
"Gitk kann nicht gestartet werden:\n"
"\n"
"%s existiert nicht"
#: git-gui.sh:1698
msgid "Couldn't find gitk in PATH"
msgstr "Gitk kann im PATH nicht gefunden werden."
#: git-gui.sh:1860 lib/choose_repository.tcl:36
#: git-gui.sh:1948 lib/choose_repository.tcl:36
msgid "Repository"
msgstr "Projektarchiv"
@@ -294,7 +287,15 @@ msgstr "Aus der Bereitstellung herausnehmen"
msgid "Revert Changes"
msgstr "Änderungen verwerfen"
#: git-gui.sh:2049 git-gui.sh:2368 git-gui.sh:2467
#: git-gui.sh:2141 git-gui.sh:2702
msgid "Show Less Context"
msgstr "Weniger Zeilen anzeigen"
#: git-gui.sh:2145 git-gui.sh:2706
msgid "Show More Context"
msgstr "Mehr Zeilen anzeigen"
#: git-gui.sh:2151 git-gui.sh:2470 git-gui.sh:2569
msgid "Sign Off"
msgstr "Abzeichnen"
@@ -314,11 +315,7 @@ msgstr "Zusammenführen abbrechen..."
msgid "Push..."
msgstr "Versenden..."
#: git-gui.sh:2092 lib/choose_repository.tcl:41
msgid "Apple"
msgstr "Apple"
#: git-gui.sh:2095 git-gui.sh:2117 lib/about.tcl:14
#: git-gui.sh:2197 git-gui.sh:2219 lib/about.tcl:14
#: lib/choose_repository.tcl:44 lib/choose_repository.tcl:50
#, tcl-format
msgid "About %s"
@@ -403,15 +400,11 @@ msgstr "Datei:"
msgid "Apply/Reverse Hunk"
msgstr "Kontext anwenden/umkehren"
#: git-gui.sh:2595
msgid "Show Less Context"
msgstr "Weniger Zeilen anzeigen"
#: git-gui.sh:2696
msgid "Apply/Reverse Line"
msgstr "Zeile anwenden/umkehren"
#: git-gui.sh:2602
msgid "Show More Context"
msgstr "Mehr Zeilen anzeigen"
#: git-gui.sh:2610
#: git-gui.sh:2711
msgid "Refresh"
msgstr "Aktualisieren"
@@ -427,11 +420,19 @@ msgstr "Schriftgröße vergrößern"
msgid "Unstage Hunk From Commit"
msgstr "Kontext aus Bereitstellung herausnehmen"
#: git-gui.sh:2648
#: git-gui.sh:2748
msgid "Unstage Line From Commit"
msgstr "Zeile aus der Bereitstellung herausnehmen"
#: git-gui.sh:2750
msgid "Stage Hunk For Commit"
msgstr "Kontext zur Bereitstellung hinzufügen"
#: git-gui.sh:2667
#: git-gui.sh:2751
msgid "Stage Line For Commit"
msgstr "Zeile zur Bereitstellung hinzufügen"
#: git-gui.sh:2771
msgid "Initializing..."
msgstr "Initialisieren..."
@@ -493,7 +494,11 @@ msgstr "Version:"
msgid "Copy Commit"
msgstr "Version kopieren"
#: lib/blame.tcl:384
#: lib/blame.tcl:260
msgid "Do Full Copy Detection"
msgstr "Volle Kopie-Erkennung"
#: lib/blame.tcl:388
#, tcl-format
msgid "Reading %s..."
msgstr "%s lesen..."
@@ -514,7 +519,19 @@ msgstr "Annotierungen für ursprünglichen Ort werden geladen..."
msgid "Annotation complete."
msgstr "Annotierung vollständig."
#: lib/blame.tcl:746
#: lib/blame.tcl:737
msgid "Busy"
msgstr "Verarbeitung läuft"
#: lib/blame.tcl:738
msgid "Annotation process is already running."
msgstr "Annotierung läuft bereits."
#: lib/blame.tcl:777
msgid "Running thorough copy detection..."
msgstr "Intensive Kopie-Erkennung läuft..."
#: lib/blame.tcl:827
msgid "Loading annotation..."
msgstr "Annotierung laden..."
@@ -759,7 +776,12 @@ msgstr "Schließen"
msgid "Branch '%s' does not exist."
msgstr "Zweig »%s« existiert nicht."
#: lib/checkout_op.tcl:206
#: lib/checkout_op.tcl:193
#, tcl-format
msgid "Failed to configure simplified git-pull for '%s'."
msgstr "Fehler beim Einrichten der vereinfachten git-pull für »%s«."
#: lib/checkout_op.tcl:228
#, tcl-format
msgid ""
"Branch '%s' already exists.\n"
@@ -1485,6 +1507,14 @@ msgstr ""
msgid "Failed to stage selected hunk."
msgstr "Fehler beim Bereitstellen des gewählten Kontexts."
#: lib/diff.tcl:386
msgid "Failed to unstage selected line."
msgstr "Fehler beim Herausnehmen der gewählten Zeile aus der Bereitstellung."
#: lib/diff.tcl:394
msgid "Failed to stage selected line."
msgstr "Fehler beim Bereitstellen der gewählten Zeile."
#: lib/error.tcl:20 lib/error.tcl:114
msgid "error"
msgstr "Fehler"
@@ -1750,6 +1780,14 @@ msgid "Match Tracking Branches"
msgstr "Passend zu Übernahmezweig"
#: lib/option.tcl:126
msgid "Blame Copy Only On Changed Files"
msgstr "Kopie-Annotieren nur bei geänderten Dateien"
#: lib/option.tcl:127
msgid "Minimum Letters To Blame Copy On"
msgstr "Mindestzahl Zeichen für Kopie-Annotieren"
#: lib/option.tcl:128
msgid "Number of Diff Context Lines"
msgstr "Anzahl der Kontextzeilen beim Vergleich"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
#!/bin/sh
# Copyright (c) 2007, Nanako Shiraishi
USAGE='[ | save | list | show | apply | clear | drop | pop | create ]'
USAGE='[ | save | list | show | apply | clear | drop | pop | create | branch ]'
SUBDIRECTORY_OK=Yes
OPTIONS_SPEC=

View File

@@ -796,8 +796,8 @@ sub cmd_commit_diff {
}
sub cmd_info {
my $path = canonicalize_path(shift or ".");
unless (scalar(@_) == 0) {
my $path = canonicalize_path(defined($_[0]) ? $_[0] : ".");
if (exists $_[1]) {
die "Too many arguments specified\n";
}
@@ -813,6 +813,10 @@ sub cmd_info {
die "Unable to determine upstream SVN information from ",
"working tree history\n";
}
# canonicalize_path() will return "" to make libsvn 1.5.x happy,
$path = "." if $path eq "";
my $full_url = $url . ($path eq "." ? "" : "/$path");
if ($_url) {
@@ -1420,8 +1424,12 @@ sub read_all_remotes {
svn.useSvmProps/) };
$use_svm_props = $use_svm_props eq 'true' if $use_svm_props;
foreach (grep { s/^svn-remote\.// } command(qw/config -l/)) {
if (m!^(.+)\.fetch=\s*(.*)\s*:\s*refs/remotes/(.+)\s*$!) {
my ($remote, $local_ref, $remote_ref) = ($1, $2, $3);
if (m!^(.+)\.fetch=\s*(.*)\s*:\s*(.+)\s*$!) {
my ($remote, $local_ref, $_remote_ref) = ($1, $2, $3);
die("svn-remote.$remote: remote ref '$_remote_ref' "
. "must start with 'refs/remotes/'\n")
unless $_remote_ref =~ m{^refs/remotes/(.+)};
my $remote_ref = $1;
$local_ref =~ s{^/}{};
$r->{$remote}->{fetch}->{$local_ref} = $remote_ref;
$r->{$remote}->{svm} = {} if $use_svm_props;

View File

@@ -90,6 +90,15 @@ proc dorunq {} {
}
}
proc reg_instance {fd} {
global commfd leftover loginstance
set i [incr loginstance]
set commfd($i) $fd
set leftover($i) {}
return $i
}
proc unmerged_files {files} {
global nr_unmerged
@@ -294,11 +303,11 @@ proc parseviewrevs {view revs} {
# Start off a git log process and arrange to read its output
proc start_rev_list {view} {
global startmsecs commitidx viewcomplete curview
global commfd leftover tclencoding
global tclencoding
global viewargs viewargscmd viewfiles vfilelimit
global showlocalchanges commitinterest
global viewactive loginstance viewinstances vmergeonly
global pending_select mainheadid
global viewactive viewinstances vmergeonly
global mainheadid
global vcanopt vflags vrevs vorigargs
set startmsecs [clock clicks -milliseconds]
@@ -354,10 +363,8 @@ proc start_rev_list {view} {
error_popup "[mc "Error executing git log:"] $err"
return 0
}
set i [incr loginstance]
set i [reg_instance $fd]
set viewinstances($view) [list $i]
set commfd($i) $fd
set leftover($i) {}
if {$showlocalchanges && $mainheadid ne {}} {
lappend commitinterest($mainheadid) {dodiffindex}
}
@@ -367,36 +374,63 @@ proc start_rev_list {view} {
}
filerun $fd [list getcommitlines $fd $i $view 0]
nowbusy $view [mc "Reading"]
if {$view == $curview} {
set pending_select $mainheadid
}
set viewcomplete($view) 0
set viewactive($view) 1
return 1
}
proc stop_rev_list {view} {
global commfd viewinstances leftover
proc stop_instance {inst} {
global commfd leftover
foreach inst $viewinstances($view) {
set fd $commfd($inst)
catch {
set pid [pid $fd]
set fd $commfd($inst)
catch {
set pid [pid $fd]
if {$::tcl_platform(platform) eq {windows}} {
exec kill -f $pid
} else {
exec kill $pid
}
catch {close $fd}
nukefile $fd
unset commfd($inst)
unset leftover($inst)
}
catch {close $fd}
nukefile $fd
unset commfd($inst)
unset leftover($inst)
}
proc stop_backends {} {
global commfd
foreach inst [array names commfd] {
stop_instance $inst
}
}
proc stop_rev_list {view} {
global viewinstances
foreach inst $viewinstances($view) {
stop_instance $inst
}
set viewinstances($view) {}
}
proc getcommits {} {
proc reset_pending_select {selid} {
global pending_select mainheadid
if {$selid ne {}} {
set pending_select $selid
} else {
set pending_select $mainheadid
}
}
proc getcommits {selid} {
global canv curview need_redisplay viewactive
initlayout
if {[start_rev_list $curview]} {
reset_pending_select $selid
show_status [mc "Reading commits..."]
set need_redisplay 1
} else {
@@ -406,8 +440,8 @@ proc getcommits {} {
proc updatecommits {} {
global curview vcanopt vorigargs vfilelimit viewinstances
global viewactive viewcomplete loginstance tclencoding
global startmsecs commfd showneartags showlocalchanges leftover
global viewactive viewcomplete tclencoding
global startmsecs showneartags showlocalchanges
global mainheadid pending_select
global isworktree
global varcid vposids vnegids vflags vrevs
@@ -468,10 +502,8 @@ proc updatecommits {} {
if {$viewactive($view) == 0} {
set startmsecs [clock clicks -milliseconds]
}
set i [incr loginstance]
set i [reg_instance $fd]
lappend viewinstances($view) $i
set commfd($i) $fd
set leftover($i) {}
fconfigure $fd -blocking 0 -translation lf -eofchar {}
if {$tclencoding != {}} {
fconfigure $fd -encoding $tclencoding
@@ -479,7 +511,7 @@ proc updatecommits {} {
filerun $fd [list getcommitlines $fd $i $view 1]
incr viewactive($view)
set viewcomplete($view) 0
set pending_select $mainheadid
reset_pending_select {}
nowbusy $view "Reading"
if {$showneartags} {
getallcommits
@@ -491,6 +523,11 @@ proc reloadcommits {} {
global showneartags treediffs commitinterest cached_commitrow
global targetid
set selid {}
if {$selectedline ne {}} {
set selid $currentid
}
if {!$viewcomplete($curview)} {
stop_rev_list $curview
}
@@ -509,7 +546,7 @@ proc reloadcommits {} {
catch {unset cached_commitrow}
catch {unset targetid}
setcanvscroll
getcommits
getcommits $selid
return 0
}
@@ -1469,8 +1506,15 @@ proc chewcommits {} {
global numcommits startmsecs
if {[info exists pending_select]} {
set row [first_real_row]
selectline $row 1
update
reset_pending_select {}
if {[commitinview $pending_select $curview]} {
selectline [rowofcommit $pending_select] 1
} else {
set row [first_real_row]
selectline $row 1
}
}
if {$commitidx($curview) > 0} {
#set ms [expr {[clock clicks -milliseconds] - $startmsecs}]
@@ -2103,6 +2147,7 @@ proc makewindow {} {
bind . <$M1B-minus> {incrfont -1}
bind . <$M1B-KP_Subtract> {incrfont -1}
wm protocol . WM_DELETE_WINDOW doquit
bind . <Destroy> {stop_backends}
bind . <Button-1> "click %W"
bind $fstring <Key-Return> {dofind 1 1}
bind $sha1entry <Key-Return> gotocommit
@@ -3301,10 +3346,7 @@ proc showview {n} {
run refill_reflist
if {![info exists viewcomplete($n)]} {
if {$selid ne {}} {
set pending_select $selid
}
getcommits
getcommits $selid
return
}
@@ -3338,18 +3380,18 @@ proc showview {n} {
drawvisible
if {$row ne {}} {
selectline $row 0
} elseif {$mainheadid ne {} && [commitinview $mainheadid $curview]} {
selectline [rowofcommit $mainheadid] 1
} elseif {!$viewcomplete($n)} {
if {$selid ne {}} {
set pending_select $selid
} else {
set pending_select $mainheadid
}
reset_pending_select $selid
} else {
set row [first_real_row]
if {$row < $numcommits} {
selectline $row 0
reset_pending_select {}
if {[commitinview $pending_select $curview]} {
selectline [rowofcommit $pending_select] 1
} else {
set row [first_real_row]
if {$row < $numcommits} {
selectline $row 0
}
}
}
if {!$viewcomplete($n)} {
@@ -4012,6 +4054,7 @@ proc layoutmore {} {
}
if {[info exists pending_select] &&
[commitinview $pending_select $curview]} {
update
selectline [rowofcommit $pending_select] 1
}
drawvisible
@@ -4049,10 +4092,11 @@ proc dodiffindex {} {
incr lserial
set fd [open "|git diff-index --cached HEAD" r]
fconfigure $fd -blocking 0
filerun $fd [list readdiffindex $fd $lserial]
set i [reg_instance $fd]
filerun $fd [list readdiffindex $fd $lserial $i]
}
proc readdiffindex {fd serial} {
proc readdiffindex {fd serial inst} {
global mainheadid nullid nullid2 curview commitinfo commitdata lserial
set isdiff 1
@@ -4063,7 +4107,7 @@ proc readdiffindex {fd serial} {
set isdiff 0
}
# we only need to see one line and we don't really care what it says...
close $fd
stop_instance $inst
if {$serial != $lserial} {
return 0
@@ -4072,7 +4116,8 @@ proc readdiffindex {fd serial} {
# now see if there are any local changes not checked in to the index
set fd [open "|git diff-files" r]
fconfigure $fd -blocking 0
filerun $fd [list readdifffiles $fd $serial]
set i [reg_instance $fd]
filerun $fd [list readdifffiles $fd $serial $i]
if {$isdiff && ![commitinview $nullid2 $curview]} {
# add the line for the changes in the index to the graph
@@ -4089,7 +4134,7 @@ proc readdiffindex {fd serial} {
return 0
}
proc readdifffiles {fd serial} {
proc readdifffiles {fd serial inst} {
global mainheadid nullid nullid2 curview
global commitinfo commitdata lserial
@@ -4101,7 +4146,7 @@ proc readdifffiles {fd serial} {
set isdiff 0
}
# we only need to see one line and we don't really care what it says...
close $fd
stop_instance $inst
if {$serial != $lserial} {
return 0
@@ -6431,9 +6476,10 @@ proc diffcmd {ids flags} {
proc gettreediffs {ids} {
global treediff treepending
if {[catch {set gdtf [open [diffcmd $ids {--no-commit-id}] r]}]} return
set treepending $ids
set treediff {}
if {[catch {set gdtf [open [diffcmd $ids {--no-commit-id}] r]}]} return
fconfigure $gdtf -blocking 0
filerun $gdtf [list gettreediffline $gdtf $ids]
}

View File

@@ -7,19 +7,37 @@ msgid ""
msgstr ""
"Project-Id-Version: git-gui\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-05-01 11:54+0200\n"
"PO-Revision-Date: 2008-05-02 21:12+0200\n"
"POT-Creation-Date: 2008-05-24 22:32+0200\n"
"PO-Revision-Date: 2008-05-24 22:40+0200\n"
"Last-Translator: Christian Stimming <stimming@tuhh.de>\n"
"Language-Team: German\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: gitk:111
msgid "Error executing git rev-list:"
msgstr "Fehler beim Ausführen von git-rev-list:"
#: gitk:102
msgid "Couldn't get list of unmerged files:"
msgstr "Liste der nicht-zusammengeführten Dateien nicht gefunden:"
#: gitk:124
#: gitk:329
msgid "No files selected: --merge specified but no files are unmerged."
msgstr ""
"Keine Dateien ausgewählt: --merge angegeben, es existieren aber keine nicht-"
"zusammengeführten Dateien."
#: gitk:332
msgid ""
"No files selected: --merge specified but no unmerged files are within file "
"limit."
msgstr ""
"Keine Dateien ausgewähle: --merge angegeben, aber keine nicht-"
"zusammengeführten Dateien sind in der Dateiauswahl."
#: gitk:354
msgid "Error executing git log:"
msgstr "Fehler beim Ausführen von git-log:"
#: gitk:369
msgid "Reading"
msgstr "Lesen"
@@ -56,7 +74,11 @@ msgstr "Datei"
msgid "Update"
msgstr "Aktualisieren"
#: gitk:664
#: gitk:1722
msgid "Reload"
msgstr "Neu laden"
#: gitk:1723
msgid "Reread references"
msgstr "Zweige neu laden"
@@ -112,7 +134,11 @@ msgstr "Tastenkürzel"
msgid "SHA1 ID: "
msgstr "SHA1:"
#: gitk:791
#: gitk:1831
msgid "Row"
msgstr "Zeile"
#: gitk:1862
msgid "Find"
msgstr "Suche"
@@ -126,19 +152,19 @@ msgstr "vorige"
#: gitk:794
msgid "commit"
msgstr "Version"
msgstr "Version nach"
#: gitk:797 gitk:799 gitk:2356 gitk:2379 gitk:2403 gitk:4306 gitk:4369
msgid "containing:"
msgstr "enthaltend:"
msgstr "Beschreibung:"
#: gitk:800 gitk:1778 gitk:1783 gitk:2431
msgid "touching paths:"
msgstr "Pfad betreffend:"
msgstr "Dateien:"
#: gitk:801 gitk:2436
msgid "adding/removing string:"
msgstr "Zeichenkette ändernd:"
msgstr "Änderungen:"
#: gitk:810 gitk:812
msgid "Exact"
@@ -253,23 +279,25 @@ msgstr "Diesen auch hervorheben"
msgid "Highlight this only"
msgstr "Nur diesen hervorheben"
#: gitk:1318
#: gitk:2162
msgid "External diff"
msgstr "Externer Vergleich"
#: gitk:2403
msgid ""
"\n"
"Gitk - a commit viewer for git\n"
"\n"
"Copyright © 2005-2006 Paul Mackerras\n"
"Copyright © 2005-2008 Paul Mackerras\n"
"\n"
"Use and redistribute under the terms of the GNU General Public License"
msgstr ""
"\n"
"Gitk - eine Visualisierung der Git Historie\n"
"\n"
"Copyright © 2005-2006 Paul Mackerras\n"
"Copyright © 2005-2008 Paul Mackerras\n"
"\n"
"Benutzung und Weiterverbreitung gemäß den Bedingungen der GNU General Public "
"License\n"
" "
"Benutzung und Weiterverbreitung gemäß den Bedingungen der GNU General Public License"
#: gitk:1326 gitk:1387 gitk:6582
msgid "Close"
@@ -450,11 +478,11 @@ msgstr "Name"
msgid "Remember this view"
msgstr "Diese Ansicht speichern"
#: gitk:1928
msgid "Commits to include (arguments to git rev-list):"
msgstr "Versionen anzeigen (Argumente von git-rev-list):"
#: gitk:3126
msgid "Commits to include (arguments to git log):"
msgstr "Versionen anzeigen (Argumente von git-log):"
#: gitk:1935
#: gitk:3133
msgid "Command to generate more commits to include:"
msgstr "Versionsliste durch folgendes Kommando erzeugen lassen:"
@@ -566,7 +594,11 @@ msgstr "Kinder"
msgid "Reset %s branch to here"
msgstr "Zweig »%s« hierher zurücksetzen"
#: gitk:6050
#: gitk:7204
msgid "Detached head: can't reset"
msgstr "Zweigspitze ist abgetrennt: Zurücksetzen nicht möglich"
#: gitk:7236
msgid "Top"
msgstr "Oben"
@@ -798,7 +830,15 @@ msgstr "Naheliegende Überschriften anzeigen"
msgid "Limit diffs to listed paths"
msgstr "Vergleich nur für angezeigte Pfade"
#: gitk:8045
#: gitk:9264
msgid "External diff tool"
msgstr "Externes Vergleich-(Diff-)Programm"
#: gitk:9266
msgid "Choose..."
msgstr "Wählen..."
#: gitk:9271
msgid "Colors: press to choose"
msgstr "Farben: Klicken zum Wählen"
@@ -873,22 +913,6 @@ msgstr "Mehrdeutige Angabe »%s«: Sowohl Version als auch Dateiname existiert."
msgid "Bad arguments to gitk:"
msgstr "Falsche Kommandozeilen-Parameter für gitk:"
#: gitk:8637
msgid "Couldn't get list of unmerged files:"
msgstr "Liste der nicht-zusammengeführten Dateien nicht gefunden:"
#: gitk:8653
msgid "No files selected: --merge specified but no files are unmerged."
msgstr "Keine Dateien ausgewählt: --merge angegeben, es existieren aber keine nicht-zusammengeführten Dateien."
#: gitk:8656
msgid ""
"No files selected: --merge specified but no unmerged files are within file "
"limit."
msgstr ""
"Keine Dateien ausgewähle: --merge angegeben, aber keine nicht-"
"zusammengeführten Dateien sind in der Dateiauswahl."
#: gitk:8717
#: gitk:9915
msgid "Command line"
msgstr "Kommandozeile"

File diff suppressed because it is too large Load Diff

View File

@@ -204,7 +204,7 @@ const char *fmt_ident(const char *name, const char *email,
if ((warn_on_no_name || error_on_no_name) &&
name == git_default_name && env_hint) {
fprintf(stderr, env_hint, au_env, co_env);
env_hint = NULL; /* warn only once, for "git-var -l" */
env_hint = NULL; /* warn only once, for "git var -l" */
}
if (error_on_no_name)
die("empty ident %s <%s> not allowed", name, email);

View File

@@ -483,3 +483,15 @@ int parse_opt_approxidate_cb(const struct option *opt, const char *arg,
*(unsigned long *)(opt->value) = approxidate(arg);
return 0;
}
/*
* This should really be OPTION_FILENAME type as a part of
* parse_options that take prefix to do this while parsing.
*/
extern const char *parse_options_fix_filename(const char *prefix, const char *file)
{
if (!file || !prefix || is_absolute_path(file) || !strcmp("-", file))
return file;
return prefix_filename(prefix, strlen(prefix), file);
}

View File

@@ -159,4 +159,6 @@ extern int parse_opt_approxidate_cb(const struct option *, const char *, int);
"use <n> digits to display SHA-1s", \
PARSE_OPT_OPTARG, &parse_opt_abbrev_cb, 0 }
extern const char *parse_options_fix_filename(const char *prefix, const char *file);
#endif

View File

@@ -90,7 +90,7 @@ TODO: In the future, we might also do
Currently, the module merely wraps calls to external Git tools. In the future,
it will provide a much faster way to interact with Git by linking directly
to libgit. This should be completely opaque to the user, though (performance
increate nonwithstanding).
increase notwithstanding).
=cut
@@ -417,6 +417,7 @@ have more complicated structure.
=cut
sub command_close_bidi_pipe {
local $?;
my ($pid, $in, $out, $ctx) = @_;
foreach my $fh ($in, $out) {
unless (close $fh) {
@@ -730,7 +731,7 @@ This suite of functions retrieves and parses ident information, as stored
in the commit and tag objects or produced by C<var GIT_type_IDENT> (thus
C<TYPE> can be either I<author> or I<committer>; case is insignificant).
The C<ident> method retrieves the ident information from C<git-var>
The C<ident> method retrieves the ident information from C<git var>
and either returns it as a scalar string or as an array with the fields parsed.
Alternatively, it can take a prepared ident string (e.g. from the commit
object) and just parse it.
@@ -839,8 +840,8 @@ sub _close_hash_and_insert_object {
my @vars = map { 'hash_object_' . $_ } qw(pid in out ctx);
command_close_bidi_pipe($self->{@vars});
delete $self->{@vars};
command_close_bidi_pipe(@$self{@vars});
delete @$self{@vars};
}
=item cat_blob ( SHA1, FILEHANDLE )
@@ -928,8 +929,8 @@ sub _close_cat_blob {
my @vars = map { 'cat_blob_' . $_ } qw(pid in out ctx);
command_close_bidi_pipe($self->{@vars});
delete $self->{@vars};
command_close_bidi_pipe(@$self{@vars});
delete @$self{@vars};
}
=back

View File

@@ -29,11 +29,11 @@ $(makfile): ../GIT-CFLAGS Makefile
'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
echo ' cp private-Error.pm blib/lib/Error.pm' >> $@
echo install: >> $@
echo ' mkdir -p $(instdir_SQ)' >> $@
echo ' $(RM) $(instdir_SQ)/Git.pm; cp Git.pm $(instdir_SQ)' >> $@
echo ' $(RM) $(instdir_SQ)/Error.pm' >> $@
echo ' mkdir -p "$(instdir_SQ)"' >> $@
echo ' $(RM) "$(instdir_SQ)/Git.pm"; cp Git.pm "$(instdir_SQ)"' >> $@
echo ' $(RM) "$(instdir_SQ)/Error.pm"' >> $@
'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
echo ' cp private-Error.pm $(instdir_SQ)/Error.pm' >> $@
echo ' cp private-Error.pm "$(instdir_SQ)/Error.pm"' >> $@
echo instlibdir: >> $@
echo ' echo $(instdir_SQ)' >> $@
else

View File

@@ -1002,7 +1002,7 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
!strcmp(arg, "--no-walk") || !strcmp(arg, "--do-walk"))
{
unkv[(*unkc)++] = arg;
return 0;
return 1;
}
if (!prefixcmp(arg, "--max-count=")) {

View File

@@ -68,6 +68,7 @@ int start_command(struct child_process *cmd)
trace_argv_printf(cmd->argv, "trace: run_command:");
#ifndef __MINGW32__
fflush(NULL);
cmd->pid = fork();
if (!cmd->pid) {
if (cmd->no_stdin)
@@ -304,6 +305,9 @@ int start_async(struct async *async)
async->out = pipe_out[0];
#ifndef __MINGW32__
/* Flush stdio before fork() to avoid cloning buffers */
fflush(NULL);
async->pid = fork();
if (async->pid < 0) {
error("fork (async) failed: %s", strerror(errno));

View File

@@ -1929,11 +1929,18 @@ static int sha1_loose_object_info(const unsigned char *sha1, unsigned long *size
int sha1_object_info(const unsigned char *sha1, unsigned long *sizep)
{
struct pack_entry e;
int status;
if (!find_pack_entry(sha1, &e, NULL)) {
/* Most likely it's a loose object. */
status = sha1_loose_object_info(sha1, sizep);
if (status >= 0)
return status;
/* Not a loose object; someone else may have just packed it. */
reprepare_packed_git();
if (!find_pack_entry(sha1, &e, NULL))
return sha1_loose_object_info(sha1, sizep);
return status;
}
return packed_object_info(e.p, e.offset, sizep);
}

View File

@@ -47,6 +47,7 @@ test_expect_success 'test help' '
cat > expect << EOF
boolean: 2
integer: 1729
timestamp: 0
string: 123
abbrev: 7
verbose: 2
@@ -63,6 +64,7 @@ test_expect_success 'short options' '
cat > expect << EOF
boolean: 2
integer: 1729
timestamp: 0
string: 321
abbrev: 10
verbose: 2
@@ -88,6 +90,7 @@ test_expect_success 'missing required value' '
cat > expect << EOF
boolean: 1
integer: 13
timestamp: 0
string: 123
abbrev: 7
verbose: 0
@@ -108,6 +111,7 @@ test_expect_success 'intermingled arguments' '
cat > expect << EOF
boolean: 0
integer: 2
timestamp: 0
string: (not set)
abbrev: 7
verbose: 0
@@ -135,6 +139,7 @@ test_expect_success 'ambiguously abbreviated option' '
cat > expect << EOF
boolean: 0
integer: 0
timestamp: 0
string: 123
abbrev: 7
verbose: 0
@@ -161,6 +166,7 @@ test_expect_success 'detect possible typos' '
cat > expect <<EOF
boolean: 0
integer: 0
timestamp: 0
string: (not set)
abbrev: 7
verbose: 0
@@ -177,7 +183,8 @@ test_expect_success 'keep some options as arguments' '
cat > expect <<EOF
boolean: 0
integer: 1
integer: 0
timestamp: 1
string: default
abbrev: 7
verbose: 0
@@ -197,6 +204,7 @@ cat > expect <<EOF
Callback: "four", 0
boolean: 5
integer: 4
timestamp: 0
string: (not set)
abbrev: 7
verbose: 0
@@ -223,6 +231,7 @@ test_expect_success 'OPT_CALLBACK() and callback errors work' '
cat > expect <<EOF
boolean: 1
integer: 23
timestamp: 0
string: (not set)
abbrev: 7
verbose: 0

View File

@@ -31,6 +31,12 @@ test_expect_success 'clone with excess parameters (2)' '
'
test_expect_success 'output from clone' '
rm -fr dst &&
git clone -n "file://$(pwd)/src" dst >output &&
test $(grep Initialized output | wc -l) = 1
'
test_expect_success 'clone does not keep pack' '
rm -fr dst &&
@@ -70,4 +76,23 @@ test_expect_success 'clone creates intermediate directories for bare repo' '
'
test_expect_success 'clone --mirror' '
git clone --mirror src mirror &&
test -f mirror/HEAD &&
test ! -f mirror/file &&
FETCH="$(cd mirror && git config remote.origin.fetch)" &&
test "+refs/*:refs/*" = "$FETCH" &&
MIRROR="$(cd mirror && git config --bool remote.origin.mirror)" &&
test "$MIRROR" = true
'
test_expect_success 'clone --bare names the local repository <name>.git' '
git clone --bare src &&
test -d src.git
'
test_done

View File

@@ -1071,4 +1071,24 @@ test_expect_success \
test_cmp expect actual
'
test_expect_success 'filename for the message is relative to cwd' '
mkdir subdir &&
echo "Tag message in top directory" >msgfile-5 &&
echo "Tag message in sub directory" >subdir/msgfile-5 &&
(
cd subdir &&
git tag -a -F msgfile-5 tag-from-subdir
) &&
git cat-file tag tag-from-subdir | grep "in sub directory"
'
test_expect_success 'filename for the message is relative to cwd' '
echo "Tag message in sub directory" >subdir/msgfile-6 &&
(
cd subdir &&
git tag -a -F msgfile-6 tag-from-subdir-2
) &&
git cat-file tag tag-from-subdir-2 | grep "in sub directory"
'
test_done

View File

@@ -138,4 +138,33 @@ test_expect_success '--signoff' '
diff expect output
'
test_expect_success 'commit message from file (1)' '
mkdir subdir &&
echo "Log in top directory" >log &&
echo "Log in sub directory" >subdir/log &&
(
cd subdir &&
git commit --allow-empty -F log
) &&
commit_msg_is "Log in sub directory"
'
test_expect_success 'commit message from file (2)' '
rm -f log &&
echo "Log in sub directory" >subdir/log &&
(
cd subdir &&
git commit --allow-empty -F log
) &&
commit_msg_is "Log in sub directory"
'
test_expect_success 'commit message from stdin' '
(
cd subdir &&
echo "Log with foo word" | git commit --allow-empty -F -
) &&
commit_msg_is "Log with foo word"
'
test_done

View File

@@ -141,16 +141,15 @@ test_expect_success 'cleanup commit messages (strip,-F)' '
echo "sample
# Please enter the commit message for your changes.
# To abort the commit, use an empty commit message.
# (Comment lines starting with '#' will not be included)" >expect
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit." >expect
test_expect_success 'cleanup commit messages (strip,-F,-e)' '
echo >>negative &&
{ echo;echo sample;echo; } >text &&
git commit -e -F text -a &&
head -n 5 .git/COMMIT_EDITMSG >actual &&
head -n 4 .git/COMMIT_EDITMSG >actual &&
test_cmp expect actual
'
@@ -163,7 +162,7 @@ test_expect_success 'author different from committer' '
echo >>negative &&
git commit -e -m "sample"
head -n 8 .git/COMMIT_EDITMSG >actual &&
head -n 7 .git/COMMIT_EDITMSG >actual &&
test_cmp expect actual
'
@@ -182,7 +181,7 @@ test_expect_success 'committer is automatic' '
# must fail because there is no change
test_must_fail git commit -e -m "sample"
) &&
head -n 9 .git/COMMIT_EDITMSG | \
head -n 8 .git/COMMIT_EDITMSG | \
sed "s/^# Committer: .*/# Committer:/" >actual &&
test_cmp expect actual
'

View File

@@ -28,6 +28,7 @@ start_svnserve () {
test_expect_success 'start tracking an empty repo' '
svn mkdir -m "empty dir" "$svnrepo"/empty-dir &&
echo "[general]" > "$rawsvnrepo"/conf/svnserve.conf &&
echo anon-access = write >> "$rawsvnrepo"/conf/svnserve.conf &&
start_svnserve &&
git svn init svn://127.0.0.1:$SVNSERVE_PORT &&

View File

@@ -5,20 +5,38 @@
test_description='git-svn info'
. ./lib-git-svn.sh
say 'skipping svn-info test (has a race undiagnosed yet)'
test_done
set -e
# Tested with: svn, version 1.4.4 (r25188)
v=`svn --version | sed -n -e 's/^svn, version \(1\.4\.[0-9]\).*$/\1/p'`
case $v in
1.4.*)
;;
*)
say "skipping svn-info test (SVN version: $v not supported)"
test_done
;;
esac
ptouch() {
perl -w -e '
use strict;
use POSIX qw(mktime);
die "ptouch requires exactly 2 arguments" if @ARGV != 2;
die "$ARGV[0] does not exist" if ! -e $ARGV[0];
my @s = stat $ARGV[0];
utime $s[8], $s[9], $ARGV[1];
' "$1" "$2"
my $text_last_updated = shift @ARGV;
my $git_file = shift @ARGV;
die "\"$git_file\" does not exist" if ! -e $git_file;
if ($text_last_updated
=~ /(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/) {
my $mtime = mktime($6, $5, $4, $3, $2 - 1, $1 - 1900);
my $atime = $mtime;
utime $atime, $mtime, $git_file;
}
' "`svn info $2 | grep '^Text Last Updated:'`" "$1"
}
test_expect_success 'setup repository and import' "
test_expect_success 'setup repository and import' '
mkdir info &&
cd info &&
echo FIRST > A &&
@@ -27,19 +45,19 @@ test_expect_success 'setup repository and import' "
mkdir directory &&
touch directory/.placeholder &&
ln -s directory symlink-directory &&
svn import -m 'initial' . $svnrepo &&
svn import -m "initial" . "$svnrepo" &&
cd .. &&
mkdir gitwc &&
cd gitwc &&
git-svn init $svnrepo &&
git-svn init "$svnrepo" &&
git-svn fetch &&
cd .. &&
svn co $svnrepo svnwc &&
svn co "$svnrepo" svnwc &&
ptouch svnwc/file gitwc/file &&
ptouch svnwc/directory gitwc/directory &&
ptouch svnwc/symlink-file gitwc/symlink-file &&
ptouch svnwc/symlink-directory gitwc/symlink-directory
"
'
test_expect_success 'info' "
(cd svnwc; svn info) > expected.info &&
@@ -48,7 +66,7 @@ test_expect_success 'info' "
"
test_expect_success 'info --url' '
test $(cd gitwc; git-svn info --url) = $svnrepo
test "$(cd gitwc; git-svn info --url)" = "$svnrepo"
'
test_expect_success 'info .' "
@@ -58,7 +76,7 @@ test_expect_success 'info .' "
"
test_expect_success 'info --url .' '
test $(cd gitwc; git-svn info --url .) = $svnrepo
test "$(cd gitwc; git-svn info --url .)" = "$svnrepo"
'
test_expect_success 'info file' "
@@ -68,7 +86,7 @@ test_expect_success 'info file' "
"
test_expect_success 'info --url file' '
test $(cd gitwc; git-svn info --url file) = "$svnrepo/file"
test "$(cd gitwc; git-svn info --url file)" = "$svnrepo/file"
'
test_expect_success 'info directory' "
@@ -78,7 +96,7 @@ test_expect_success 'info directory' "
"
test_expect_success 'info --url directory' '
test $(cd gitwc; git-svn info --url directory) = "$svnrepo/directory"
test "$(cd gitwc; git-svn info --url directory)" = "$svnrepo/directory"
'
test_expect_success 'info symlink-file' "
@@ -88,7 +106,7 @@ test_expect_success 'info symlink-file' "
"
test_expect_success 'info --url symlink-file' '
test $(cd gitwc; git-svn info --url symlink-file) \
test "$(cd gitwc; git-svn info --url symlink-file)" \
= "$svnrepo/symlink-file"
'
@@ -101,7 +119,7 @@ test_expect_success 'info symlink-directory' "
"
test_expect_success 'info --url symlink-directory' '
test $(cd gitwc; git-svn info --url symlink-directory) \
test "$(cd gitwc; git-svn info --url symlink-directory)" \
= "$svnrepo/symlink-directory"
'
@@ -121,7 +139,7 @@ test_expect_success 'info added-file' "
"
test_expect_success 'info --url added-file' '
test $(cd gitwc; git-svn info --url added-file) \
test "$(cd gitwc; git-svn info --url added-file)" \
= "$svnrepo/added-file"
'
@@ -143,7 +161,7 @@ test_expect_success 'info added-directory' "
"
test_expect_success 'info --url added-directory' '
test $(cd gitwc; git-svn info --url added-directory) \
test "$(cd gitwc; git-svn info --url added-directory)" \
= "$svnrepo/added-directory"
'
@@ -166,7 +184,7 @@ test_expect_success 'info added-symlink-file' "
"
test_expect_success 'info --url added-symlink-file' '
test $(cd gitwc; git-svn info --url added-symlink-file) \
test "$(cd gitwc; git-svn info --url added-symlink-file)" \
= "$svnrepo/added-symlink-file"
'
@@ -189,7 +207,7 @@ test_expect_success 'info added-symlink-directory' "
"
test_expect_success 'info --url added-symlink-directory' '
test $(cd gitwc; git-svn info --url added-symlink-directory) \
test "$(cd gitwc; git-svn info --url added-symlink-directory)" \
= "$svnrepo/added-symlink-directory"
'
@@ -215,7 +233,7 @@ test_expect_success 'info deleted-file' "
"
test_expect_success 'info --url file (deleted)' '
test $(cd gitwc; git-svn info --url file) \
test "$(cd gitwc; git-svn info --url file)" \
= "$svnrepo/file"
'
@@ -236,7 +254,7 @@ test_expect_success 'info deleted-directory' "
"
test_expect_success 'info --url directory (deleted)' '
test $(cd gitwc; git-svn info --url directory) \
test "$(cd gitwc; git-svn info --url directory)" \
= "$svnrepo/directory"
'
@@ -258,7 +276,7 @@ test_expect_success 'info deleted-symlink-file' "
"
test_expect_success 'info --url symlink-file (deleted)' '
test $(cd gitwc; git-svn info --url symlink-file) \
test "$(cd gitwc; git-svn info --url symlink-file)" \
= "$svnrepo/symlink-file"
'
@@ -280,7 +298,7 @@ test_expect_success 'info deleted-symlink-directory' "
"
test_expect_success 'info --url symlink-directory (deleted)' '
test $(cd gitwc; git-svn info --url symlink-directory) \
test "$(cd gitwc; git-svn info --url symlink-directory)" \
= "$svnrepo/symlink-directory"
'
@@ -297,8 +315,8 @@ test_expect_success 'info unknown-file' "
"
test_expect_success 'info --url unknown-file' '
test -z $(cd gitwc; git-svn info --url unknown-file \
2> ../actual.info--url-unknown-file) &&
test -z "$(cd gitwc; git-svn info --url unknown-file \
2> ../actual.info--url-unknown-file)" &&
git-diff expected.info-unknown-file actual.info--url-unknown-file
'
@@ -314,8 +332,8 @@ test_expect_success 'info unknown-directory' "
"
test_expect_success 'info --url unknown-directory' '
test -z $(cd gitwc; git-svn info --url unknown-directory \
2> ../actual.info--url-unknown-directory) &&
test -z "$(cd gitwc; git-svn info --url unknown-directory \
2> ../actual.info--url-unknown-directory)" &&
git-diff expected.info-unknown-directory \
actual.info--url-unknown-directory
'
@@ -337,8 +355,8 @@ test_expect_success 'info unknown-symlink-file' "
"
test_expect_success 'info --url unknown-symlink-file' '
test -z $(cd gitwc; git-svn info --url unknown-symlink-file \
2> ../actual.info--url-unknown-symlink-file) &&
test -z "$(cd gitwc; git-svn info --url unknown-symlink-file \
2> ../actual.info--url-unknown-symlink-file)" &&
git-diff expected.info-unknown-symlink-file \
actual.info--url-unknown-symlink-file
'
@@ -361,8 +379,8 @@ test_expect_success 'info unknown-symlink-directory' "
"
test_expect_success 'info --url unknown-symlink-directory' '
test -z $(cd gitwc; git-svn info --url unknown-symlink-directory \
2> ../actual.info--url-unknown-symlink-directory) &&
test -z "$(cd gitwc; git-svn info --url unknown-symlink-directory \
2> ../actual.info--url-unknown-symlink-directory)" &&
git-diff expected.info-unknown-symlink-directory \
actual.info--url-unknown-symlink-directory
'

View File

@@ -2,7 +2,8 @@
#include "parse-options.h"
static int boolean = 0;
static unsigned long integer = 0;
static int integer = 0;
static unsigned long timestamp;
static int abbrev = 7;
static int verbose = 0, dry_run = 0, quiet = 0;
static char *string = NULL;
@@ -32,7 +33,7 @@ int main(int argc, const char **argv)
OPT_INTEGER('i', "integer", &integer, "get a integer"),
OPT_INTEGER('j', NULL, &integer, "get a integer, too"),
OPT_SET_INT(0, "set23", &integer, "set integer to 23", 23),
OPT_DATE('t', NULL, &integer, "get timestamp of <time>"),
OPT_DATE('t', NULL, &timestamp, "get timestamp of <time>"),
OPT_CALLBACK('L', "length", &integer, "str",
"get length of <str>", length_callback),
OPT_GROUP("String options"),
@@ -56,7 +57,8 @@ int main(int argc, const char **argv)
argc = parse_options(argc, argv, options, usage, 0);
printf("boolean: %d\n", boolean);
printf("integer: %lu\n", integer);
printf("integer: %u\n", integer);
printf("timestamp: %lu\n", timestamp);
printf("string: %s\n", string ? string : "(not set)");
printf("abbrev: %d\n", abbrev);
printf("verbose: %d\n", verbose);

2
var.c
View File

@@ -5,7 +5,7 @@
*/
#include "cache.h"
static const char var_usage[] = "git-var [-l | <variable>]";
static const char var_usage[] = "git var [-l | <variable>]";
struct git_var {
const char *name;