{"thread":{"id":"17546","subject":"[PATCH 1/2] fix typo in Documentation","startedAt":"2009-02-04T05:30:11Z","lastAt":"2009-02-06T13:43:58Z","messageCount":8,"participants":["Guanqun Lu","Sverre Rabbelier","Junio C Hamano","Jakub Narebski","Mikael Magnusson"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"103068","messageId":"bd6139dc0902032130k47551f1cle52ae286bd539e5d@mail.gmail.com","threadId":"17546","inReplyTo":"1233781241-721-1-git-send-email-guanqun.lu@gmail.com","subject":"Re: [PATCH 1/2] fix typo in Documentation","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2009-02-04T05:30:11Z","receivedAt":"2009-02-04T05:30:11Z","isPatch":true,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Wed, Feb 4, 2009 at 22:00, Guanqun Lu <guanqun.lu@gmail.com> wrote:\n> -However, it it totally safe to modify anything in the string pointed by\n> +However, it is totally safe to modify anything in the string pointed by\n\nTo prevent someone else from staring at this for a minute, \"it it\" was\nreplaced by \"it is\".\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"103074","messageId":"7veiye4pap.fsf@gitster.siamese.dyndns.org","threadId":"17546","inReplyTo":"1233781241-721-2-git-send-email-guanqun.lu@gmail.com","subject":"Re: [PATCH 2/2] add test-dump-cache-tree in Makefile","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-04T07:46:54Z","receivedAt":"2009-02-04T07:46:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks; both patches look good.\n"},{"id":"103096","messageId":"m38womwo2b.fsf@localhost.localdomain","threadId":"17546","inReplyTo":"1233781241-721-1-git-send-email-guanqun.lu@gmail.com","subject":"Re: [PATCH 1/2] fix typo in Documentation","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-02-04T09:26:09Z","receivedAt":"2009-02-04T09:26:09Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Guanqun Lu <guanqun.lu@gmail.com> writes:\n\n> Signed-off-by: Guanqun Lu <guanqun.lu@gmail.com>\n> ---\n>  Documentation/technical/api-strbuf.txt |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n\nMinor nit: I would add _where_ did you fix typy, i.e. instead of just\n  fix typo in Documentation\nI'd use\n  fix typo in strbuf API documentation\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"103097","messageId":"m34ozawnte.fsf@localhost.localdomain","threadId":"17546","inReplyTo":"1233781241-721-2-git-send-email-guanqun.lu@gmail.com","subject":"Re: [PATCH 2/2] add test-dump-cache-tree in Makefile","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-02-04T09:31:32Z","receivedAt":"2009-02-04T09:31:32Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Guanqun Lu <guanqun.lu@gmail.com> writes:\n\n>  dump-cache-tree.c      |   64 ------------------------------------------------\n>  test-dump-cache-tree.c |   64 ++++++++++++++++++++++++++++++++++++++++++++++++\n>  3 files changed, 65 insertions(+), 64 deletions(-)\n>  delete mode 100644 dump-cache-tree.c\n>  create mode 100644 test-dump-cache-tree.c\n\n> diff --git a/dump-cache-tree.c b/dump-cache-tree.c\n> deleted file mode 100644\n> index 1f73f1e..0000000\n\n> diff --git a/test-dump-cache-tree.c b/test-dump-cache-tree.c\n> new file mode 100644\n> index 0000000..1f73f1e\n\nMinor nit: it would be better to use git-format-patch with '-M' option\n(detect renames) here.  It would result in shorter and more readable\npatch:\n\n dump-cache-tree.c => test-dump-cache-tree.c |  0\n 3 files changed, 1 insertions(+), 0 deletions(-)\n rename dump-cache-tree.c => test-dump-cache-tree.c (100%)\n\ndiff --git a/dump-cache-tree.c b/test-dump-cache-tree.c\nsimilarity index 100%\nrename from dump-cache-tree.c\nrename to test-dump-cache-tree.c\n\nOr something like that...\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"103065","messageId":"1233781241-721-1-git-send-email-guanqun.lu@gmail.com","threadId":"17546","inReplyTo":null,"subject":"[PATCH 1/2] fix typo in Documentation","fromName":"Guanqun Lu","fromEmail":"guanqun.lu@gmail.com","sentAt":"2009-02-04T21:00:40Z","receivedAt":"2009-02-04T21:00:40Z","isPatch":true,"sender":{"key":"guanqun.lu@gmail.com","avatar":null},"body":"Signed-off-by: Guanqun Lu <guanqun.lu@gmail.com>\n---\n Documentation/technical/api-strbuf.txt |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/technical/api-strbuf.txt b/Documentation/technical/api-strbuf.txt\nindex 9a4e3ea..ac56d1c 100644\n--- a/Documentation/technical/api-strbuf.txt\n+++ b/Documentation/technical/api-strbuf.txt\n@@ -21,7 +21,7 @@ allocated memory or not), use `strbuf_detach()` to unwrap a memory\n buffer from its strbuf shell in a safe way. That is the sole supported\n way. This will give you a malloced buffer that you can later `free()`.\n +\n-However, it it totally safe to modify anything in the string pointed by\n+However, it is totally safe to modify anything in the string pointed by\n the `buf` member, between the indices `0` and `len-1` (inclusive).\n \n . The `buf` member is a byte array that has at least `len + 1` bytes\n-- \n1.6.1.2.321.g4a9f7\n"},{"id":"103066","messageId":"1233781241-721-2-git-send-email-guanqun.lu@gmail.com","threadId":"17546","inReplyTo":"1233781241-721-1-git-send-email-guanqun.lu@gmail.com","subject":"[PATCH 2/2] add test-dump-cache-tree in Makefile","fromName":"Guanqun Lu","fromEmail":"guanqun.lu@gmail.com","sentAt":"2009-02-04T21:00:41Z","receivedAt":"2009-02-04T21:00:41Z","isPatch":true,"sender":{"key":"guanqun.lu@gmail.com","avatar":null},"body":"5c5ba73b21a6910ee67d97cb87a5d78409112375 tries to use\ngeneric rule to build test programs, but it misses the file\n'dump-cache-tree.c', since its name is not prefixed by 'test-'.\nThis commit solves this little problem by renaming this file\ninstead of carrying out an explicit rule in Makefile.\n\nSigned-off-by: Guanqun Lu <guanqun.lu@gmail.com>\n---\n Makefile               |    1 +\n dump-cache-tree.c      |   64 ------------------------------------------------\n test-dump-cache-tree.c |   64 ++++++++++++++++++++++++++++++++++++++++++++++++\n 3 files changed, 65 insertions(+), 64 deletions(-)\n delete mode 100644 dump-cache-tree.c\n create mode 100644 test-dump-cache-tree.c\n\ndiff --git a/Makefile b/Makefile\nindex 9f3a8ab..b90ff39 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1388,6 +1388,7 @@ TEST_PROGRAMS += test-parse-options$X\n TEST_PROGRAMS += test-path-utils$X\n TEST_PROGRAMS += test-sha1$X\n TEST_PROGRAMS += test-sigchain$X\n+TEST_PROGRAMS += test-dump-cache-tree$X\n \n all:: $(TEST_PROGRAMS)\n \ndiff --git a/dump-cache-tree.c b/dump-cache-tree.c\ndeleted file mode 100644\nindex 1f73f1e..0000000\n--- a/dump-cache-tree.c\n+++ /dev/null\n@@ -1,64 +0,0 @@\n-#include \"cache.h\"\n-#include \"tree.h\"\n-#include \"cache-tree.h\"\n-\n-\n-static void dump_one(struct cache_tree *it, const char *pfx, const char *x)\n-{\n-\tif (it->entry_count < 0)\n-\t\tprintf(\"%-40s %s%s (%d subtrees)\\n\",\n-\t\t       \"invalid\", x, pfx, it->subtree_nr);\n-\telse\n-\t\tprintf(\"%s %s%s (%d entries, %d subtrees)\\n\",\n-\t\t       sha1_to_hex(it->sha1), x, pfx,\n-\t\t       it->entry_count, it->subtree_nr);\n-}\n-\n-static int dump_cache_tree(struct cache_tree *it,\n-\t\t\t   struct cache_tree *ref,\n-\t\t\t   const char *pfx)\n-{\n-\tint i;\n-\tint errs = 0;\n-\n-\tif (!it || !ref)\n-\t\t/* missing in either */\n-\t\treturn 0;\n-\n-\tif (it->entry_count < 0) {\n-\t\tdump_one(it, pfx, \"\");\n-\t\tdump_one(ref, pfx, \"#(ref) \");\n-\t\tif (it->subtree_nr != ref->subtree_nr)\n-\t\t\terrs = 1;\n-\t}\n-\telse {\n-\t\tdump_one(it, pfx, \"\");\n-\t\tif (hashcmp(it->sha1, ref->sha1) ||\n-\t\t    ref->entry_count != it->entry_count ||\n-\t\t    ref->subtree_nr != it->subtree_nr) {\n-\t\t\tdump_one(ref, pfx, \"#(ref) \");\n-\t\t\terrs = 1;\n-\t\t}\n-\t}\n-\n-\tfor (i = 0; i < it->subtree_nr; i++) {\n-\t\tchar path[PATH_MAX];\n-\t\tstruct cache_tree_sub *down = it->down[i];\n-\t\tstruct cache_tree_sub *rdwn;\n-\n-\t\trdwn = cache_tree_sub(ref, down->name);\n-\t\tsprintf(path, \"%s%.*s/\", pfx, down->namelen, down->name);\n-\t\tif (dump_cache_tree(down->cache_tree, rdwn->cache_tree, path))\n-\t\t\terrs = 1;\n-\t}\n-\treturn errs;\n-}\n-\n-int main(int ac, char **av)\n-{\n-\tstruct cache_tree *another = cache_tree();\n-\tif (read_cache() < 0)\n-\t\tdie(\"unable to read index file\");\n-\tcache_tree_update(another, active_cache, active_nr, 0, 1);\n-\treturn dump_cache_tree(active_cache_tree, another, \"\");\n-}\ndiff --git a/test-dump-cache-tree.c b/test-dump-cache-tree.c\nnew file mode 100644\nindex 0000000..1f73f1e\n--- /dev/null\n+++ b/test-dump-cache-tree.c\n@@ -0,0 +1,64 @@\n+#include \"cache.h\"\n+#include \"tree.h\"\n+#include \"cache-tree.h\"\n+\n+\n+static void dump_one(struct cache_tree *it, const char *pfx, const char *x)\n+{\n+\tif (it->entry_count < 0)\n+\t\tprintf(\"%-40s %s%s (%d subtrees)\\n\",\n+\t\t       \"invalid\", x, pfx, it->subtree_nr);\n+\telse\n+\t\tprintf(\"%s %s%s (%d entries, %d subtrees)\\n\",\n+\t\t       sha1_to_hex(it->sha1), x, pfx,\n+\t\t       it->entry_count, it->subtree_nr);\n+}\n+\n+static int dump_cache_tree(struct cache_tree *it,\n+\t\t\t   struct cache_tree *ref,\n+\t\t\t   const char *pfx)\n+{\n+\tint i;\n+\tint errs = 0;\n+\n+\tif (!it || !ref)\n+\t\t/* missing in either */\n+\t\treturn 0;\n+\n+\tif (it->entry_count < 0) {\n+\t\tdump_one(it, pfx, \"\");\n+\t\tdump_one(ref, pfx, \"#(ref) \");\n+\t\tif (it->subtree_nr != ref->subtree_nr)\n+\t\t\terrs = 1;\n+\t}\n+\telse {\n+\t\tdump_one(it, pfx, \"\");\n+\t\tif (hashcmp(it->sha1, ref->sha1) ||\n+\t\t    ref->entry_count != it->entry_count ||\n+\t\t    ref->subtree_nr != it->subtree_nr) {\n+\t\t\tdump_one(ref, pfx, \"#(ref) \");\n+\t\t\terrs = 1;\n+\t\t}\n+\t}\n+\n+\tfor (i = 0; i < it->subtree_nr; i++) {\n+\t\tchar path[PATH_MAX];\n+\t\tstruct cache_tree_sub *down = it->down[i];\n+\t\tstruct cache_tree_sub *rdwn;\n+\n+\t\trdwn = cache_tree_sub(ref, down->name);\n+\t\tsprintf(path, \"%s%.*s/\", pfx, down->namelen, down->name);\n+\t\tif (dump_cache_tree(down->cache_tree, rdwn->cache_tree, path))\n+\t\t\terrs = 1;\n+\t}\n+\treturn errs;\n+}\n+\n+int main(int ac, char **av)\n+{\n+\tstruct cache_tree *another = cache_tree();\n+\tif (read_cache() < 0)\n+\t\tdie(\"unable to read index file\");\n+\tcache_tree_update(another, active_cache, active_nr, 0, 1);\n+\treturn dump_cache_tree(active_cache_tree, another, \"\");\n+}\n-- \n1.6.1.2.321.g4a9f7\n"},{"id":"103274","messageId":"e57070790902042227r2d571b94h9b3a997d826a80d2@mail.gmail.com","threadId":"17546","inReplyTo":"m38womwo2b.fsf@localhost.localdomain","subject":"Re: [PATCH 1/2] fix typo in Documentation","fromName":"Guanqun Lu","fromEmail":"guanqun.lu@gmail.com","sentAt":"2009-02-05T06:27:41Z","receivedAt":"2009-02-05T06:27:41Z","isPatch":true,"sender":{"key":"guanqun.lu@gmail.com","avatar":null},"body":"On Wed, Feb 4, 2009 at 5:26 PM, Jakub Narebski <jnareb@gmail.com> wrote:\n> Guanqun Lu <guanqun.lu@gmail.com> writes:\n>\n>> Signed-off-by: Guanqun Lu <guanqun.lu@gmail.com>\n>> ---\n>>  Documentation/technical/api-strbuf.txt |    2 +-\n>>  1 files changed, 1 insertions(+), 1 deletions(-)\n>\n> Minor nit: I would add _where_ did you fix typy, i.e. instead of just\n>  fix typo in Documentation\n> I'd use\n>  fix typo in strbuf API documentation\n\nOK. I'll keep an eye next time. And thanks for your advice.\n\n>\n> --\n> Jakub Narebski\n> Poland\n> ShadeHawk on #git\n>\n\n\n\n-- \nGuanqun\n"},{"id":"103476","messageId":"237967ef0902060543q2cc13d99l852c8427fb66402b@mail.gmail.com","threadId":"17546","inReplyTo":"1233781241-721-1-git-send-email-guanqun.lu@gmail.com","subject":"Re: [PATCH 1/2] fix typo in Documentation","fromName":"Mikael Magnusson","fromEmail":"mikachu@gmail.com","sentAt":"2009-02-06T13:43:58Z","receivedAt":"2009-02-06T13:43:58Z","isPatch":true,"sender":{"key":"mikachu@gmail.com","avatar":null},"body":"2009/2/4 Guanqun Lu <guanqun.lu@gmail.com>:\n> Signed-off-by: Guanqun Lu <guanqun.lu@gmail.com>\n> ---\n>  Documentation/technical/api-strbuf.txt |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n>\n> diff --git a/Documentation/technical/api-strbuf.txt b/Documentation/technical/api-strbuf.txt\n> index 9a4e3ea..ac56d1c 100644\n> --- a/Documentation/technical/api-strbuf.txt\n> +++ b/Documentation/technical/api-strbuf.txt\n> @@ -21,7 +21,7 @@ allocated memory or not), use `strbuf_detach()` to unwrap a memory\n>  buffer from its strbuf shell in a safe way. That is the sole supported\n>  way. This will give you a malloced buffer that you can later `free()`.\n>  +\n> -However, it it totally safe to modify anything in the string pointed by\n> +However, it is totally safe to modify anything in the string pointed by\n>  the `buf` member, between the indices `0` and `len-1` (inclusive).\n>\n>  . The `buf` member is a byte array that has at least `len + 1` bytes\n\nShouldn't that be \"the string pointed >>at<< by\" too?\n\n-- \nMikael Magnusson\n"}]}