From 6c69207c73aaf63c13105d526453d0bd75f12f34 Mon Sep 17 00:00:00 2001 From: Stephan Beyer Date: Fri, 18 Jul 2008 01:53:55 +0200 Subject: api-run-command.txt: typofix Replace "run_command_v_opt_dir" by "run_command_v_opt_cd". Signed-off-by: Stephan Beyer Signed-off-by: Junio C Hamano diff --git a/Documentation/technical/api-run-command.txt b/Documentation/technical/api-run-command.txt index 3e1342a..75aa5d4 100644 --- a/Documentation/technical/api-run-command.txt +++ b/Documentation/technical/api-run-command.txt @@ -30,7 +30,7 @@ Functions start_command() followed by finish_command(). Takes a pointer to a `struct child_process` that specifies the details. -`run_command_v_opt`, `run_command_v_opt_dir`, `run_command_v_opt_cd_env`:: +`run_command_v_opt`, `run_command_v_opt_cd`, `run_command_v_opt_cd_env`:: Convenience functions that encapsulate a sequence of start_command() followed by finish_command(). The argument argv -- cgit v0.10.2-6-g49f6 From d85fe389594dc1b6f64c0aae7146a6d92399c3a9 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 17 Jul 2008 22:39:09 -0700 Subject: rev-list: honor --quiet option Nick Andrew noticed that rev-list lets --quiet option to be parsed by underlying diff_options parser but did not pick up the result. This resulted in --quiet option to become effectively a no-op. Signed-off-by: Junio C Hamano diff --git a/builtin-rev-list.c b/builtin-rev-list.c index 83a7b134..39ec61c 100644 --- a/builtin-rev-list.c +++ b/builtin-rev-list.c @@ -597,6 +597,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix) revs.commit_format = CMIT_FMT_UNSPECIFIED; argc = setup_revisions(argc, argv, &revs, NULL); + quiet = DIFF_OPT_TST(&revs.diffopt, QUIET); for (i = 1 ; i < argc; i++) { const char *arg = argv[i]; @@ -628,10 +629,6 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix) read_revisions_from_stdin(&revs); continue; } - if (!strcmp(arg, "--quiet")) { - quiet = 1; - continue; - } usage(rev_list_usage); } -- cgit v0.10.2-6-g49f6 From a70c232e0fcb1a72cec024def0f8b1377f15daf4 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 18 Jul 2008 00:11:40 -0700 Subject: http-fetch: do not SEGV after fetching a bad pack idx file Signed-off-by: Junio C Hamano diff --git a/http-walker.c b/http-walker.c index 99f397e..7403306 100644 --- a/http-walker.c +++ b/http-walker.c @@ -442,6 +442,8 @@ static int setup_index(struct walker *walker, struct alt_base *repo, unsigned ch return -1; new_pack = parse_pack_index(sha1); + if (!new_pack) + return -1; /* parse_pack_index() already issued error message */ new_pack->next = repo->packs; repo->packs = new_pack; return 0; -- cgit v0.10.2-6-g49f6 From 4d2646727997c82c04a82ce38e56d76e7b5d268b Mon Sep 17 00:00:00 2001 From: Olivier Marin Date: Sat, 19 Jul 2008 18:24:46 +0200 Subject: builtin-rm: fix index lock file path When hold_locked_index() is called with a relative git_dir and you are outside the work tree, the lock file become relative to the current directory. So when later setup_work_tree() change the current directory it breaks lock file path and commit_locked_index() fails. This patch move index locking code after setup_work_tree() call to make lock file relative to the working tree as it should be and add a test case. Noticed by Nick Andrew. Signed-off-by: Olivier Marin Signed-off-by: Junio C Hamano diff --git a/builtin-rm.c b/builtin-rm.c index 22c9bd1..abdab7f 100644 --- a/builtin-rm.c +++ b/builtin-rm.c @@ -146,11 +146,6 @@ int cmd_rm(int argc, const char **argv, const char *prefix) git_config(git_default_config, NULL); - newfd = hold_locked_index(&lock_file, 1); - - if (read_cache() < 0) - die("index file corrupt"); - argc = parse_options(argc, argv, builtin_rm_options, builtin_rm_usage, 0); if (!argc) usage_with_options(builtin_rm_usage, builtin_rm_options); @@ -158,6 +153,11 @@ int cmd_rm(int argc, const char **argv, const char *prefix) if (!index_only) setup_work_tree(); + newfd = hold_locked_index(&lock_file, 1); + + if (read_cache() < 0) + die("index file corrupt"); + pathspec = get_pathspec(prefix, argv); seen = NULL; for (i = 0; pathspec[i] ; i++) diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh index f542f0a..7893d8c 100755 --- a/t/t3600-rm.sh +++ b/t/t3600-rm.sh @@ -217,4 +217,16 @@ test_expect_success 'Remove nonexistent file returns nonzero exit status' ' ! git rm nonexistent ' +test_expect_success 'Call "rm" from outside the work tree' ' + mkdir repo && + cd repo && + git init && + echo something > somefile && + git add somefile && + git commit -m "add a file" && + (cd .. && + git --git-dir=repo/.git --work-tree=repo rm somefile) && + test_must_fail git ls-files --error-unmatch somefile +' + test_done -- cgit v0.10.2-6-g49f6 From a1b6fb04b1c1b581dfac5c13641af8b3ae44810f Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 19 Jul 2008 10:58:01 -0700 Subject: GIT 1.5.6.4 Signed-off-by: Junio C Hamano diff --git a/Documentation/RelNotes-1.5.6.4.txt b/Documentation/RelNotes-1.5.6.4.txt index 1304188..d8968f1 100644 --- a/Documentation/RelNotes-1.5.6.4.txt +++ b/Documentation/RelNotes-1.5.6.4.txt @@ -28,16 +28,20 @@ Fixes since v1.5.6.3 be huge by saying "no common commits", but this was an unnecessary noise; it is already known by the user anyway. +* "git-http-fetch" would have segfaulted when pack idx file retrieved + from the other side was corrupt. + +* "git-index-pack" used too much memory when dealing with a deep delta chain. + * "git-mailinfo" (hence "git-am") did not correctly handle in-body [PATCH] line to override the commit title taken from the mail Subject header. * "git-rebase -i -p" lost parents that are not involved in the history being rewritten. -Contains other various documentation fixes. +* "git-rm" lost track of where the index file was when GIT_DIR was + specified as a relative path. --- -exec >/var/tmp/1 -echo O=$(git describe maint) -O=v1.5.6.3-21-gebcce31 -git shortlog --no-merges $O..maint +* "git-rev-list --quiet" was not quiet as advertised. + +Contains other various documentation fixes. -- cgit v0.10.2-6-g49f6