{"thread":{"id":"12668","subject":"[PATCH v2 2/4] builtin-status: submodule summary support","startedAt":"2008-03-13T13:48:01Z","lastAt":"2008-03-14T17:45:15Z","messageCount":15,"participants":["Ping Yin","Johannes Sixt","Junio C Hamano"],"isPatch":true,"patchVersion":2,"patchTotal":4},"messages":[{"id":"71941","messageId":"1205416085-23431-1-git-send-email-pkufranky@gmail.com","threadId":"12668","inReplyTo":null,"subject":"builtin-status submodule summary","fromName":"Ping Yin","fromEmail":"pkufranky@gmail.com","sentAt":"2008-03-13T13:48:01Z","receivedAt":"2008-03-13T13:48:01Z","isPatch":false,"sender":{"key":"pkufranky@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5346?v=4"},"body":"This patch series builds on top of next. It teaches builtin-status/commit\nsummary for submodules.\n\nIt contains\n      git-submodule summary: --for-status option\n      builtin-status: submodule summary support\n      builtin-status: configurable submodule summary size\n      buitin-status: Add tests for submodule summary\n\nwith diffstat\n\n git-submodule.sh             |   17 +++++-\n t/t7401-submodule-summary.sh |   13 ++++\n t/t7502-status.sh            |  136 ++++++++++++++++++++++++++++++++++++++++++\n wt-status.c                  |   38 ++++++++++++\n 4 files changed, 203 insertions(+), 1 deletions(-)\n"},{"id":"71939","messageId":"1205416085-23431-2-git-send-email-pkufranky@gmail.com","threadId":"12668","inReplyTo":"1205416085-23431-1-git-send-email-pkufranky@gmail.com","subject":"[PATCH v2 1/4] git-submodule summary: --for-status option","fromName":"Ping Yin","fromEmail":"pkufranky@gmail.com","sentAt":"2008-03-13T13:48:02Z","receivedAt":"2008-03-13T13:48:02Z","isPatch":true,"sender":{"key":"pkufranky@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5346?v=4"},"body":"The --for-status option is mainly used by builtin-status/commit.\nIt adds 'Modified submodules:' line at top and  '# ' prefix to all\nfollowing lines.\n\nSigned-off-by: Ping Yin <pkufranky@gmail.com>\n---\n git-submodule.sh             |   17 ++++++++++++++++-\n t/t7401-submodule-summary.sh |   13 +++++++++++++\n 2 files changed, 29 insertions(+), 1 deletions(-)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 5f1d5ef..4baafba 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -342,6 +342,7 @@ set_name_rev () {\n #\n cmd_summary() {\n \tsummary_limit=-1\n+\tfor_status=\n \n \t# parse $args after \"submodule ... summary\".\n \twhile test $# -ne 0\n@@ -350,6 +351,9 @@ cmd_summary() {\n \t\t--cached)\n \t\t\tcached=\"$1\"\n \t\t\t;;\n+\t\t--for-status)\n+\t\t\tfor_status=\"$1\"\n+\t\t\t;;\n \t\t-n|--summary-limit)\n \t\t\tif summary_limit=$(($2 + 0)) 2>/dev/null && test \"$summary_limit\" = \"$2\"\n \t\t\tthen\n@@ -398,6 +402,12 @@ cmd_summary() {\n \t)\n \n \ttest -n \"$modules\" &&\n+\tif test -n \"$for_status\"; then\n+\t\techo \"# Modified submodules:\"\n+\t\techo \"#\"\n+\telse\n+\t\ttrue\n+\tfi &&\n \tgit diff-index $cached --raw $head -- $modules |\n \tgrep -e '^:160000' -e '^:[0-7]* 160000' |\n \tcut -c2- |\n@@ -499,7 +509,12 @@ cmd_summary() {\n \t\t\techo\n \t\tfi\n \t\techo\n-\tdone\n+\tdone |\n+\tif test -n \"$for_status\"; then\n+\t\tsed -e \"s|^|# |\" -e 's|^# $|#|'\n+\telse\n+\t\tcat\n+\tfi\n }\n #\n # List all submodules, prefixed with:\ndiff --git a/t/t7401-submodule-summary.sh b/t/t7401-submodule-summary.sh\nindex 0f3c42a..1dbb39d 100755\n--- a/t/t7401-submodule-summary.sh\n+++ b/t/t7401-submodule-summary.sh\n@@ -192,4 +192,17 @@ test_expect_success 'given commit' \"\n EOF\n \"\n \n+test_expect_success '--for-status' \"\n+    git submodule summary --for-status HEAD^ >actual &&\n+    diff actual - <<-EOF\n+# Modified submodules:\n+#\n+# * sm1 $head6...0000000:\n+#\n+# * sm2 0000000...$head7 (2):\n+#   > Add foo9\n+#\n+EOF\n+\"\n+\n test_done\n-- \n1.5.4.3.347.g5314c\n"},{"id":"71938","messageId":"1205416085-23431-3-git-send-email-pkufranky@gmail.com","threadId":"12668","inReplyTo":"1205416085-23431-2-git-send-email-pkufranky@gmail.com","subject":"[PATCH v2 2/4] builtin-status: submodule summary support","fromName":"Ping Yin","fromEmail":"pkufranky@gmail.com","sentAt":"2008-03-13T13:48:03Z","receivedAt":"2008-03-13T13:48:03Z","isPatch":true,"sender":{"key":"pkufranky@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5346?v=4"},"body":"This commit teaches 'git commit/status' show 'Modified submodules'\nsection given by 'git submodule summary --cached --for-status'\njust before 'Untracked files' section.\n\nSigned-off-by: Ping Yin <pkufranky@gmail.com>\n---\n wt-status.c |   28 ++++++++++++++++++++++++++++\n 1 files changed, 28 insertions(+), 0 deletions(-)\n\ndiff --git a/wt-status.c b/wt-status.c\nindex 701d13d..75ee7ba 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -8,6 +8,7 @@\n #include \"revision.h\"\n #include \"diffcore.h\"\n #include \"quote.h\"\n+#include \"run-command.h\"\n \n int wt_status_relative_paths = 1;\n int wt_status_use_color = -1;\n@@ -219,6 +220,30 @@ static void wt_status_print_changed(struct wt_status *s)\n \trev.diffopt.format_callback_data = s;\n \trun_diff_files(&rev, 0);\n }\n+static void wt_status_print_submodule_summary(struct wt_status *s)\n+{\n+\tstruct child_process sm_summary;\n+\tconst char *argv[] = {\n+\t\t\"submodule\",\n+\t\t\"summary\",\n+\t\t\"--cached\",\n+\t\t\"--for-status\",\n+\t\ts->amend ? \"HEAD^\" : \"HEAD\",\n+\t\tNULL\n+\t};\n+\tchar index[PATH_MAX];\n+\tconst char *env[2] = { index, NULL };\n+\tsnprintf(index, sizeof(index), \"GIT_INDEX_FILE=%s\", s->index_file);\n+\n+\tmemset(&sm_summary, 0, sizeof(sm_summary));\n+\tsm_summary.argv = argv;\n+\tsm_summary.env = env;\n+\tsm_summary.git_cmd = 1;\n+\tsm_summary.no_stdin = 1;\n+\tfflush(s->fp);\n+\tsm_summary.out = dup(fileno(s->fp));    /* run_command closes it */\n+\trun_command(&sm_summary);\n+}\n \n static void wt_status_print_untracked(struct wt_status *s)\n {\n@@ -321,6 +346,9 @@ void wt_status_print(struct wt_status *s)\n \t}\n \n \twt_status_print_changed(s);\n+\t// must flush s->fp since following call will write to s->fp in a child process\n+\tfflush(s->fp);\n+\twt_status_print_submodule_summary(s);\n \twt_status_print_untracked(s);\n \n \tif (s->verbose && !s->is_initial)\n-- \n1.5.4.3.347.g5314c\n"},{"id":"71940","messageId":"1205416085-23431-4-git-send-email-pkufranky@gmail.com","threadId":"12668","inReplyTo":"1205416085-23431-3-git-send-email-pkufranky@gmail.com","subject":"[PATCH v2 3/4] builtin-status: configurable submodule summary size","fromName":"Ping Yin","fromEmail":"pkufranky@gmail.com","sentAt":"2008-03-13T13:48:04Z","receivedAt":"2008-03-13T13:48:04Z","isPatch":true,"sender":{"key":"pkufranky@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5346?v=4"},"body":"Add config variable status.submodulesummary which is passed as\narg for '--summary-limit' of 'git submodule summary' to limit the\nsubmodule summary size.\n\nstatus.submodulesummary is 0 by default which disables the summary.\n\nSigned-off-by: Ping Yin <pkufranky@gmail.com>\n---\n wt-status.c |   10 ++++++++++\n 1 files changed, 10 insertions(+), 0 deletions(-)\n\ndiff --git a/wt-status.c b/wt-status.c\nindex 75ee7ba..2f47e36 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -12,6 +12,7 @@\n \n int wt_status_relative_paths = 1;\n int wt_status_use_color = -1;\n+int wt_status_submodule_summary = 0;\n static char wt_status_colors[][COLOR_MAXLEN] = {\n \t\"\",         /* WT_STATUS_HEADER: normal */\n \t\"\\033[32m\", /* WT_STATUS_UPDATED: green */\n@@ -222,12 +223,17 @@ static void wt_status_print_changed(struct wt_status *s)\n }\n static void wt_status_print_submodule_summary(struct wt_status *s)\n {\n+\tif (wt_status_submodule_summary == 0) return;\n \tstruct child_process sm_summary;\n+\tchar summary_limit[64];\n+\tsprintf(summary_limit, \"%d\", wt_status_submodule_summary);\n \tconst char *argv[] = {\n \t\t\"submodule\",\n \t\t\"summary\",\n \t\t\"--cached\",\n \t\t\"--for-status\",\n+\t\t\"--summary-limit\",\n+\t\tsummary_limit,\n \t\ts->amend ? \"HEAD^\" : \"HEAD\",\n \t\tNULL\n \t};\n@@ -371,6 +377,10 @@ void wt_status_print(struct wt_status *s)\n \n int git_status_config(const char *k, const char *v)\n {\n+\tif (!strcmp(k, \"status.submodulesummary\")) {\n+\t\twt_status_submodule_summary = atoi(v);\n+\t\treturn 0;\n+\t}\n \tif (!strcmp(k, \"status.color\") || !strcmp(k, \"color.status\")) {\n \t\twt_status_use_color = git_config_colorbool(k, v, -1);\n \t\treturn 0;\n-- \n1.5.4.3.347.g5314c\n"},{"id":"71942","messageId":"1205416085-23431-5-git-send-email-pkufranky@gmail.com","threadId":"12668","inReplyTo":"1205416085-23431-4-git-send-email-pkufranky@gmail.com","subject":"[PATCH v2 4/4] buitin-status: Add tests for submodule summary","fromName":"Ping Yin","fromEmail":"pkufranky@gmail.com","sentAt":"2008-03-13T13:48:05Z","receivedAt":"2008-03-13T13:48:05Z","isPatch":true,"sender":{"key":"pkufranky@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5346?v=4"},"body":"Signed-off-by: Ping Yin <pkufranky@gmail.com>\n---\n t/t7502-status.sh |  136 +++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 136 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t7502-status.sh b/t/t7502-status.sh\nindex e006074..7a9a08f 100755\n--- a/t/t7502-status.sh\n+++ b/t/t7502-status.sh\n@@ -149,4 +149,140 @@ test_expect_success 'status of partial commit excluding new file in index' '\n \tdiff -u expect output\n '\n \n+test_expect_success \"setup status submodule summary\" '\n+\ttest_create_repo sm &&\n+\tcd sm &&\n+\t: >foo &&\n+\tgit add foo &&\n+\tgit commit -m \"Add foo\" &&\n+\tcd .. &&\n+\tgit add sm\n+'\n+\n+cat > expect <<EOF\n+# On branch master\n+# Changes to be committed:\n+#   (use \"git reset HEAD <file>...\" to unstage)\n+#\n+#\tnew file:   dir2/added\n+#\tnew file:   sm\n+#\n+# Changed but not updated:\n+#   (use \"git add <file>...\" to update what will be committed)\n+#\n+#\tmodified:   dir1/modified\n+#\n+# Untracked files:\n+#   (use \"git add <file>...\" to include in what will be committed)\n+#\n+#\tdir1/untracked\n+#\tdir2/modified\n+#\tdir2/untracked\n+#\texpect\n+#\toutput\n+#\tuntracked\n+EOF\n+test_expect_success \"status submodule summary is disabled by default\" '\n+\tgit status > output &&\n+\tgit diff expect output\n+'\n+\n+cd sm &&\n+head=$(git rev-parse --verify HEAD | cut -c1-7) &&\n+cd ..\n+\n+cat > expect <<EOF\n+# On branch master\n+# Changes to be committed:\n+#   (use \"git reset HEAD <file>...\" to unstage)\n+#\n+#\tnew file:   dir2/added\n+#\tnew file:   sm\n+#\n+# Changed but not updated:\n+#   (use \"git add <file>...\" to update what will be committed)\n+#\n+#\tmodified:   dir1/modified\n+#\n+# Modified submodules:\n+#\n+# * sm 0000000...$head (1):\n+#   > Add foo\n+#\n+# Untracked files:\n+#   (use \"git add <file>...\" to include in what will be committed)\n+#\n+#\tdir1/untracked\n+#\tdir2/modified\n+#\tdir2/untracked\n+#\texpect\n+#\toutput\n+#\tuntracked\n+EOF\n+test_expect_success \"status submodule summary\" '\n+\tgit config status.submodulesummary 10 &&\n+\tgit status > output &&\n+\tgit diff expect output\n+'\n+\n+\n+cat > expect <<EOF\n+# On branch master\n+# Changed but not updated:\n+#   (use \"git add <file>...\" to update what will be committed)\n+#\n+#\tmodified:   dir1/modified\n+#\n+# Untracked files:\n+#   (use \"git add <file>...\" to include in what will be committed)\n+#\n+#\tdir1/untracked\n+#\tdir2/modified\n+#\tdir2/untracked\n+#\texpect\n+#\toutput\n+#\tuntracked\n+no changes added to commit (use \"git add\" and/or \"git commit -a\")\n+EOF\n+test_expect_success \"status submodule summary (clean submodule)\" '\n+\tgit commit -m \"commit submodule\" &&\n+\tgit config status.submodulesummary 10 &&\n+\t! git status > output &&\n+\tgit diff expect output\n+'\n+\n+cat > expect <<EOF\n+# On branch master\n+# Changes to be committed:\n+#   (use \"git reset HEAD^1 <file>...\" to unstage)\n+#\n+#\tnew file:   dir2/added\n+#\tnew file:   sm\n+#\n+# Changed but not updated:\n+#   (use \"git add <file>...\" to update what will be committed)\n+#\n+#\tmodified:   dir1/modified\n+#\n+# Modified submodules:\n+#\n+# * sm 0000000...$head (1):\n+#   > Add foo\n+#\n+# Untracked files:\n+#   (use \"git add <file>...\" to include in what will be committed)\n+#\n+#\tdir1/untracked\n+#\tdir2/modified\n+#\tdir2/untracked\n+#\texpect\n+#\toutput\n+#\tuntracked\n+EOF\n+test_expect_success \"status submodule summary (--amend)\" '\n+\tgit config status.submodulesummary 10 &&\n+\tgit status --amend > output &&\n+\tgit diff expect output\n+'\n+\n test_done\n-- \n1.5.4.3.347.g5314c\n"},{"id":"71947","messageId":"47D935FE.8010107@viscovery.net","threadId":"12668","inReplyTo":"1205416085-23431-3-git-send-email-pkufranky@gmail.com","subject":"Re: [PATCH v2 2/4] builtin-status: submodule summary support","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-03-13T14:11:10Z","receivedAt":"2008-03-13T14:11:10Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Ping Yin schrieb:\n> +\tmemset(&sm_summary, 0, sizeof(sm_summary));\n> +\tsm_summary.argv = argv;\n> +\tsm_summary.env = env;\n> +\tsm_summary.git_cmd = 1;\n> +\tsm_summary.no_stdin = 1;\n> +\tfflush(s->fp);\n> +\tsm_summary.out = dup(fileno(s->fp));    /* run_command closes it */\n\nThe fflush() at this point makes a lot of sense, and doesn't even need a\ncomment (IMHO).\n\n>  \twt_status_print_changed(s);\n> +\t// must flush s->fp since following call will write to s->fp in a child process\n> +\tfflush(s->fp);\n> +\twt_status_print_submodule_summary(s);\n>  \twt_status_print_untracked(s);\n\nBut then we don't need the fflush() here. Right?\n\n-- Hannes\n"},{"id":"71948","messageId":"47D936E6.10107@viscovery.net","threadId":"12668","inReplyTo":"1205416085-23431-4-git-send-email-pkufranky@gmail.com","subject":"Re: [PATCH v2 3/4] builtin-status: configurable submodule summary size","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-03-13T14:15:02Z","receivedAt":"2008-03-13T14:15:02Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Ping Yin schrieb:\n> +\tif (wt_status_submodule_summary == 0) return;\n\nStyle:\n\tif (!wt_status_submodule_summary)\n\t\treturn;\n\n>  \tstruct child_process sm_summary;\n> +\tchar summary_limit[64];\n> +\tsprintf(summary_limit, \"%d\", wt_status_submodule_summary);\n>  \tconst char *argv[] = {\n\nDeclaration after statement. That's not portable.\n\n-- Hannes\n"},{"id":"71949","messageId":"47D93875.1050407@viscovery.net","threadId":"12668","inReplyTo":"1205416085-23431-5-git-send-email-pkufranky@gmail.com","subject":"Re: [PATCH v2 4/4] buitin-status: Add tests for submodule summary","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-03-13T14:21:41Z","receivedAt":"2008-03-13T14:21:41Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Ping Yin schrieb:\n> +cd sm &&\n> +head=$(git rev-parse --verify HEAD | cut -c1-7) &&\n> +cd ..\n\nI think you can make these three lines into:\n\ntest_expect_success 'get short SHA1 of submodule HEAD' '\n\n\thead=$(cd sm && git rev-parse --verify HEAD | cut -c1-7)\n'\n\n(not tested, though).\n\n> +test_expect_success \"status submodule summary (--amend)\" '\n\nThanks for adding this one.\n\n-- Hannes\n"},{"id":"71975","messageId":"46dff0320803131101g62c16db2wf999c851672a8e0@mail.gmail.com","threadId":"12668","inReplyTo":"47D935FE.8010107@viscovery.net","subject":"Re: [PATCH v2 2/4] builtin-status: submodule summary support","fromName":"Ping Yin","fromEmail":"pkufranky@gmail.com","sentAt":"2008-03-13T18:01:06Z","receivedAt":"2008-03-13T18:01:06Z","isPatch":true,"sender":{"key":"pkufranky@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5346?v=4"},"body":"On Thu, Mar 13, 2008 at 10:11 PM, Johannes Sixt <j.sixt@viscovery.net> wrote:\n> Ping Yin schrieb:\n>\n>  >       wt_status_print_changed(s);\n>  > +     // must flush s->fp since following call will write to s->fp in a child process\n>  > +     fflush(s->fp);\n>  > +     wt_status_print_submodule_summary(s);\n>  >       wt_status_print_untracked(s);\n>\n>  But then we don't need the fflush() here. Right?\n>\nYou are right.\n\ndiff --git a/wt-status.c b/wt-status.c\nindex 2f47e36..468c14c 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -352,8 +352,6 @@ void wt_status_print(struct wt_status *s)\n        }\n\n        wt_status_print_changed(s);\n-       // must flush s->fp since following call will write to s->fp\nin a child process\n-       fflush(s->fp);\n        wt_status_print_submodule_summary(s);\n        wt_status_print_untracked(s)\n\n\n-- \nPing Yin\n"},{"id":"71976","messageId":"7vprtyxzzd.fsf@gitster.siamese.dyndns.org","threadId":"12668","inReplyTo":"47D93875.1050407@viscovery.net","subject":"Re: [PATCH v2 4/4] buitin-status: Add tests for submodule summary","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-03-13T18:04:06Z","receivedAt":"2008-03-13T18:04:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j.sixt@viscovery.net> writes:\n\n> Ping Yin schrieb:\n>> +cd sm &&\n>> +head=$(git rev-parse --verify HEAD | cut -c1-7) &&\n>> +cd ..\n>\n> I think you can make these three lines into:\n>\n> test_expect_success 'get short SHA1 of submodule HEAD' '\n>\n> \thead=$(cd sm && git rev-parse --verify HEAD | cut -c1-7)\n> '\n\n\"git rev-parse --short=12 --verify HEAD\" or whatever minimum length you\nwould want would free you from an ugly \"pipe to cut\".\n"},{"id":"71977","messageId":"46dff0320803131109j165cfde9v85ea9b04a05819ef@mail.gmail.com","threadId":"12668","inReplyTo":"47D93875.1050407@viscovery.net","subject":"Re: [PATCH v2 4/4] buitin-status: Add tests for submodule summary","fromName":"Ping Yin","fromEmail":"pkufranky@gmail.com","sentAt":"2008-03-13T18:09:09Z","receivedAt":"2008-03-13T18:09:09Z","isPatch":true,"sender":{"key":"pkufranky@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5346?v=4"},"body":"On Thu, Mar 13, 2008 at 10:21 PM, Johannes Sixt <j.sixt@viscovery.net> wrote:\n> Ping Yin schrieb:\n>\n> > +cd sm &&\n>  > +head=$(git rev-parse --verify HEAD | cut -c1-7) &&\n>  > +cd ..\n>\n>  I think you can make these three lines into:\n>\n>  test_expect_success 'get short SHA1 of submodule HEAD' '\n>\n>         head=$(cd sm && git rev-parse --verify HEAD | cut -c1-7)\n>  '\n>\n>  (not tested, though).\n\nHmm, It doesn't work. Since i need $head1 outputed to file expect as follows\n\n+cat > expect <<EOF\n+# On branch master\n+# Changes to be committed:\n+#   (use \"git reset HEAD^1 <file>...\" to unstage)\n+#\n+#      new file:   dir2/added\n+#      new file:   sm\n+#\n+# Changed but not updated:\n+#   (use \"git add <file>...\" to update what will be committed)\n+#\n+#      modified:   dir1/modified\n+#\n+# Modified submodules:\n+#\n+# * sm 0000000...$head (1):\n\nHere we need $head.\n\n\n\n-- \nPing Yin\n"},{"id":"71978","messageId":"46dff0320803131114v3218cc5etdd729b53d3a0d44d@mail.gmail.com","threadId":"12668","inReplyTo":"7vprtyxzzd.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH v2 4/4] buitin-status: Add tests for submodule summary","fromName":"Ping Yin","fromEmail":"pkufranky@gmail.com","sentAt":"2008-03-13T18:14:44Z","receivedAt":"2008-03-13T18:14:44Z","isPatch":true,"sender":{"key":"pkufranky@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5346?v=4"},"body":"On Fri, Mar 14, 2008 at 2:04 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Johannes Sixt <j.sixt@viscovery.net> writes:\n>\n>  > Ping Yin schrieb:\n>  >> +cd sm &&\n>  >> +head=$(git rev-parse --verify HEAD | cut -c1-7) &&\n>  >> +cd ..\n>  >\n>  > I think you can make these three lines into:\n>  >\n>  > test_expect_success 'get short SHA1 of submodule HEAD' '\n>  >\n>  >       head=$(cd sm && git rev-parse --verify HEAD | cut -c1-7)\n>  > '\n>\n>  \"git rev-parse --short=12 --verify HEAD\" or whatever minimum length you\n>  would want would free you from an ugly \"pipe to cut\".\n>\nThanks.\n\ndiff --git a/t/t7502-status.sh b/t/t7502-status.sh\nindex 7a9a08f..80e2a7b 100755\n--- a/t/t7502-status.sh\n+++ b/t/t7502-status.sh\n@@ -187,9 +187,7 @@ test_expect_success\n        git diff expect output\n '\n\n-cd sm &&\n-head=$(git rev-parse --verify HEAD | cut -c1-7) &&\n-cd ..\n+head=$(cd sm && git rev-parse --short=7 --verify HEAD)\n\n cat > expect <<EOF\n # On branch master\n\n\n\n-- \nPing Yin\n"},{"id":"72085","messageId":"46dff0320803140730jeef5808r7da67a103ce7b171@mail.gmail.com","threadId":"12668","inReplyTo":"1205416085-23431-1-git-send-email-pkufranky@gmail.com","subject":"Re: builtin-status submodule summary","fromName":"Ping Yin","fromEmail":"pkufranky@gmail.com","sentAt":"2008-03-14T14:30:51Z","receivedAt":"2008-03-14T14:30:51Z","isPatch":false,"sender":{"key":"pkufranky@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5346?v=4"},"body":"On Thu, Mar 13, 2008 at 9:48 PM, Ping Yin <pkufranky@gmail.com> wrote:\n> This patch series builds on top of next. It teaches builtin-status/commit\n>  summary for submodules.\n>\n>  It contains\n>       git-submodule summary: --for-status option\n>       builtin-status: submodule summary support\n>       builtin-status: configurable submodule summary size\n>       buitin-status: Add tests for submodule summary\n>\n>  with diffstat\n>\n>   git-submodule.sh             |   17 +++++-\n>   t/t7401-submodule-summary.sh |   13 ++++\n>   t/t7502-status.sh            |  136 ++++++++++++++++++++++++++++++++++++++++++\n>   wt-status.c                  |   38 ++++++++++++\n>   4 files changed, 203 insertions(+), 1 deletions(-)\n>\n\nIMO, git submodule summary is not so useful for me if it's not\nintegrated into git-status. In fact i never use \"git submodule\nsummary\" directly. git-status with submodule summary support is very\nuseful to help user figure out what is going on in a more global level\nwhen cooking the commit message.\n\nSo i think this series should go along with the submodule summary series.\n\n\n\n-- \nPing Yin\n"},{"id":"72110","messageId":"7vprtxp8ew.fsf@gitster.siamese.dyndns.org","threadId":"12668","inReplyTo":"46dff0320803140730jeef5808r7da67a103ce7b171@mail.gmail.com","subject":"Re: builtin-status submodule summary","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-03-14T16:39:03Z","receivedAt":"2008-03-14T16:39:03Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Ping Yin\" <pkufranky@gmail.com> writes:\n\n> So i think this series should go along with the submodule summary series.\n\nPerhaps eventually, but definitely not this round, I am afraid.\n\nThe usefulness of the output in the current implementation of the\n\"summary\" itself is not even proven at this point.  Nobody other than you\nhas jumped up-and-down and said \"submodule summary is great and should be\nin status, I did not know what I was missing!\" yet.\n\nI hope we verified the code well enough to make sure that people who use\n\"git submodule\" command but do not type \"git submodule summary\" would not\nget hurt by the addition.  For a new feature, that is more important than\nhow well the new feature works and how useful the new feature is.  And by\nshipping a release with it will give it a wider exposure and hopefully a\nchance for it to mature to get more useful.  The series just got into a\n\"harmless to others and is releasable\" shape.\n\nRecall how many rounds \"submodule summary\" took to get into that state,\nand how much time and effort were spent on it.  Use it as a yardstick to\nguesstimate how much further effort and time will be needed to get the\nchanges to git-status into a reasonable shape.\n\nIt may happen eventually, but not before 1.5.5.\n"},{"id":"72121","messageId":"46dff0320803141045w5cf1506fw9ab676f041a4bd12@mail.gmail.com","threadId":"12668","inReplyTo":"7vprtxp8ew.fsf@gitster.siamese.dyndns.org","subject":"Re: builtin-status submodule summary","fromName":"Ping Yin","fromEmail":"pkufranky@gmail.com","sentAt":"2008-03-14T17:45:15Z","receivedAt":"2008-03-14T17:45:15Z","isPatch":false,"sender":{"key":"pkufranky@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5346?v=4"},"body":"On Sat, Mar 15, 2008 at 12:39 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> \"Ping Yin\" <pkufranky@gmail.com> writes:\n>\n>  > So i think this series should go along with the submodule summary series.\n>\n>\n>  Recall how many rounds \"submodule summary\" took to get into that state,\n>  and how much time and effort were spent on it.  Use it as a yardstick to\n>  guesstimate how much further effort and time will be needed to get the\n>  changes to git-status into a reasonable shape.\n>\n>  It may happen eventually, but not before 1.5.5.\n>\nSo i'll resend my patches considering suggestions from Johannes Sixt\nafter 1.5.5.\n\n\n\n-- \nPing Yin\n"}]}