From 18378655be4e48360241d81d7bafd9e7aa622560 Mon Sep 17 00:00:00 2001 From: Tommi Virtanen Date: Sun, 24 Aug 2008 23:23:25 +0300 Subject: [PATCH 01/10] Install git-shell in bindir, too /etc/passwd shell field must be something execable, you can't enter "/usr/bin/git shell" there. git-shell must be present as a separate executable, or it is useless. Signed-off-by: Tommi Virtanen Signed-off-by: Junio C Hamano --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0d40f0ecca..e7e6f9c718 100644 --- a/Makefile +++ b/Makefile @@ -1355,7 +1355,7 @@ install: all $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)' $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' $(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' - $(INSTALL) git$X git-upload-pack$X git-receive-pack$X git-upload-archive$X '$(DESTDIR_SQ)$(bindir_SQ)' + $(INSTALL) git$X git-upload-pack$X git-receive-pack$X git-upload-archive$X git-shell$X '$(DESTDIR_SQ)$(bindir_SQ)' $(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install $(MAKE) -C perl prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install ifndef NO_TCLTK From 1df2a1ce806de11d382816644cc971d16aab06b7 Mon Sep 17 00:00:00 2001 From: Nanako Shiraishi Date: Wed, 10 Sep 2008 20:03:18 +0900 Subject: [PATCH 02/10] Install git-cvsserver in $(bindir) It is one of the server side programs and needs to be found on usual $PATH. Signed-off-by: Nanako Shiraishi Signed-off-by: Junio C Hamano --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e7e6f9c718..becd008e04 100644 --- a/Makefile +++ b/Makefile @@ -1355,7 +1355,7 @@ install: all $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)' $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' $(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' - $(INSTALL) git$X git-upload-pack$X git-receive-pack$X git-upload-archive$X git-shell$X '$(DESTDIR_SQ)$(bindir_SQ)' + $(INSTALL) git$X git-upload-pack$X git-receive-pack$X git-upload-archive$X git-shell$X git-cvsserver '$(DESTDIR_SQ)$(bindir_SQ)' $(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install $(MAKE) -C perl prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install ifndef NO_TCLTK From 6e381d3aff89e09d13bd855ed6e18b0aa6f1e441 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Mon, 27 Oct 2008 13:06:16 -0700 Subject: [PATCH 03/10] Add file delete/create info when we overflow rename_limit When we refuse to do rename detection due to having too many files created or deleted, let the user know the numbers. That way there is a reasonable starting point for setting the diff.renamelimit option. Signed-off-by: Linus Torvalds Signed-off-by: Junio C Hamano --- diffcore-rename.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diffcore-rename.c b/diffcore-rename.c index 1b2ebb4001..168a95b541 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; } From d258b25887f763db96c20d4ec805ae685f55bdd1 Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Tue, 28 Oct 2008 18:27:33 +0100 Subject: [PATCH 04/10] Plug a memleak in builtin-revert Probably happened when working around git_path's problem with returned buffer being reused. Signed-off-by: Junio C Hamano --- builtin-revert.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builtin-revert.c b/builtin-revert.c index 27881e9493..c41788685b 100644 --- a/builtin-revert.c +++ b/builtin-revert.c @@ -269,7 +269,7 @@ static int revert_or_cherry_pick(int argc, const char **argv) int i; char *oneline, *reencoded_message = NULL; const char *message, *encoding; - const char *defmsg = xstrdup(git_path("MERGE_MSG")); + char *defmsg = xstrdup(git_path("MERGE_MSG")); git_config(git_default_config, NULL); me = action == REVERT ? "revert" : "cherry-pick"; @@ -426,6 +426,7 @@ static int revert_or_cherry_pick(int argc, const char **argv) return execv_git_cmd(args); } free(reencoded_message); + free(defmsg); return 0; } From 9b6f84d2c2ff84ac3ef2215b6ea8ee45b6d943cd Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Thu, 30 Oct 2008 11:45:03 +0100 Subject: [PATCH 05/10] asciidoc: add minor workaround to add an empty line after code blocks Insert an empty in manpages after code blocks to force and empty line. The problem can be seen on the manpage for the git tutorial, where an example command and the following paragraph is printed with no empty line between them: First, note that you can get documentation for a command such as git log --graph with: $ man git-log It is a good idea to introduce yourself to git [...] Signed-off-by: Jonas Fonseca Signed-off-by: Junio C Hamano --- Documentation/asciidoc.conf | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf index 40d43b78ee..2da867d2f8 100644 --- a/Documentation/asciidoc.conf +++ b/Documentation/asciidoc.conf @@ -40,6 +40,26 @@ endif::doctype-manpage[] {title#} endif::docbook-xsl-172[] + +ifdef::docbook-xsl-172[] +ifdef::doctype-manpage[] +# The following two small workarounds insert a simple paragraph after screen +[listingblock] +{title} + +| + +{title#} + +[verseblock] +{title} +{title%} +{title#} +| + +{title#} +endif::doctype-manpage[] +endif::docbook-xsl-172[] endif::backend-docbook[] ifdef::doctype-manpage[] From 0ea9ca07aa76bef80c066b1a70366cf90caa703d Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Thu, 30 Oct 2008 10:00:29 +0100 Subject: [PATCH 06/10] Add --verbose|-v to test-chmtime This allows us replace perl when getting the mtime of a file because of time zone conversions, though at the moment only one platform which does this has been identified: Cygwin when used with ActiveState Perl (as usual). The output format is: TAB TAB ... which, if only mtime is needed can be parsed with cut(1): test-chmtime -v +0 filename1 | cut -f 1 Also, the change adds a description of programs features, with examples. Signed-off-by: Alex Riesen Signed-off-by: Junio C Hamano --- test-chmtime.c | 97 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 73 insertions(+), 24 deletions(-) diff --git a/test-chmtime.c b/test-chmtime.c index 90da448ebe..d5358cbaac 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 = file... + * + * Relative to the current time as returned by time(3): + * + * test-chmtime =+ (or =-) file... + * + * Or relative to the current mtime of the file: + * + * test-chmtime file... + * test-chmtime + (or -) 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 -static const char usage_str[] = "(+|=|=+|=-|-) ..."; +static const char usage_str[] = "-v|--verbose (+|=|=+|=-|-) ..."; + +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 i; - int set_eq; - long int set_time; - char *test; - const char *timespec; + static int verbose; + + int i = 1; + /* no mtime change by default */ + int set_eq = 0; + long int set_time = 0; if (argc < 3) goto usage; - timespec = argv[1]; - set_eq = (*timespec == '=') ? 1 : 0; - if (set_eq) { - timespec++; - if (*timespec == '+') { - set_eq = 2; /* relative "in the future" */ - timespec++; - } + if (strcmp(argv[i], "--verbose") == 0 || strcmp(argv[i], "-v") == 0) { + verbose = 1; + ++i; } - set_time = strtol(timespec, &test, 10); - if (*test) { - fprintf(stderr, "Not a base-10 integer: %s\n", argv[1] + 1); + if (timespec_arg(argv[i], &set_time, &set_eq)) + ++i; + else 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 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; From 111539a3c75c22df7f1bbe242ce2f886b01d2491 Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Thu, 30 Oct 2008 11:20:27 +0100 Subject: [PATCH 07/10] Use test-chmtime -v instead of perl in t5000 to get mtime of a file The test was broken on admittedly broken combination of Windows, Cygwin, and ActiveState Perl. Signed-off-by: Alex Riesen Signed-off-by: Junio C Hamano --- t/t5000-tar-tree.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh index 0f27d73049..c942c8be85 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' From 41d8cf7d7fd79fe1fd00b04052c49bffaedfd309 Mon Sep 17 00:00:00 2001 From: Markus Heidelberg Date: Fri, 31 Oct 2008 01:04:46 +0100 Subject: [PATCH 08/10] bash completion: add doubledash to "git show" Signed-off-by: Markus Heidelberg Signed-off-by: Junio C Hamano --- contrib/completion/git-completion.bash | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 751e273e1a..39a1ce5a39 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -1410,6 +1410,8 @@ _git_shortlog () _git_show () { + __git_has_doubledash && return + local cur="${COMP_WORDS[COMP_CWORD]}" case "$cur" in --pretty=*) From 2c850f1221efd2441c3794e163ea3918ce31c15b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kr=C3=BCger?= Date: Thu, 30 Oct 2008 19:14:33 +0100 Subject: [PATCH 09/10] Documentation: clarify information about 'ident' attribute MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The documentation spoke of the attribute being set "to" a path; this can mistakenly be interpreted as "the attribute needs to have its value set to some kind of path". This clarifies things. Signed-off-by: Jan Krüger Signed-off-by: Junio C Hamano --- Documentation/gitattributes.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt index 53da9b4f6b..42776f089b 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 From e855bfc0404d3344787541c1bdaa1e8d44398eb3 Mon Sep 17 00:00:00 2001 From: Deskin Miller Date: Fri, 31 Oct 2008 00:10:25 -0400 Subject: [PATCH 10/10] git-svn: change dashed git-commit-tree to git commit-tree Signed-off-by: Deskin Miller Signed-off-by: Junio C Hamano --- git-svn.perl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-svn.perl b/git-svn.perl index 2e68c68d49..56238dad08 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -2202,7 +2202,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', $_; }