Merge branch 'maint'
authorJunio C Hamano <gitster@pobox.com>
Wed, 30 Mar 2011 21:10:41 +0000 (14:10 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 30 Mar 2011 21:10:41 +0000 (14:10 -0700)
* maint:
contrib/thunderbird-patch-inline: do not require bash to run the script
t8001: check the exit status of the command being tested
strbuf.h: remove a tad stale docs-in-comment and reference api-doc instead
Typos: t/README
Documentation/config.txt: make truth value of numbers more explicit
git-pack-objects.txt: fix grammatical errors
parse-remote: replace unnecessary sed invocation

1  2 
Documentation/config.txt
Documentation/git-pack-objects.txt
git-parse-remote.sh
strbuf.h
t/README
diff --combined Documentation/config.txt
index 8ea55d46add1da6d1e810cb126a7ecc5ce456650,1a571f41742af09f52cc31462f501521aacd00d9..52ffbf4efb8d17c22893112208c5864d4c19741d
@@@ -62,7 -62,7 +62,7 @@@ Internal whitespace within a variable v
  
  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".
  
@@@ -558,12 -558,6 +558,12 @@@ core.sparseCheckout:
        Enable "sparse checkout" feature. See section "Sparse checkout" in
        linkgit:git-read-tree[1] for more information.
  
 +core.abbrev::
 +      Set the length object names are abbreviated to.  If unspecified,
 +      many commands abbreviate to 7 hexdigits, which may not be enough
 +      for abbreviated object names to stay unique for sufficiently long
 +      time.
 +
  add.ignore-errors::
  add.ignoreErrors::
        Tells 'git add' to continue adding files when some files cannot be
index a51071e5247f3a6c525b93384ec0ffc1a12eb8d2,a9c373c7b514fd01064dbf05557ddbfc04b3c1ee..442018bcb8f14dbb7572ad87a3c1adb588444278
@@@ -190,9 -190,9 +190,9 @@@ self-contained. Use `git index-pack --f
  (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 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
        With this option, parents that are hidden by grafts are packed
        nevertheless.
  
 -
 -Author
 -------
 -Written by Linus Torvalds <torvalds@osdl.org>
 -
 -Documentation
 --------------
 -Documentation by Junio C Hamano
 -
  SEE ALSO
  --------
  linkgit:git-rev-list[1]
diff --combined git-parse-remote.sh
index e7013f7ba72a64ab24b991846755b6d6c068b37a,d3782d9559af8a0b99262d37f99b6035bd69e320..91688792a2eb28d6f6a84fae81f1ae390bd49b45
@@@ -4,8 -4,59 +4,9 @@@
  # this would fail in that case and would issue an error message.
  GIT_DIR=$(git rev-parse -q --git-dir) || :;
  
 -get_data_source () {
 -      case "$1" in
 -      */*)
 -              echo ''
 -              ;;
 -      .)
 -              echo self
 -              ;;
 -      *)
 -              if test "$(git config --get "remote.$1.url")"
 -              then
 -                      echo config
 -              elif test -f "$GIT_DIR/remotes/$1"
 -              then
 -                      echo remotes
 -              elif test -f "$GIT_DIR/branches/$1"
 -              then
 -                      echo branches
 -              else
 -                      echo ''
 -              fi ;;
 -      esac
 -}
 -
 -get_remote_url () {
 -      data_source=$(get_data_source "$1")
 -      case "$data_source" in
 -      '')
 -              echo "$1"
 -              ;;
 -      self)
 -              echo "$1"
 -              ;;
 -      config)
 -              git config --get "remote.$1.url"
 -              ;;
 -      remotes)
 -              sed -ne '/^URL: */{
 -                      s///p
 -                      q
 -              }' "$GIT_DIR/remotes/$1"
 -              ;;
 -      branches)
 -              sed -e 's/#.*//' "$GIT_DIR/branches/$1"
 -              ;;
 -      *)
 -              die "internal error: get-remote-url $1" ;;
 -      esac
 -}
 -
  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}
  }
diff --combined strbuf.h
index f722331470065f448197ea461ef3af06d3623ff2,4ce7dedee07efced23c1214de71e0687d7cb297a..07060ce893d8303b7eb4d78db0f7a5575527f88f
+++ b/strbuf.h
@@@ -1,42 -1,7 +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 <assert.h>
  
@@@ -120,8 -85,6 +85,8 @@@ extern void strbuf_addbuf_percentquote(
  
  __attribute__((format (printf,2,3)))
  extern void strbuf_addf(struct strbuf *sb, const char *fmt, ...);
 +__attribute__((format (printf,2,0)))
 +extern void strbuf_vaddf(struct strbuf *sb, const char *fmt, va_list ap);
  
  extern size_t strbuf_fread(struct strbuf *, size_t, FILE *);
  /* XXX: if read fails, any partial read is undone */
diff --combined t/README
index ccf6a53377804153f7a516031d5bab4ef6da4016,6122a6c73352e6986bc8f97fc803105dcd671c25..428ee05c4a5b844815ff4f9356b71bb147cb42a6
+++ b/t/README
@@@ -79,10 -79,6 +79,10 @@@ appropriately before running "make"
  --debug::
        This may help the person who is developing a new test.
        It causes the command defined with test_debug to run.
 +      The "trash" directory (used to store all temporary data
 +      during testing) is not deleted even if there are no
 +      failed tests so that you can inspect its contents after
 +      the test finished.
  
  --immediate::
        This causes the test to immediately exit upon the first
@@@ -201,7 -197,7 +201,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.
@@@ -285,9 -281,8 +285,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.
  
@@@ -431,7 -426,7 +430,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 <message> [<filename> [<contents>]]