{"thread":{"id":"11306","subject":"Oddity in git commit summary","startedAt":"2007-12-15T20:29:18Z","lastAt":"2007-12-17T03:42:30Z","messageCount":5,"participants":["Daniel Barkalow","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"63274","messageId":"Pine.LNX.4.64.0712151507420.5349@iabervon.org","threadId":"11306","inReplyTo":null,"subject":"Oddity in git commit summary","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2007-12-15T20:29:18Z","receivedAt":"2007-12-15T20:29:18Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"I just noticed that I got a strange summary from git commit -a --amend \nwith the current master. It said:\n\nCreated commit f16cb29: Build in checkout\n 5 files changed, 482 insertions(+), 299 deletions(-)\n create mode 100644 builtin-checkout.c\n delete mode 100755 git-checkout.sh\n\nBut git show --stat says:\n 7 files changed, 780 insertions(+), 306 deletions(-)\n\nAnd git show --stat -C says:\n 6 files changed, 482 insertions(+), 8 deletions(-)\n\nThe commit that I noticed this on is available from:\n\n git://iabervon.org/~barkalow/git.git builtin-checkout\n\nI've never particularly paid attention to this message before, so I don't \nknow if it's saying something accurate I'm not understanding, or if it's \nactually inaccurate about what it's trying to show.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"63360","messageId":"7vhciii6r0.fsf@gitster.siamese.dyndns.org","threadId":"11306","inReplyTo":"Pine.LNX.4.64.0712151507420.5349@iabervon.org","subject":"Re: Oddity in git commit summary","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-16T23:01:39Z","receivedAt":"2007-12-16T23:01:39Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Daniel Barkalow <barkalow@iabervon.org> writes:\n\n> I just noticed that I got a strange summary from git commit -a --amend \n> with the current master. It said:\n>\n> Created commit f16cb29: Build in checkout\n>  5 files changed, 482 insertions(+), 299 deletions(-)\n>  create mode 100644 builtin-checkout.c\n>  delete mode 100755 git-checkout.sh\n>\n> But git show --stat says:\n>  7 files changed, 780 insertions(+), 306 deletions(-)\n>\n> And git show --stat -C says:\n>  6 files changed, 482 insertions(+), 8 deletions(-)\n\nBecause \"git status\" has -B -M and your second one does not pass any, I\nwould not worry about the first two differences.  But 5 vs 6 seems\nfunny.\n\nprint_summary() is broken.\n\ndiff --git a/builtin-commit.c b/builtin-commit.c\nindex 518ebe0..8435702 100644\n--- a/builtin-commit.c\n+++ b/builtin-commit.c\n@@ -663,6 +665,8 @@ static void print_summary(const char *prefix, const unsigned char *sha1)\n \trev.commit_format = get_commit_format(\"format:%h: %s\");\n \trev.always_show_header = 0;\n \n+\tdiff_setup_done(&rev.diffopt);\n+\n \tprintf(\"Created %scommit \", initial_commit ? \"initial \" : \"\");\n \n \tif (!log_tree_commit(&rev, commit)) {\n"},{"id":"63361","messageId":"7vy7bugrpc.fsf@gitster.siamese.dyndns.org","threadId":"11306","inReplyTo":"Pine.LNX.4.64.0712151507420.5349@iabervon.org","subject":"[PATCH 1/2] builtin-commit: fix summary output.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-16T23:11:59Z","receivedAt":"2007-12-16T23:11:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Because print_summary() forgot to call diff_setup_done() after futzing with\ndiff output options, it failed to activate recursive diff, which resulted in\nan incorrect summary.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n * This fixes the \"5 files\" problem you saw with your commit, which was\n   totally bogus (it looked at \"git diff-tree HEAD\" output that was\n   non-recursive, discarding the change of tree t/ itself).  Now it will\n   show \"7 files\" in line with your \"git show\".\n\n builtin-commit.c |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/builtin-commit.c b/builtin-commit.c\nindex 518ebe0..61770ef 100644\n--- a/builtin-commit.c\n+++ b/builtin-commit.c\n@@ -662,6 +662,7 @@ static void print_summary(const char *prefix, const unsigned char *sha1)\n \trev.show_root_diff = 1;\n \trev.commit_format = get_commit_format(\"format:%h: %s\");\n \trev.always_show_header = 0;\n+\tdiff_setup_done(&rev.diffopt);\n \n \tprintf(\"Created %scommit \", initial_commit ? \"initial \" : \"\");\n \n-- \n1.5.4.rc0.52.gb90ce\n"},{"id":"63362","messageId":"7vwsregrom.fsf@gitster.siamese.dyndns.org","threadId":"11306","inReplyTo":"Pine.LNX.4.64.0712151507420.5349@iabervon.org","subject":"[PATCH 2/2] builtin-commit: make summary output consistent with status","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-16T23:12:25Z","receivedAt":"2007-12-16T23:12:25Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This enables -B -M to the summary output after a commit is made so that\nit is in line with what is shown in git-status and commit log template.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n * And this fixes the \"7 files\" because print_summary() does not pass -B\n   -M which makes it inconsistent with the status output.  After this\n   you should see \"6 files\".\n\n builtin-commit.c |    3 +++\n 1 files changed, 3 insertions(+), 0 deletions(-)\n\ndiff --git a/builtin-commit.c b/builtin-commit.c\nindex 61770ef..0a91013 100644\n--- a/builtin-commit.c\n+++ b/builtin-commit.c\n@@ -662,6 +662,9 @@ static void print_summary(const char *prefix, const unsigned char *sha1)\n \trev.show_root_diff = 1;\n \trev.commit_format = get_commit_format(\"format:%h: %s\");\n \trev.always_show_header = 0;\n+\trev.diffopt.detect_rename = 1;\n+\trev.diffopt.rename_limit = 100;\n+\trev.diffopt.break_opt = 0;\n \tdiff_setup_done(&rev.diffopt);\n \n \tprintf(\"Created %scommit \", initial_commit ? \"initial \" : \"\");\n-- \n1.5.4.rc0.52.gb90ce\n"},{"id":"63366","messageId":"Pine.LNX.4.64.0712162241330.5349@iabervon.org","threadId":"11306","inReplyTo":"7vwsregrom.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 2/2] builtin-commit: make summary output consistent with status","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2007-12-17T03:42:30Z","receivedAt":"2007-12-17T03:42:30Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Sun, 16 Dec 2007, Junio C Hamano wrote:\n\n>  * And this fixes the \"7 files\" because print_summary() does not pass -B\n>    -M which makes it inconsistent with the status output.  After this\n>    you should see \"6 files\".\n\nYup, it now looks like what I thought that commit consisted of.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"}]}