git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* gitk shows an empty line between "Comments" and changed files
@ 2005-10-27 17:30 Pavel Roskin
  2005-10-27 17:51 ` Junio C Hamano
  0 siblings, 1 reply; 11+ messages in thread
From: Pavel Roskin @ 2005-10-27 17:30 UTC (permalink / raw)
  To: git

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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2005-10-29  4:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-27 17:30 gitk shows an empty line between "Comments" and changed files Pavel Roskin
2005-10-27 17:51 ` 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

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).