1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-08 00:46:11 +02:00

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
This commit is contained in:
Junio C Hamano 2008-10-31 01:42:58 -07:00
commit 933bb3ae5e
8 changed files with 102 additions and 30 deletions

View File

@ -40,6 +40,26 @@ endif::doctype-manpage[]
</literallayout> </literallayout>
{title#}</example> {title#}</example>
endif::docbook-xsl-172[] 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[] endif::backend-docbook[]
ifdef::doctype-manpage[] ifdef::doctype-manpage[]

View File

@ -163,8 +163,8 @@ few exceptions. Even though...
`ident` `ident`
^^^^^^^ ^^^^^^^
When the attribute `ident` is set to a path, git replaces When the attribute `ident` is set for a path, git replaces
`$Id$` in the blob object with `$Id:`, followed by `$Id$` in the blob object with `$Id:`, followed by the
40-character hexadecimal blob object name, followed by a dollar 40-character hexadecimal blob object name, followed by a dollar
sign `$` upon checkout. Any byte sequence that begins with sign `$` upon checkout. Any byte sequence that begins with
`$Id:` and ends with `$` in the worktree file is replaced `$Id:` and ends with `$` in the worktree file is replaced

View File

@ -251,7 +251,7 @@ static int revert_or_cherry_pick(int argc, const char **argv)
int i, index_fd, clean; int i, index_fd, clean;
char *oneline, *reencoded_message = NULL; char *oneline, *reencoded_message = NULL;
const char *message, *encoding; const char *message, *encoding;
const char *defmsg = xstrdup(git_path("MERGE_MSG")); char *defmsg = xstrdup(git_path("MERGE_MSG"));
struct merge_options o; struct merge_options o;
struct tree *result, *next_tree, *base_tree, *head_tree; struct tree *result, *next_tree, *base_tree, *head_tree;
static struct lock_file index_lock; 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); return execv_git_cmd(args);
} }
free(reencoded_message); free(reencoded_message);
free(defmsg);
return 0; return 0;
} }

View File

@ -1398,6 +1398,8 @@ _git_shortlog ()
_git_show () _git_show ()
{ {
__git_has_doubledash && return
local cur="${COMP_WORDS[COMP_CWORD]}" local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in case "$cur" in
--pretty=*) --pretty=*)

View File

@ -493,7 +493,7 @@ void diffcore_rename(struct diff_options *options)
if ((num_create > rename_limit && num_src > rename_limit) || if ((num_create > rename_limit && num_src > rename_limit) ||
(num_create * num_src > rename_limit * rename_limit)) { (num_create * num_src > rename_limit * rename_limit)) {
if (options->warn_on_too_large_rename) 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; goto cleanup;
} }

View File

@ -2267,7 +2267,7 @@ sub do_git_commit {
} }
die "Tree is not a valid sha1: $tree\n" if $tree !~ /^$::sha1$/o; 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)) { foreach ($self->get_commit_parents($log_entry)) {
push @exec, '-p', $_; push @exec, '-p', $_;
} }

View File

@ -90,7 +90,7 @@ test_expect_success \
'validate file modification time' \ 'validate file modification time' \
'mkdir extract && 'mkdir extract &&
"$TAR" xf b.tar -C extract a/a && "$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 && echo "1117231200" >expected.mtime &&
diff expected.mtime b.mtime' diff expected.mtime b.mtime'

View File

@ -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 "git-compat-util.h"
#include <utime.h> #include <utime.h>
static const char usage_str[] = "(+|=|=+|=-|-)<seconds> <file>..."; static const char usage_str[] = "-v|--verbose (+|=|=+|=-|-)<seconds> <file>...";
static int timespec_arg(const char *arg, long int *set_time, int *set_eq)
{
char *test;
const char *timespec = arg;
*set_eq = (*timespec == '=') ? 1 : 0;
if (*set_eq) {
timespec++;
if (*timespec == '+') {
*set_eq = 2; /* relative "in the future" */
timespec++;
}
}
*set_time = strtol(timespec, &test, 10);
if (*test) {
fprintf(stderr, "Not a base-10 integer: %s\n", arg + 1);
return 0;
}
if ((*set_eq && *set_time < 0) || *set_eq == 2) {
time_t now = time(NULL);
*set_time += now;
}
return 1;
}
int main(int argc, const char *argv[]) int main(int argc, const char *argv[])
{ {
int i; static int verbose;
int set_eq;
long int set_time; int i = 1;
char *test; /* no mtime change by default */
const char *timespec; int set_eq = 0;
long int set_time = 0;
if (argc < 3) if (argc < 3)
goto usage; goto usage;
timespec = argv[1]; if (strcmp(argv[i], "--verbose") == 0 || strcmp(argv[i], "-v") == 0) {
set_eq = (*timespec == '=') ? 1 : 0; verbose = 1;
if (set_eq) { ++i;
timespec++;
if (*timespec == '+') {
set_eq = 2; /* relative "in the future" */
timespec++;
}
} }
set_time = strtol(timespec, &test, 10); if (timespec_arg(argv[i], &set_time, &set_eq))
if (*test) { ++i;
fprintf(stderr, "Not a base-10 integer: %s\n", argv[1] + 1); else
goto usage; goto usage;
}
if ((set_eq && set_time < 0) || set_eq == 2) {
time_t now = time(NULL);
set_time += now;
}
for (i = 2; i < argc; i++) { for (; i < argc; i++) {
struct stat sb; struct stat sb;
struct utimbuf utb; struct utimbuf utb;
@ -46,7 +90,12 @@ int main(int argc, const char *argv[])
utb.actime = sb.st_atime; utb.actime = sb.st_atime;
utb.modtime = set_eq ? set_time : sb.st_mtime + set_time; 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", fprintf(stderr, "Failed to modify time on %s: %s\n",
argv[i], strerror(errno)); argv[i], strerror(errno));
return -1; return -1;