aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-10-31 01:42:58 -0700
committerJunio C Hamano <gitster@pobox.com>2008-10-31 01:42:58 -0700
commit933bb3ae5e6c83288ec7c80c2282984f4927cb48 (patch)
treeddd8cba625475e53e370471f61ea0fcba2f64921
parent797484392a823c66bd846545a43d76aa2c64f5ff (diff)
parente855bfc0404d3344787541c1bdaa1e8d44398eb3 (diff)
downloadgit-933bb3ae5e6c83288ec7c80c2282984f4927cb48.tar.gz
git-933bb3ae5e6c83288ec7c80c2282984f4927cb48.tar.xz
Merge branch 'maint'
* maint: git-svn: change dashed git-commit-tree to git commit-tree Documentation: clarify information about 'ident' attribute bash completion: add doubledash to "git show" Use test-chmtime -v instead of perl in t5000 to get mtime of a file Add --verbose|-v to test-chmtime asciidoc: add minor workaround to add an empty line after code blocks Plug a memleak in builtin-revert Add file delete/create info when we overflow rename_limit Install git-cvsserver in $(bindir) Install git-shell in bindir, too
-rw-r--r--Documentation/asciidoc.conf20
-rw-r--r--Documentation/gitattributes.txt4
-rw-r--r--builtin-revert.c3
-rwxr-xr-xcontrib/completion/git-completion.bash2
-rw-r--r--diffcore-rename.c2
-rwxr-xr-xgit-svn.perl2
-rwxr-xr-xt/t5000-tar-tree.sh2
-rw-r--r--test-chmtime.c91
8 files changed, 99 insertions, 27 deletions
diff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf
index 40d43b78e..2da867d2f 100644
--- a/Documentation/asciidoc.conf
+++ b/Documentation/asciidoc.conf
@@ -40,6 +40,26 @@ endif::doctype-manpage[]
</literallayout>
{title#}</example>
endif::docbook-xsl-172[]
+
+ifdef::docbook-xsl-172[]
+ifdef::doctype-manpage[]
+# The following two small workarounds insert a simple paragraph after screen
+[listingblock]
+<example><title>{title}</title>
+<screen>
+|
+</screen><simpara></simpara>
+{title#}</example>
+
+[verseblock]
+<formalpara{id? id="{id}"}><title>{title}</title><para>
+{title%}<literallayout{id? id="{id}"}>
+{title#}<literallayout>
+|
+</literallayout><simpara></simpara>
+{title#}</para></formalpara>
+endif::doctype-manpage[]
+endif::docbook-xsl-172[]
endif::backend-docbook[]
ifdef::doctype-manpage[]
diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt
index 26945593c..24e880c5b 100644
--- a/Documentation/gitattributes.txt
+++ b/Documentation/gitattributes.txt
@@ -163,8 +163,8 @@ few exceptions. Even though...
`ident`
^^^^^^^
-When the attribute `ident` is set to a path, git replaces
-`$Id$` in the blob object with `$Id:`, followed by
+When the attribute `ident` is set for a path, git replaces
+`$Id$` in the blob object with `$Id:`, followed by the
40-character hexadecimal blob object name, followed by a dollar
sign `$` upon checkout. Any byte sequence that begins with
`$Id:` and ends with `$` in the worktree file is replaced
diff --git a/builtin-revert.c b/builtin-revert.c
index 472554019..7483a7a63 100644
--- a/builtin-revert.c
+++ b/builtin-revert.c
@@ -251,7 +251,7 @@ static int revert_or_cherry_pick(int argc, const char **argv)
int i, index_fd, clean;
char *oneline, *reencoded_message = NULL;
const char *message, *encoding;
- const char *defmsg = xstrdup(git_path("MERGE_MSG"));
+ char *defmsg = xstrdup(git_path("MERGE_MSG"));
struct merge_options o;
struct tree *result, *next_tree, *base_tree, *head_tree;
static struct lock_file index_lock;
@@ -432,6 +432,7 @@ static int revert_or_cherry_pick(int argc, const char **argv)
return execv_git_cmd(args);
}
free(reencoded_message);
+ free(defmsg);
return 0;
}
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index eebe73409..de193ba7c 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1398,6 +1398,8 @@ _git_shortlog ()
_git_show ()
{
+ __git_has_doubledash && return
+
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--pretty=*)
diff --git a/diffcore-rename.c b/diffcore-rename.c
index 1b2ebb400..168a95b54 100644
--- a/diffcore-rename.c
+++ b/diffcore-rename.c
@@ -493,7 +493,7 @@ void diffcore_rename(struct diff_options *options)
if ((num_create > rename_limit && num_src > rename_limit) ||
(num_create * num_src > rename_limit * rename_limit)) {
if (options->warn_on_too_large_rename)
- warning("too many files, skipping inexact rename detection");
+ warning("too many files (created: %d deleted: %d), skipping inexact rename detection", num_create, num_src);
goto cleanup;
}
diff --git a/git-svn.perl b/git-svn.perl
index f90ddac90..5702b100f 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -2267,7 +2267,7 @@ sub do_git_commit {
}
die "Tree is not a valid sha1: $tree\n" if $tree !~ /^$::sha1$/o;
- my @exec = ('git-commit-tree', $tree);
+ my @exec = ('git', 'commit-tree', $tree);
foreach ($self->get_commit_parents($log_entry)) {
push @exec, '-p', $_;
}
diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index 0f27d7304..c942c8be8 100755
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
@@ -90,7 +90,7 @@ test_expect_success \
'validate file modification time' \
'mkdir extract &&
"$TAR" xf b.tar -C extract a/a &&
- perl -e '\''print((stat("extract/a/a"))[9], "\n")'\'' >b.mtime &&
+ test-chmtime -v +0 extract/a/a |cut -f 1 >b.mtime &&
echo "1117231200" >expected.mtime &&
diff expected.mtime b.mtime'
diff --git a/test-chmtime.c b/test-chmtime.c
index 90da448eb..d5358cbaa 100644
--- a/test-chmtime.c
+++ b/test-chmtime.c
@@ -1,39 +1,83 @@
+/*
+ * This program can either change modification time of the given
+ * file(s) or just print it. The program does not change atime nor
+ * ctime (their values are explicitely preserved).
+ *
+ * The mtime can be changed to an absolute value:
+ *
+ * test-chmtime =<seconds> file...
+ *
+ * Relative to the current time as returned by time(3):
+ *
+ * test-chmtime =+<seconds> (or =-<seconds>) file...
+ *
+ * Or relative to the current mtime of the file:
+ *
+ * test-chmtime <seconds> file...
+ * test-chmtime +<seconds> (or -<seconds>) file...
+ *
+ * Examples:
+ *
+ * To just print the mtime use --verbose and set the file mtime offset to 0:
+ *
+ * test-chmtime -v +0 file
+ *
+ * To set the mtime to current time:
+ *
+ * test-chmtime =+0 file
+ *
+ */
#include "git-compat-util.h"
#include <utime.h>
-static const char usage_str[] = "(+|=|=+|=-|-)<seconds> <file>...";
+static const char usage_str[] = "-v|--verbose (+|=|=+|=-|-)<seconds> <file>...";
-int main(int argc, const char *argv[])
+static int timespec_arg(const char *arg, long int *set_time, int *set_eq)
{
- int i;
- int set_eq;
- long int set_time;
char *test;
- const char *timespec;
-
- if (argc < 3)
- goto usage;
-
- timespec = argv[1];
- set_eq = (*timespec == '=') ? 1 : 0;
- if (set_eq) {
+ const char *timespec = arg;
+ *set_eq = (*timespec == '=') ? 1 : 0;
+ if (*set_eq) {
timespec++;
if (*timespec == '+') {
- set_eq = 2; /* relative "in the future" */
+ *set_eq = 2; /* relative "in the future" */
timespec++;
}
}
- set_time = strtol(timespec, &test, 10);
+ *set_time = strtol(timespec, &test, 10);
if (*test) {
- fprintf(stderr, "Not a base-10 integer: %s\n", argv[1] + 1);
- goto usage;
+ fprintf(stderr, "Not a base-10 integer: %s\n", arg + 1);
+ return 0;
}
- if ((set_eq && set_time < 0) || set_eq == 2) {
+ if ((*set_eq && *set_time < 0) || *set_eq == 2) {
time_t now = time(NULL);
- set_time += now;
+ *set_time += now;
}
+ return 1;
+}
+
+int main(int argc, const char *argv[])
+{
+ static int verbose;
- for (i = 2; i < argc; i++) {
+ int i = 1;
+ /* no mtime change by default */
+ int set_eq = 0;
+ long int set_time = 0;
+
+ if (argc < 3)
+ goto usage;
+
+ if (strcmp(argv[i], "--verbose") == 0 || strcmp(argv[i], "-v") == 0) {
+ verbose = 1;
+ ++i;
+ }
+ if (timespec_arg(argv[i], &set_time, &set_eq))
+ ++i;
+ else
+ goto usage;
+
+ for (; i < argc; i++) {
struct stat sb;
struct utimbuf utb;
@@ -46,7 +90,12 @@ int main(int argc, const char *argv[])
utb.actime = sb.st_atime;
utb.modtime = set_eq ? set_time : sb.st_mtime + set_time;
- if (utime(argv[i], &utb) < 0) {
+ if (verbose) {
+ uintmax_t mtime = utb.modtime < 0 ? 0: utb.modtime;
+ printf("%"PRIuMAX"\t%s\n", mtime, argv[i]);
+ }
+
+ if (utb.modtime != sb.st_mtime && utime(argv[i], &utb) < 0) {
fprintf(stderr, "Failed to modify time on %s: %s\n",
argv[i], strerror(errno));
return -1;