From 2b77029f4ad556b82cdbadf59ae13d41e23b6e7c Mon Sep 17 00:00:00 2001 From: Michael Haggerty Date: Mon, 11 Jan 2010 16:56:45 +0100 Subject: rebase--interactive: Ignore comments and blank lines in peek_next_command Previously, blank lines and/or comments within a series of squash/fixup commands would confuse "git rebase -i" into thinking that the series was finished. It would therefore require the user to edit the commit message for the squash/fixup commits seen so far. Then, after continuing, it would ask the user to edit the commit message again. Ignore comments and blank lines within a group of squash/fixup commands, allowing them to be processed in one go. Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index d529328..6ed57e2 100755 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -322,7 +322,7 @@ make_squash_message () { } peek_next_command () { - sed -n "1s/ .*$//p" < "$TODO" + sed -n -e "/^#/d" -e "/^$/d" -e "s/ .*//p" -e "q" < "$TODO" } do_next () { -- cgit v0.10.2-6-g49f6 From fbb9971aca1fef66e622d64418121f6077f05c57 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 12 Jan 2010 00:22:23 -0800 Subject: grep: -L should show empty files The -L (--files-without-match) option is supposed to show paths that produced no matches. When running the internal grep on work tree files, however, we had an optimization to just return on zero-sized files, without doing anything. This optimization doesn't matter too much in practice (a tracked empty file must be rare, or there is something wrong with your project); to produce results consistent with GNU grep, we should stop the optimization and show empty files as not having the given pattern. Signed-off-by: Junio C Hamano diff --git a/builtin-grep.c b/builtin-grep.c index a5b6719..af6c6fe 100644 --- a/builtin-grep.c +++ b/builtin-grep.c @@ -191,8 +191,6 @@ static int grep_file(struct grep_opt *opt, const char *filename) error("'%s': %s", filename, strerror(errno)); return 0; } - if (!st.st_size) - return 0; /* empty file -- no grep hit */ if (!S_ISREG(st.st_mode)) return 0; sz = xsize_t(st.st_size); -- cgit v0.10.2-6-g49f6 From 8efa5f629efb9a8af48619ee90dee02343e0f19d Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Tue, 12 Jan 2010 09:54:04 -0800 Subject: remote-curl: Fix Accept header for smart HTTP connections We actually expect to see an application/x-git-upload-pack-result but we lied and said we Accept *-response. This was a typo on my part when I was writing the code. Fortunately the wrong Accept header had no real impact, as the deployed git-http-backend servers were not testing the Accept header before they returned their content. Signed-off-by: Shawn O. Pearce Signed-off-by: Junio C Hamano diff --git a/remote-curl.c b/remote-curl.c index a331bae..8f169dd 100644 --- a/remote-curl.c +++ b/remote-curl.c @@ -480,7 +480,7 @@ static int rpc_service(struct rpc_state *rpc, struct discovery *heads) strbuf_addf(&buf, "Content-Type: application/x-%s-request", svc); rpc->hdr_content_type = strbuf_detach(&buf, NULL); - strbuf_addf(&buf, "Accept: application/x-%s-response", svc); + strbuf_addf(&buf, "Accept: application/x-%s-result", svc); rpc->hdr_accept = strbuf_detach(&buf, NULL); while (!err) { diff --git a/t/t5551-http-fetch.sh b/t/t5551-http-fetch.sh index c0505ec..7faa31a 100755 --- a/t/t5551-http-fetch.sh +++ b/t/t5551-http-fetch.sh @@ -38,7 +38,7 @@ cat >exp < POST /smart/repo.git/git-upload-pack HTTP/1.1 > Accept-Encoding: deflate, gzip > Content-Type: application/x-git-upload-pack-request -> Accept: application/x-git-upload-pack-response +> Accept: application/x-git-upload-pack-result > Content-Length: xxx < HTTP/1.1 200 OK < Pragma: no-cache -- cgit v0.10.2-6-g49f6