From 9ecd3ada6dd7fe80109c48c48f30164c066d37ad Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Wed, 30 Mar 2011 01:48:40 -0700 Subject: parse-remote: replace unnecessary sed invocation Just use parameter expansion instead. Signed-off-by: Stephen Boyd Signed-off-by: Junio C Hamano diff --git a/git-parse-remote.sh b/git-parse-remote.sh index 1cc2ba6..d3782d9 100644 --- a/git-parse-remote.sh +++ b/git-parse-remote.sh @@ -55,7 +55,8 @@ get_remote_url () { } get_default_remote () { - curr_branch=$(git symbolic-ref -q HEAD | sed -e 's|^refs/heads/||') + curr_branch=$(git symbolic-ref -q HEAD) + curr_branch="${cur_branch#refs/heads/}" origin=$(git config --get "branch.$curr_branch.remote") echo ${origin:-origin} } -- cgit v0.10.2-6-g49f6 From 2f8ee02c49ea2a8b32c22979a65eb81b859bb883 Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Wed, 30 Mar 2011 02:00:06 -0700 Subject: git-pack-objects.txt: fix grammatical errors Signed-off-by: Stephen Boyd Signed-off-by: Junio C Hamano diff --git a/Documentation/git-pack-objects.txt b/Documentation/git-pack-objects.txt index 65eff66..a9c373c 100644 --- a/Documentation/git-pack-objects.txt +++ b/Documentation/git-pack-objects.txt @@ -190,9 +190,9 @@ self-contained. Use `git index-pack --fix-thin` (see linkgit:git-index-pack[1]) to restore the self-contained property. --delta-base-offset:: - A packed archive can express base object of a delta as - either 20-byte object name or as an offset in the - stream, but older version of git does not understand the + A packed archive can express the base object of a delta as + either a 20-byte object name or as an offset in the + stream, but older versions of git don't understand the latter. By default, 'git pack-objects' only uses the former format for better compatibility. This option allows the command to use the latter format for -- cgit v0.10.2-6-g49f6 From 18b19e443b2a3cf2572c99d0136de81ca7c67bdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Wed, 30 Mar 2011 12:22:32 +0200 Subject: Documentation/config.txt: make truth value of numbers more explicit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change the order to 1/0 to have the same true/false order as the rest of the possibilities for a boolean variable in order not not confuse users. Signed-off-by: Carlos Martín Nieto Signed-off-by: Junio C Hamano diff --git a/Documentation/config.txt b/Documentation/config.txt index 701fba9..1a571f4 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -62,7 +62,7 @@ Internal whitespace within a variable value is retained verbatim. The values following the equals sign in variable assign are all either a string, an integer, or a boolean. Boolean values may be given as yes/no, -0/1, true/false or on/off. Case is not significant in boolean values, when +1/0, true/false or on/off. Case is not significant in boolean values, when converting value to the canonical form using '--bool' type specifier; 'git config' will ensure that the output is "true" or "false". -- cgit v0.10.2-6-g49f6 From 63d329459370b09637d49a430f63d3ecd2bc3f25 Mon Sep 17 00:00:00 2001 From: Michael Witten Date: Tue, 22 Feb 2011 17:15:00 +0000 Subject: Typos: t/README Signed-off-by: Michael Witten Signed-off-by: Junio C Hamano diff --git a/t/README b/t/README index d44a614..6122a6c 100644 --- a/t/README +++ b/t/README @@ -197,7 +197,7 @@ we are testing. If you create files under t/ directory (i.e. here) that is not the top-level test script, never name the file to match the above pattern. The Makefile here considers all such files as the -top-level test script and tries to run all of them. A care is +top-level test script and tries to run all of them. Care is especially needed if you are creating a common test library file, similar to test-lib.sh, because such a library file may not be suitable for standalone execution. @@ -281,9 +281,8 @@ Do: - Check the test coverage for your tests. See the "Test coverage" below. - Don't blindly follow test coverage metrics, they're a good way to - spot if you've missed something. If a new function you added - doesn't have any coverage you're probably doing something wrong, + Don't blindly follow test coverage metrics; if a new function you added + doesn't have any coverage, then you're probably doing something wrong, but having 100% coverage doesn't necessarily mean that you tested everything. @@ -427,7 +426,7 @@ library for your script to use. - test_tick Make commit and tag names consistent by setting the author and - committer times to defined stated. Subsequent calls will + committer times to defined state. Subsequent calls will advance the times by a fixed amount. - test_commit [ []] -- cgit v0.10.2-6-g49f6 From e0390119b249252a633875e4327c8a6463e4b6cb Mon Sep 17 00:00:00 2001 From: Michael Witten Date: Tue, 15 Feb 2011 23:12:04 +0000 Subject: strbuf.h: remove a tad stale docs-in-comment and reference api-doc instead Signed-off-by: Michael Witten Signed-off-by: Junio C Hamano diff --git a/strbuf.h b/strbuf.h index 675a91f..4ce7ded 100644 --- a/strbuf.h +++ b/strbuf.h @@ -1,42 +1,7 @@ #ifndef STRBUF_H #define STRBUF_H -/* - * Strbuf's can be use in many ways: as a byte array, or to store arbitrary - * long, overflow safe strings. - * - * Strbufs has some invariants that are very important to keep in mind: - * - * 1. the ->buf member is always malloc-ed, hence strbuf's can be used to - * build complex strings/buffers whose final size isn't easily known. - * - * It is NOT legal to copy the ->buf pointer away. - * `strbuf_detach' is the operation that detaches a buffer from its shell - * while keeping the shell valid wrt its invariants. - * - * 2. the ->buf member is a byte array that has at least ->len + 1 bytes - * allocated. The extra byte is used to store a '\0', allowing the ->buf - * member to be a valid C-string. Every strbuf function ensures this - * invariant is preserved. - * - * Note that it is OK to "play" with the buffer directly if you work it - * that way: - * - * strbuf_grow(sb, SOME_SIZE); - * ... Here, the memory array starting at sb->buf, and of length - * ... strbuf_avail(sb) is all yours, and you are sure that - * ... strbuf_avail(sb) is at least SOME_SIZE. - * strbuf_setlen(sb, sb->len + SOME_OTHER_SIZE); - * - * Of course, SOME_OTHER_SIZE must be smaller or equal to strbuf_avail(sb). - * - * Doing so is safe, though if it has to be done in many places, adding the - * missing API to the strbuf module is the way to go. - * - * XXX: do _not_ assume that the area that is yours is of size ->alloc - 1 - * even if it's true in the current implementation. Alloc is somehow a - * "private" member that should not be messed with. - */ +/* See Documentation/technical/api-strbuf.txt */ #include -- cgit v0.10.2-6-g49f6 From 4b705f4052432906f0acbb22b25254eb3917e36c Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 30 Mar 2011 12:22:05 -0700 Subject: t8001: check the exit status of the command being tested Avoid running the command being tested as an upstream of a pipe; doing so will lose its exit status. While at it, modernise the style of the script. Signed-off-by: Junio C Hamano diff --git a/t/t8001-annotate.sh b/t/t8001-annotate.sh index 45cb60e..41962f0 100755 --- a/t/t8001-annotate.sh +++ b/t/t8001-annotate.sh @@ -6,10 +6,11 @@ test_description='git annotate' PROG='git annotate' . "$TEST_DIRECTORY"/annotate-tests.sh -test_expect_success \ - 'Annotating an old revision works' \ - '[ $(git annotate file master | awk "{print \$3}" | grep -c "^A$") -eq 2 ] && \ - [ $(git annotate file master | awk "{print \$3}" | grep -c "^B$") -eq 2 ]' - +test_expect_success 'Annotating an old revision works' ' + git annotate file master >result && + awk "{ print \$3; }" authors && + test 2 = $(grep A Date: Wed, 30 Mar 2011 09:52:23 +0100 Subject: contrib/thunderbird-patch-inline: do not require bash to run the script The script does not have to be run under bash, but any POSIX compliant shell would do, as it does not use any bash-isms. It may be written under a different style than what is recommended in Documentation/CodingGuidelines, but that is a different matter. While at it, fix obvious typos in the comment. Signed-off-by: Maxin B. John Signed-off-by: Junio C Hamano diff --git a/contrib/thunderbird-patch-inline/appp.sh b/contrib/thunderbird-patch-inline/appp.sh index cc518f3..5eb4a51 100755 --- a/contrib/thunderbird-patch-inline/appp.sh +++ b/contrib/thunderbird-patch-inline/appp.sh @@ -1,8 +1,8 @@ -#!/bin/bash +#!/bin/sh # Copyright 2008 Lukas Sandström # # AppendPatch - A script to be used together with ExternalEditor -# for Mozilla Thunderbird to properly include pathes inline i e-mails. +# for Mozilla Thunderbird to properly include patches inline in e-mails. # ExternalEditor can be downloaded at http://globs.org/articles.php?lng=en&pg=2 -- cgit v0.10.2-6-g49f6