From bf7cbb2f043e4a989dacebe381841bcdbd75588b Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 8 Feb 2010 12:12:41 -0800 Subject: git-add documentation: Fix shell quoting example When 921177f (Documentation: improve "add", "pull" and "format-patch" examples, 2008-05-07) converted this from enumeration header to displayed text, it failed to adjust for the AsciiDoc's rule to quote backslashes. In displayed text, backslash is shown verbatim, while in enumeration header, we need to double it. We have a similar construct in git-rm.txt documentation, and need to be careful when somebody wants to update it to match the style of the "git add" example. Noticed by: Greg Bacon Signed-off-by: Junio C Hamano diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt index 2eabbc8..f14319a 100644 --- a/Documentation/git-add.txt +++ b/Documentation/git-add.txt @@ -103,7 +103,7 @@ EXAMPLES and its subdirectories: + ------------ -$ git add Documentation/\\*.txt +$ git add Documentation/\*.txt ------------ + Note that the asterisk `\*` is quoted from the shell in this -- cgit v0.10.2-6-g49f6 From ace706e2a6213d4252b6862786dd93c71bcbd69f Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 6 Feb 2010 11:26:35 -0800 Subject: Fix parsing of imap.preformattedHTML and imap.sslverify These two variables are boolean and can lack "= value" in the configuration file. Do not reject such input early in the parser callback function. Also the key are downcased before being given to the callback, so we should run strcmp() with keyword spelled in all-lowercase. Signed-off-by: Junio C Hamano diff --git a/imap-send.c b/imap-send.c index cb518eb..77acd68 100644 --- a/imap-send.c +++ b/imap-send.c @@ -1399,11 +1399,16 @@ static int git_imap_config(const char *key, const char *val, void *cb) if (strncmp(key, imap_key, sizeof imap_key - 1)) return 0; - if (!val) - return config_error_nonbool(key); - key += sizeof imap_key - 1; + /* check booleans first, and barf on others */ + if (!strcmp("sslverify", key)) + server.ssl_verify = git_config_bool(key, val); + else if (!strcmp("preformattedhtml", key)) + server.use_html = git_config_bool(key, val); + else if (!val) + return config_error_nonbool(key); + if (!strcmp("folder", key)) { imap_folder = xstrdup(val); } else if (!strcmp("host", key)) { @@ -1424,10 +1429,6 @@ static int git_imap_config(const char *key, const char *val, void *cb) server.port = git_config_int(key, val); else if (!strcmp("tunnel", key)) server.tunnel = xstrdup(val); - else if (!strcmp("sslverify", key)) - server.ssl_verify = git_config_bool(key, val); - else if (!strcmp("preformattedHTML", key)) - server.use_html = git_config_bool(key, val); return 0; } -- cgit v0.10.2-6-g49f6 From b7047abc1213719c225a481f9618ca5a250e6fe9 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 8 Feb 2010 16:45:21 -0800 Subject: git-push: document all the status flags used in the output We didn't talk about '-' (deletion), '*' (addition), nor '+' (forced). Signed-off-by: Junio C Hamano diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt index 2653388..5d21ca8 100644 --- a/Documentation/git-push.txt +++ b/Documentation/git-push.txt @@ -159,12 +159,17 @@ If --porcelain is used, then each line of the output is of the form: \t : \t () ------------------------------- +The status of up-to-date refs is shown only if --porcelain or --verbose +option is used. + flag:: - A single character indicating the status of the ref. This is - blank for a successfully pushed ref, `!` for a ref that was - rejected or failed to push, and '=' for a ref that was up to - date and did not need pushing (note that the status of up to - date refs is shown only when `git push` is running verbosely). + A single character indicating the status of the ref: +(space);; for a successfully pushed fast-forward; +`{plus}`;; for a successful forced update; +`-`;; for a successfully deleted ref; +`*`;; for a successfully pushed new ref; +`!`;; for a ref that was rejected or failed to push; and +`=`;; for a ref that was up to date and did not need pushing. summary:: For a successfully pushed ref, the summary shows the old and new -- cgit v0.10.2-6-g49f6 From 92f9e273e86d505e4c2a28bc053eb514ca2cc552 Mon Sep 17 00:00:00 2001 From: Jay Soffian Date: Mon, 8 Feb 2010 22:48:13 -0500 Subject: blame: prevent a segv when -L given start > EOF blame would segv if given -L with past the end of the file. While we're fixing the bug, add test cases for an invalid when called as -L , or -L. Signed-off-by: Jay Soffian Signed-off-by: Junio C Hamano diff --git a/builtin-blame.c b/builtin-blame.c index 98e818c..4094f3c 100644 --- a/builtin-blame.c +++ b/builtin-blame.c @@ -2432,7 +2432,7 @@ parse_done: if (top < 1) top = lno; bottom--; - if (lno < top) + if (lno < top || lno < bottom) die("file %s has only %lu lines", path, lno); ent = xcalloc(1, sizeof(*ent)); diff --git a/t/t8003-blame.sh b/t/t8003-blame.sh index ad834f2..4a8db74 100755 --- a/t/t8003-blame.sh +++ b/t/t8003-blame.sh @@ -157,4 +157,12 @@ EOF git --no-pager blame $COMMIT -- uno >/dev/null ' +test_expect_success 'blame -L with invalid start' ' + test_must_fail git blame -L5 tres 2>&1 | grep "has only 2 lines" +' + +test_expect_success 'blame -L with invalid end' ' + git blame -L1,5 tres 2>&1 | grep "has only 2 lines" +' + test_done -- cgit v0.10.2-6-g49f6