# [PATCH 1/2] fix typo in Documentation

8 messages from 2009-02-04 to 2009-02-06. Participants: Guanqun Lu, Sverre Rabbelier, Junio C Hamano, Jakub Narebski, Mikael Magnusson.
Thread: https://gitlist.dev/t/17546

## Sverre Rabbelier, 2009-02-04 05:30

Subject: Re: [PATCH 1/2] fix typo in Documentation
Message-ID: <bd6139dc0902032130k47551f1cle52ae286bd539e5d@mail.gmail.com>
URL: https://gitlist.dev/e/bd6139dc0902032130k47551f1cle52ae286bd539e5d%40mail.gmail.com
In-Reply-To: <1233781241-721-1-git-send-email-guanqun.lu@gmail.com>

```
Heya,

On Wed, Feb 4, 2009 at 22:00, Guanqun Lu <guanqun.lu@gmail.com> wrote:
> -However, it it totally safe to modify anything in the string pointed by
> +However, it is totally safe to modify anything in the string pointed by

To prevent someone else from staring at this for a minute, "it it" was
replaced by "it is".

-- 
Cheers,

Sverre Rabbelier

```

## Junio C Hamano, 2009-02-04 07:46

Subject: Re: [PATCH 2/2] add test-dump-cache-tree in Makefile
Message-ID: <7veiye4pap.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7veiye4pap.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <1233781241-721-2-git-send-email-guanqun.lu@gmail.com>

```
Thanks; both patches look good.

```

## Jakub Narebski, 2009-02-04 09:26

Subject: Re: [PATCH 1/2] fix typo in Documentation
Message-ID: <m38womwo2b.fsf@localhost.localdomain>
URL: https://gitlist.dev/e/m38womwo2b.fsf%40localhost.localdomain
In-Reply-To: <1233781241-721-1-git-send-email-guanqun.lu@gmail.com>

```
Guanqun Lu <guanqun.lu@gmail.com> writes:

> Signed-off-by: Guanqun Lu <guanqun.lu@gmail.com>
> ---
>  Documentation/technical/api-strbuf.txt |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Minor nit: I would add _where_ did you fix typy, i.e. instead of just
  fix typo in Documentation
I'd use
  fix typo in strbuf API documentation

-- 
Jakub Narebski
Poland
ShadeHawk on #git

```

## Jakub Narebski, 2009-02-04 09:31

Subject: Re: [PATCH 2/2] add test-dump-cache-tree in Makefile
Message-ID: <m34ozawnte.fsf@localhost.localdomain>
URL: https://gitlist.dev/e/m34ozawnte.fsf%40localhost.localdomain
In-Reply-To: <1233781241-721-2-git-send-email-guanqun.lu@gmail.com>

```
Guanqun Lu <guanqun.lu@gmail.com> writes:

>  dump-cache-tree.c      |   64 ------------------------------------------------
>  test-dump-cache-tree.c |   64 ++++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 65 insertions(+), 64 deletions(-)
>  delete mode 100644 dump-cache-tree.c
>  create mode 100644 test-dump-cache-tree.c

> diff --git a/dump-cache-tree.c b/dump-cache-tree.c
> deleted file mode 100644
> index 1f73f1e..0000000

> diff --git a/test-dump-cache-tree.c b/test-dump-cache-tree.c
> new file mode 100644
> index 0000000..1f73f1e

Minor nit: it would be better to use git-format-patch with '-M' option
(detect renames) here.  It would result in shorter and more readable
patch:

 dump-cache-tree.c => test-dump-cache-tree.c |  0
 3 files changed, 1 insertions(+), 0 deletions(-)
 rename dump-cache-tree.c => test-dump-cache-tree.c (100%)

diff --git a/dump-cache-tree.c b/test-dump-cache-tree.c
similarity index 100%
rename from dump-cache-tree.c
rename to test-dump-cache-tree.c

Or something like that...
-- 
Jakub Narebski
Poland
ShadeHawk on #git

```

## Guanqun Lu, 2009-02-04 21:00

Subject: [PATCH 1/2] fix typo in Documentation
Message-ID: <1233781241-721-1-git-send-email-guanqun.lu@gmail.com>
URL: https://gitlist.dev/e/1233781241-721-1-git-send-email-guanqun.lu%40gmail.com

```
Signed-off-by: Guanqun Lu <guanqun.lu@gmail.com>
---
 Documentation/technical/api-strbuf.txt |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Documentation/technical/api-strbuf.txt b/Documentation/technical/api-strbuf.txt
index 9a4e3ea..ac56d1c 100644
--- a/Documentation/technical/api-strbuf.txt
+++ b/Documentation/technical/api-strbuf.txt
@@ -21,7 +21,7 @@ allocated memory or not), use `strbuf_detach()` to unwrap a memory
 buffer from its strbuf shell in a safe way. That is the sole supported
 way. This will give you a malloced buffer that you can later `free()`.
 +
-However, it it totally safe to modify anything in the string pointed by
+However, it is totally safe to modify anything in the string pointed by
 the `buf` member, between the indices `0` and `len-1` (inclusive).
 
 . The `buf` member is a byte array that has at least `len + 1` bytes
-- 
1.6.1.2.321.g4a9f7

```

## Guanqun Lu, 2009-02-04 21:00

Subject: [PATCH 2/2] add test-dump-cache-tree in Makefile
Message-ID: <1233781241-721-2-git-send-email-guanqun.lu@gmail.com>
URL: https://gitlist.dev/e/1233781241-721-2-git-send-email-guanqun.lu%40gmail.com
In-Reply-To: <1233781241-721-1-git-send-email-guanqun.lu@gmail.com>

```
5c5ba73b21a6910ee67d97cb87a5d78409112375 tries to use
generic rule to build test programs, but it misses the file
'dump-cache-tree.c', since its name is not prefixed by 'test-'.
This commit solves this little problem by renaming this file
instead of carrying out an explicit rule in Makefile.

Signed-off-by: Guanqun Lu <guanqun.lu@gmail.com>
---
 Makefile               |    1 +
 dump-cache-tree.c      |   64 ------------------------------------------------
 test-dump-cache-tree.c |   64 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 65 insertions(+), 64 deletions(-)
 delete mode 100644 dump-cache-tree.c
 create mode 100644 test-dump-cache-tree.c

diff --git a/Makefile b/Makefile
index 9f3a8ab..b90ff39 100644
--- a/Makefile
+++ b/Makefile
@@ -1388,6 +1388,7 @@ TEST_PROGRAMS += test-parse-options$X
 TEST_PROGRAMS += test-path-utils$X
 TEST_PROGRAMS += test-sha1$X
 TEST_PROGRAMS += test-sigchain$X
+TEST_PROGRAMS += test-dump-cache-tree$X
 
 all:: $(TEST_PROGRAMS)
 
diff --git a/dump-cache-tree.c b/dump-cache-tree.c
deleted file mode 100644
index 1f73f1e..0000000
--- a/dump-cache-tree.c
+++ /dev/null
@@ -1,64 +0,0 @@
-#include "cache.h"
-#include "tree.h"
-#include "cache-tree.h"
-
-
-static void dump_one(struct cache_tree *it, const char *pfx, const char *x)
-{
-	if (it->entry_count < 0)
-		printf("%-40s %s%s (%d subtrees)\n",
-		       "invalid", x, pfx, it->subtree_nr);
-	else
-		printf("%s %s%s (%d entries, %d subtrees)\n",
-		       sha1_to_hex(it->sha1), x, pfx,
-		       it->entry_count, it->subtree_nr);
-}
-
-static int dump_cache_tree(struct cache_tree *it,
-			   struct cache_tree *ref,
-			   const char *pfx)
-{
-	int i;
-	int errs = 0;
-
-	if (!it || !ref)
-		/* missing in either */
-		return 0;
-
-	if (it->entry_count < 0) {
-		dump_one(it, pfx, "");
-		dump_one(ref, pfx, "#(ref) ");
-		if (it->subtree_nr != ref->subtree_nr)
-			errs = 1;
-	}
-	else {
-		dump_one(it, pfx, "");
-		if (hashcmp(it->sha1, ref->sha1) ||
-		    ref->entry_count != it->entry_count ||
-		    ref->subtree_nr != it->subtree_nr) {
-			dump_one(ref, pfx, "#(ref) ");
-			errs = 1;
-		}
-	}
-
-	for (i = 0; i < it->subtree_nr; i++) {
-		char path[PATH_MAX];
-		struct cache_tree_sub *down = it->down[i];
-		struct cache_tree_sub *rdwn;
-
-		rdwn = cache_tree_sub(ref, down->name);
-		sprintf(path, "%s%.*s/", pfx, down->namelen, down->name);
-		if (dump_cache_tree(down->cache_tree, rdwn->cache_tree, path))
-			errs = 1;
-	}
-	return errs;
-}
-
-int main(int ac, char **av)
-{
-	struct cache_tree *another = cache_tree();
-	if (read_cache() < 0)
-		die("unable to read index file");
-	cache_tree_update(another, active_cache, active_nr, 0, 1);
-	return dump_cache_tree(active_cache_tree, another, "");
-}
diff --git a/test-dump-cache-tree.c b/test-dump-cache-tree.c
new file mode 100644
index 0000000..1f73f1e
--- /dev/null
+++ b/test-dump-cache-tree.c
@@ -0,0 +1,64 @@
+#include "cache.h"
+#include "tree.h"
+#include "cache-tree.h"
+
+
+static void dump_one(struct cache_tree *it, const char *pfx, const char *x)
+{
+	if (it->entry_count < 0)
+		printf("%-40s %s%s (%d subtrees)\n",
+		       "invalid", x, pfx, it->subtree_nr);
+	else
+		printf("%s %s%s (%d entries, %d subtrees)\n",
+		       sha1_to_hex(it->sha1), x, pfx,
+		       it->entry_count, it->subtree_nr);
+}
+
+static int dump_cache_tree(struct cache_tree *it,
+			   struct cache_tree *ref,
+			   const char *pfx)
+{
+	int i;
+	int errs = 0;
+
+	if (!it || !ref)
+		/* missing in either */
+		return 0;
+
+	if (it->entry_count < 0) {
+		dump_one(it, pfx, "");
+		dump_one(ref, pfx, "#(ref) ");
+		if (it->subtree_nr != ref->subtree_nr)
+			errs = 1;
+	}
+	else {
+		dump_one(it, pfx, "");
+		if (hashcmp(it->sha1, ref->sha1) ||
+		    ref->entry_count != it->entry_count ||
+		    ref->subtree_nr != it->subtree_nr) {
+			dump_one(ref, pfx, "#(ref) ");
+			errs = 1;
+		}
+	}
+
+	for (i = 0; i < it->subtree_nr; i++) {
+		char path[PATH_MAX];
+		struct cache_tree_sub *down = it->down[i];
+		struct cache_tree_sub *rdwn;
+
+		rdwn = cache_tree_sub(ref, down->name);
+		sprintf(path, "%s%.*s/", pfx, down->namelen, down->name);
+		if (dump_cache_tree(down->cache_tree, rdwn->cache_tree, path))
+			errs = 1;
+	}
+	return errs;
+}
+
+int main(int ac, char **av)
+{
+	struct cache_tree *another = cache_tree();
+	if (read_cache() < 0)
+		die("unable to read index file");
+	cache_tree_update(another, active_cache, active_nr, 0, 1);
+	return dump_cache_tree(active_cache_tree, another, "");
+}
-- 
1.6.1.2.321.g4a9f7

```

## Guanqun Lu, 2009-02-05 06:27

Subject: Re: [PATCH 1/2] fix typo in Documentation
Message-ID: <e57070790902042227r2d571b94h9b3a997d826a80d2@mail.gmail.com>
URL: https://gitlist.dev/e/e57070790902042227r2d571b94h9b3a997d826a80d2%40mail.gmail.com
In-Reply-To: <m38womwo2b.fsf@localhost.localdomain>

```
On Wed, Feb 4, 2009 at 5:26 PM, Jakub Narebski <jnareb@gmail.com> wrote:
> Guanqun Lu <guanqun.lu@gmail.com> writes:
>
>> Signed-off-by: Guanqun Lu <guanqun.lu@gmail.com>
>> ---
>>  Documentation/technical/api-strbuf.txt |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> Minor nit: I would add _where_ did you fix typy, i.e. instead of just
>  fix typo in Documentation
> I'd use
>  fix typo in strbuf API documentation

OK. I'll keep an eye next time. And thanks for your advice.

>
> --
> Jakub Narebski
> Poland
> ShadeHawk on #git
>



-- 
Guanqun

```

## Mikael Magnusson, 2009-02-06 13:43

Subject: Re: [PATCH 1/2] fix typo in Documentation
Message-ID: <237967ef0902060543q2cc13d99l852c8427fb66402b@mail.gmail.com>
URL: https://gitlist.dev/e/237967ef0902060543q2cc13d99l852c8427fb66402b%40mail.gmail.com
In-Reply-To: <1233781241-721-1-git-send-email-guanqun.lu@gmail.com>

```
2009/2/4 Guanqun Lu <guanqun.lu@gmail.com>:
> Signed-off-by: Guanqun Lu <guanqun.lu@gmail.com>
> ---
>  Documentation/technical/api-strbuf.txt |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/Documentation/technical/api-strbuf.txt b/Documentation/technical/api-strbuf.txt
> index 9a4e3ea..ac56d1c 100644
> --- a/Documentation/technical/api-strbuf.txt
> +++ b/Documentation/technical/api-strbuf.txt
> @@ -21,7 +21,7 @@ allocated memory or not), use `strbuf_detach()` to unwrap a memory
>  buffer from its strbuf shell in a safe way. That is the sole supported
>  way. This will give you a malloced buffer that you can later `free()`.
>  +
> -However, it it totally safe to modify anything in the string pointed by
> +However, it is totally safe to modify anything in the string pointed by
>  the `buf` member, between the indices `0` and `len-1` (inclusive).
>
>  . The `buf` member is a byte array that has at least `len + 1` bytes

Shouldn't that be "the string pointed >>at<< by" too?

-- 
Mikael Magnusson

```
