Merge branch 'master' of git://repo.or.cz/alt-git.git

This commit is contained in:
Johannes Sixt
2008-02-02 20:58:49 +01:00
20 changed files with 135 additions and 49 deletions

View File

@@ -12,7 +12,7 @@ Fixes since v1.5.3.2
* The default shell on some FreeBSD did not execute the
argument parsing code correctly and made git unusable.
* git-svn incorrectly spawned pager even when the user user
* git-svn incorrectly spawned pager even when the user
explicitly asked not to.
* sample post-receive hook overquoted the envelope sender

View File

@@ -35,7 +35,7 @@ Deprecation notices
- Using dashed forms of git commands (e.g. "git-commit") from the
command line has been informally deprecated since early 2006, but
now it officially is, and will be removed in the future. Use
dashless forms (e.g. "git commit") instead.
dash-less forms (e.g. "git commit") instead.
- Using dashed forms from your scripts, without first prepending the
return value from "git --exec-path" to the scripts' PATH, has been
@@ -166,7 +166,7 @@ Updates since v1.5.3
command line in the generated log message, when told to cherry-pick a
commit by naming a tag that points at it. It does not anymore.
* "git for-each-ref" learned %(xxxdate:<dateformat>) syntax to show the
* "git for-each-ref" learned %(xxxdate:<date-format>) syntax to show the
various date fields in different formats.
* "git gc --auto" is a low-impact way to automatically run a variant of
@@ -221,7 +221,7 @@ Updates since v1.5.3
* "git pull --rebase" is a different way to integrate what you fetched
into your current branch.
* "git fast-export" produces datastream that can be fed to fast-import
* "git fast-export" produces data-stream that can be fed to fast-import
to reproduce the history recorded in a git repository.
* "git add -i" takes pathspecs to limit the set of files to work on.
@@ -342,7 +342,7 @@ Updates since v1.5.3
* "git help" learned "-w" option to show documentation in browsers.
* In addition there are quite a few internal clean-ups. Notably
* In addition there are quite a few internal clean-ups. Notably:
- many fork/exec have been replaced with run-command API,
brought from the msysgit effort.
@@ -365,7 +365,7 @@ series.
* The way "git diff --check" behaves is much more consistent with the way
"git apply --whitespace=warn" works.
* "git svn" talking with the SVN over http will correctly quote branch
* "git svn" talking with the SVN over HTTP will correctly quote branch
and project names.
* "git config" did not work correctly on platforms that define
@@ -375,9 +375,3 @@ series.
documentation; a workaround has been implemented.
* "git diff --color-words" colored context lines in a wrong color.
--
exec >/var/tmp/1
O=v1.5.4-rc5
echo O=`git describe refs/heads/master`
git shortlog --no-merges $O..refs/heads/master ^refs/heads/maint

View File

@@ -367,6 +367,11 @@ branch.<name>.rebase::
it unless you understand the implications (see linkgit:git-rebase[1]
for details).
browser.<tool>.path::
Override the path for the given tool that may be used to
browse HTML help (see '-w' option in linkgit:git-help[1]) or a
working repository in gitweb (see linkgit:git-instaweb[1]).
clean.requireForce::
A boolean to make git-clean do nothing unless given -f
or -n. Defaults to true.

View File

@@ -130,7 +130,7 @@ See also <<FILES>>.
-z, --null::
For all options that output values and/or keys, always
end values with with the null character (instead of a
end values with the null character (instead of a
newline). Use newline instead as a delimiter between
key and value. This allows for secure parsing of the
output without getting confused e.g. by values that

View File

@@ -183,7 +183,7 @@ access method and requested operation.
That means that even if you offer only read access (e.g. by using
the pserver method), git-cvsserver should have write access to
the database to work reliably (otherwise you need to make sure
that the database if up-to-date all the time git-cvsserver is run).
that the database is up-to-date any time git-cvsserver is executed).
By default it uses SQLite databases in the git directory, named
`gitcvs.<module_name>.sqlite`. Note that the SQLite backend creates
@@ -204,7 +204,7 @@ about `DBI->connect()`.
gitcvs.dbname::
Database name. The exact meaning depends on the
used database driver, for SQLite this is a filename.
selected database driver, for SQLite this is a filename.
Supports variable substitution (see below). May
not contain semicolons (`;`).
Default: '%Ggitcvs.%m.sqlite'
@@ -215,7 +215,7 @@ gitcvs.dbdriver::
with 'DBD::SQLite', reported to work with
'DBD::Pg', and reported *not* to work with 'DBD::mysql'.
Please regard this as an experimental feature. May not
contain double colons (`:`).
contain colons (`:`).
Default: 'SQLite'
gitcvs.dbuser::

View File

@@ -58,6 +58,16 @@ is available in PATH.
+
Note that the script tries, as much as possible, to display the HTML
page in a new tab on an already opened browser.
+
The following browsers are currently supported by 'git-help--browse':
+
* firefox (this is the default under X Window when not using KDE)
* iceweasel
* konqueror (this is the default under KDE)
* w3m (this is the default outside X Window)
* links
* lynx
* dillo
CONFIGURATION VARIABLES
-----------------------

View File

@@ -229,13 +229,13 @@ blobs contained in a commit.
* A colon, optionally followed by a stage number (0 to 3) and a
colon, followed by a path; this names a blob object in the
index at the given path. Missing stage number (and the colon
that follows it) names an stage 0 entry. During a merge, stage
that follows it) names a stage 0 entry. During a merge, stage
1 is the common ancestor, stage 2 is the target branch's version
(typically the current branch), and stage 3 is the version from
the branch being merged.
Here is an illustration, by Jon Loeliger. Both node B and C are
a commit parents of commit node A. Parent commits are ordered
Here is an illustration, by Jon Loeliger. Both commit nodes B
and C are parents of commit node A. Parent commits are ordered
left-to-right.
G H I J
@@ -291,7 +291,7 @@ and its parent commits exists. `r1{caret}@` notation means all
parents of `r1`. `r1{caret}!` includes commit `r1` but excludes
its all parents.
Here are a handful examples:
Here are a handful of examples:
D G H D
D F G H I J D F

View File

@@ -184,7 +184,7 @@ In a large project where raciness avoidance cost really matters,
however, the initial computation of all object names in the
index takes more than one second, and the index file is written
out after all that happens. Therefore the timestamp of the
index file will be more than one seconds later than the the
index file will be more than one seconds later than the
youngest file in the working tree. This means that in these
cases there actually will not be any racily clean entry in
the resulting index.

View File

@@ -1,7 +1,7 @@
#!/bin/sh
GVF=GIT-VERSION-FILE
DEF_VER=v1.5.4-rc5.GIT
DEF_VER=v1.5.4.GIT
LF='
'

View File

@@ -34,6 +34,16 @@ struct expire_reflog_cb {
struct cmd_reflog_expire_cb *cmd;
};
struct collected_reflog {
unsigned char sha1[20];
char reflog[FLEX_ARRAY];
};
struct collect_reflog_cb {
struct collected_reflog **e;
int alloc;
int nr;
};
#define INCOMPLETE (1u<<10)
#define STUDYING (1u<<11)
@@ -281,6 +291,20 @@ static int expire_reflog(const char *ref, const unsigned char *sha1, int unused,
return status;
}
static int collect_reflog(const char *ref, const unsigned char *sha1, int unused, void *cb_data)
{
struct collected_reflog *e;
struct collect_reflog_cb *cb = cb_data;
size_t namelen = strlen(ref);
e = xmalloc(sizeof(*e) + namelen + 1);
hashcpy(e->sha1, sha1);
memcpy(e->reflog, ref, namelen + 1);
ALLOC_GROW(cb->e, cb->nr + 1, cb->alloc);
cb->e[cb->nr++] = e;
return 0;
}
static int reflog_expire_config(const char *var, const char *value)
{
if (!strcmp(var, "gc.reflogexpire"))
@@ -349,8 +373,20 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
putchar('\n');
}
if (do_all)
status |= for_each_reflog(expire_reflog, &cb);
if (do_all) {
struct collect_reflog_cb collected;
int i;
memset(&collected, 0, sizeof(collected));
for_each_reflog(collect_reflog, &collected);
for (i = 0; i < collected.nr; i++) {
struct collected_reflog *e = collected.e[i];
status |= expire_reflog(e->reflog, e->sha1, 0, &cb);
free(e);
}
free(collected.e);
}
while (i < argc) {
const char *ref = argv[i++];
unsigned char sha1[20];

View File

@@ -71,7 +71,8 @@ while test $# != 0; do
done
arg="$1"
if rev=$(git rev-parse --verify "$arg^0" 2>/dev/null)
rev=$(git rev-parse --verify "$arg" 2>/dev/null)
if rev=$(git rev-parse --verify "$rev^0" 2>/dev/null)
then
[ -z "$rev" ] && die "unknown flag $arg"
new_name="$arg"
@@ -82,11 +83,11 @@ then
fi
new="$rev"
shift
elif rev=$(git rev-parse --verify "$arg^{tree}" 2>/dev/null)
elif rev=$(git rev-parse --verify "$rev^{tree}" 2>/dev/null)
then
# checking out selected paths from a tree-ish.
new="$rev"
new_name="$arg^{tree}"
new_name="$rev^{tree}"
shift
fi
[ "$1" = "--" ] && shift

View File

@@ -114,7 +114,6 @@ orig_namespace=refs/original/
force=
while :
do
test $# = 0 && usage
case "$1" in
--)
shift
@@ -189,6 +188,9 @@ cd "$tempdir/t" &&
workdir="$(pwd)" ||
die ""
# Remove tempdir on exit
trap 'cd ../..; rm -rf "$tempdir"' 0
# Make sure refs/original is empty
git for-each-ref > "$tempdir"/backup-refs
while read sha1 type name
@@ -210,7 +212,7 @@ GIT_WORK_TREE=.
export GIT_DIR GIT_WORK_TREE
# The refs should be updated if their heads were rewritten
git rev-parse --no-flags --revs-only --symbolic-full-name "$@" |
git rev-parse --no-flags --revs-only --symbolic-full-name --default HEAD "$@" |
sed -e '/^^/d' >"$tempdir"/heads
test -s "$tempdir"/heads ||
@@ -406,6 +408,8 @@ fi
cd ../..
rm -rf "$tempdir"
trap - 0
unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE
test -z "$ORIG_GIT_DIR" || GIT_DIR="$ORIG_GIT_DIR" && export GIT_DIR
test -z "$ORIG_GIT_WORK_TREE" || GIT_WORK_TREE="$ORIG_GIT_WORK_TREE" &&

View File

@@ -274,6 +274,14 @@ webrick)
;;
esac
init_browser_path() {
browser_path="`git config browser.$1.path`"
test -z "$browser_path" && browser_path="$1"
}
start_httpd
url=http://127.0.0.1:$port
test -n "$browser" && "$browser" $url || echo $url
test -n "$browser" && {
init_browser_path "$browser"
"$browser_path" $url
} || echo $url

View File

@@ -40,7 +40,7 @@ my $master_dir = pop @dirs;
opendir(D,$master_dir . "objects/")
or die "Failed to open $master_dir/objects/ : $!";
my @hashdirs = grep !/^\.{1,2}$/, readdir(D);
my @hashdirs = grep { ($_ eq 'pack') || /^[0-9a-f]{2}$/ } readdir(D);
foreach my $repo (@dirs) {
$linked = 0;

View File

@@ -129,17 +129,30 @@ descriptions.
Gitweb config file variables
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can set, among others, the following variables in gitweb config files:
You can set, among others, the following variables in gitweb config files
(with the exception of $projectroot and $projects_list this list does
not include variables usually directly set during build):
* $GIT
Cure git executable to use. By default set to "$GIT_BINDIR/git", which
in turn is by default set to "$(bindir)/git". If you use git from binary
package, set this to "/usr/bin/git". This can just be "git" if your
webserver has a sensible PATH. If you have multiple git versions
installed it is / can be used to choose which one to use.
installed it can be used to choose which one to use.
* $version
Gitweb version, set automatically when creating gitweb.cgi from
gitweb.perl. You might want to modify it if you are running modified
gitweb.
* $projectroot
Absolute filesystem path which will be prepended to project path;
the path to repository is $projectroot/$project. Set to
$GITWEB_PROJECTROOT during installation. This variable have to be
set correctly for gitweb to find repositories.
* $projects_list
Source of projects list, either directory to scan, or text file
with list of repositories (in the "<URI-encoded repository path> SPC
<URI-encoded repository owner>" format). Set to $GITWEB_LIST
during installation. If empty, $projectroot is used to scan for
repositories.
* $my_url, $my_uri
URL and absolute URL of gitweb script; you might need to set those
variables if you are using 'pathinfo' feature: see also below.

View File

@@ -1606,7 +1606,7 @@ sub git_get_project_description {
my $path = shift;
$git_dir = "$projectroot/$path";
open my $fd, "$projectroot/$path/description"
open my $fd, "$git_dir/description"
or return git_get_project_config('description');
my $descr = <$fd>;
close $fd;
@@ -5048,16 +5048,15 @@ sub git_commitdiff {
-expires => $expires,
-content_disposition => 'inline; filename="' . "$filename" . '"');
my %ad = parse_date($co{'author_epoch'}, $co{'author_tz'});
print <<TEXT;
From: $co{'author'}
Date: $ad{'rfc2822'} ($ad{'tz_local'})
Subject: $co{'title'}
TEXT
print "From: " . to_utf8($co{'author'}) . "\n";
print "Date: $ad{'rfc2822'} ($ad{'tz_local'})\n";
print "Subject: " . to_utf8($co{'title'}) . "\n";
print "X-Git-Tag: $tagname\n" if $tagname;
print "X-Git-Url: " . $cgi->self_url() . "\n\n";
foreach my $line (@{$co{'comment'}}) {
print "$line\n";
print to_utf8($line) . "\n";
}
print "---\n\n";
}

View File

@@ -324,4 +324,20 @@ test_expect_success 'rebase a detached HEAD' '
test $grandparent = $(git rev-parse HEAD~2)
'
test_expect_success 'rebase a commit violating pre-commit' '
mkdir -p .git/hooks &&
PRE_COMMIT=.git/hooks/pre-commit &&
echo "#!/bin/sh" > $PRE_COMMIT &&
echo "test -z \"\$(git diff --cached --check)\"" >> $PRE_COMMIT &&
chmod a+x $PRE_COMMIT &&
echo "monde! " >> file1 &&
test_tick &&
! git commit -m doesnt-verify file1 &&
git commit -m doesnt-verify --no-verify file1 &&
test_tick &&
FAKE_LINES=2 git rebase -i HEAD~2
'
test_done

View File

@@ -25,7 +25,7 @@ test_expect_success setup '
cat >victim/.git/hooks/pre-receive <<'EOF'
#!/bin/sh
printf "$@" >>$GIT_DIR/pre-receive.args
printf %s "$@" >>$GIT_DIR/pre-receive.args
cat - >$GIT_DIR/pre-receive.stdin
echo STDOUT pre-receive
echo STDERR pre-receive >&2
@@ -35,7 +35,7 @@ chmod u+x victim/.git/hooks/pre-receive
cat >victim/.git/hooks/update <<'EOF'
#!/bin/sh
echo "$@" >>$GIT_DIR/update.args
read x; printf "$x" >$GIT_DIR/update.stdin
read x; printf %s "$x" >$GIT_DIR/update.stdin
echo STDOUT update $1
echo STDERR update $1 >&2
test "$1" = refs/heads/master || exit
@@ -44,7 +44,7 @@ chmod u+x victim/.git/hooks/update
cat >victim/.git/hooks/post-receive <<'EOF'
#!/bin/sh
printf "$@" >>$GIT_DIR/post-receive.args
printf %s "$@" >>$GIT_DIR/post-receive.args
cat - >$GIT_DIR/post-receive.stdin
echo STDOUT post-receive
echo STDERR post-receive >&2
@@ -54,7 +54,7 @@ chmod u+x victim/.git/hooks/post-receive
cat >victim/.git/hooks/post-update <<'EOF'
#!/bin/sh
echo "$@" >>$GIT_DIR/post-update.args
read x; printf "$x" >$GIT_DIR/post-update.stdin
read x; printf %s "$x" >$GIT_DIR/post-update.stdin
echo STDOUT post-update
echo STDERR post-update >&2
EOF

View File

@@ -8,7 +8,7 @@ test_expect_success \
'prepare reference tree' \
'echo "1A quick brown fox jumps over the" >file &&
echo "lazy dog" >>file &&
git add file
git add file &&
GIT_AUTHOR_NAME="A" git commit -a -m "Initial."'
test_expect_success \
@@ -20,9 +20,9 @@ test_expect_success \
echo " echo \"!\$a!\""
echo "done >commandline"
echo "cat > msgtxt"
) >fake.sendmail
chmod +x ./fake.sendmail
git add fake.sendmail
) >fake.sendmail &&
chmod +x ./fake.sendmail &&
git add fake.sendmail &&
GIT_AUTHOR_NAME="A" git commit -a -m "Second."'
test_expect_success 'Extract patches' '

View File

@@ -257,7 +257,7 @@ test_expect_code () {
echo >&3 ""
}
# Most tests can use the created repository, but some amy need to create more.
# Most tests can use the created repository, but some may need to create more.
# Usage: test_create_repo <directory>
test_create_repo () {
test "$#" = 1 ||