From: Pavel Roskin <proski@gnu.org>
To: git <git@vger.kernel.org>
Subject: gitk shows an empty line between "Comments" and changed files
Date: Thu, 27 Oct 2005 13:30:30 -0400 [thread overview]
Message-ID: <1130434230.19641.21.camel@dv> (raw)
Hello!
gitk is now showing an empty line between "Comments" and changes files.
This change was caused by 8b7e5d76e836396a097bb6f61cf930ea872a7bd3 (Make
"gitk" work better with dense revlists).
git-diff-tree outputs some SHA1 as the first line if only one tree-ish
argument is provided. I don't see any way to suppress that output (see
diff-tree.c, line 114).
One solution would be to add an option to git-diff-tree to suppress all
headers (let's call it --no-headers).
Or maybe the SHA1 header should never be printed at all? It looks like
it's not documented anywhere. It doesn't break the tests.
While debugging the patch, I have found that the p variable is unused in
both functions that stopped passing it to git-diff-tree.
Also, gettreediffs function in gitk could use --names-only for
git-diff-tree, because it only needs names.
Maybe --names-only and --name-status should suppress the SHA1 header to
match their descriptions? Unfortunately, they don't suppress the patch
is -p is specified, so "matching the descriptions" would have to take
care of it.
P.S. I consider printing the SHA1 header in git-diff-tree an
undocumented feature (in other words, a bug).
Proposed patch:
Don't print the SHA1 when only one tree-ish is given to git-diff-tree.
Signed-off-by: Pavel Roskin <proski@gnu.org>
diff --git a/diff-tree.c b/diff-tree.c
index 382011a..ac53f48 100644
--- a/diff-tree.c
+++ b/diff-tree.c
@@ -111,7 +111,6 @@ static int diff_tree_commit(const unsign
unsigned char parent[20];
if (get_sha1_hex(buf + offset + 7, parent))
return -1;
- header = generate_header(name, sha1_to_hex(parent), buf, size);
diff_tree_sha1_top(parent, commit, "");
if (!header && verbose_header) {
header_prefix = "\ndiff-tree ";
--
Regards,
Pavel Roskin
next reply other threads:[~2005-10-27 17:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-27 17:30 Pavel Roskin [this message]
2005-10-27 17:51 ` gitk shows an empty line between "Comments" and changed files Junio C Hamano
2005-10-28 1:36 ` Pavel Roskin
2005-10-28 9:13 ` Junio C Hamano
2005-10-28 22:45 ` Pavel Roskin
2005-10-28 23:00 ` Linus Torvalds
2005-10-29 2:49 ` Junio C Hamano
2005-10-29 3:07 ` Linus Torvalds
2005-10-29 4:23 ` Pavel Roskin
2005-10-29 4:33 ` Linus Torvalds
2005-10-29 4:54 ` Pavel Roskin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1130434230.19641.21.camel@dv \
--to=proski@gnu.org \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).