Re: [PATCH 3/2] Enhance --early-output format

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linus Torvalds
Date: Monday, November 5, 2007 - 1:47 pm

On Mon, 5 Nov 2007, Junio C Hamano wrote:

I'd almost prefer not to.

If people feel the code is subtle enough that a comment is in order to 
explain *what* something does, I would rather introduce helper functions 
than add comments. I'm not a big believer in comments in the middle of 
code to explain the code, but I *am* a big believer in trying to make the 
code easy to read without them.

(I don't dislike comments per se, but I'd *much* rather have the comments 
explain what is going on at a higher level. Comments that talk about the 
details of the code itself is likely bogus).

So we could add a commit to say what is going on ("ignore commits that 
have only one parent and didn't change the tree"), but I'd not want to 
explain why that particular layout of code.

That said, I've often found the "TREECHANGE" bit annoying. The fact that 
we always have to test it together with testing "rev->prune_fn" and often 
also the "rev->dense" flag is just annoying. I'd almost like to just 
always set the bit if "rev->prune_fn" isn't set. Alternatively, the code 
could be rewritten to just have a few inline helper functions, and it 
could perhaps be written as

	if (!(flags & TREECHANGE) && revs->dense && single_parent(commit))
		continue;

I dunno. I have no really *strong* opinions, although I suspect that 
anybody who looks at that particular piece of code had better understand 
these issues well enough anyway that it doesn't much matter..


I'm fine with it. The reason I did it the way I did was that this way I 
didn't need to change "gitk" - I could just use Pauls original patch 
as-is, since that code didn't care *what* came after the "Final output", 
and didn't care how many times it showed up.

			Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
New features in gitk, Paul Mackerras, (Sat Oct 27, 6:39 pm)
Re: New features in gitk, Linus Torvalds, (Sat Oct 27, 10:34 pm)
Re: New features in gitk, Paul Mackerras, (Sun Oct 28, 12:11 am)
Re: New features in gitk, Steffen Prohaska, (Sun Oct 28, 12:36 am)
Re: New features in gitk, Linus Torvalds, (Sun Oct 28, 9:50 am)
Re: New features in gitk, Pierre Habouzit, (Sun Oct 28, 11:32 am)
Re: New features in gitk, Mike Hommey, (Sun Oct 28, 11:38 am)
Re: New features in gitk, Paul Mackerras, (Sun Oct 28, 4:13 pm)
Re: New features in gitk, Pierre Habouzit, (Sun Oct 28, 11:20 pm)
Re: New features in gitk, Pierre Habouzit, (Sun Oct 28, 11:24 pm)
Re: New features in gitk, Jonathan del Strother, (Mon Oct 29, 1:31 am)
Re: New features in gitk, Han-Wen Nienhuys, (Mon Oct 29, 6:30 am)
Re: New features in gitk, Michele Ballabio, (Mon Oct 29, 7:04 am)
Re: New features in gitk, Paul Mackerras, (Thu Nov 1, 3:00 am)
Re: New features in gitk, Paul Mackerras, (Thu Nov 1, 4:37 am)
Re: New features in gitk, Linus Torvalds, (Thu Nov 1, 8:16 am)
Re: New features in gitk, Linus Torvalds, (Thu Nov 1, 8:47 am)
Re: New features in gitk, Linus Torvalds, (Thu Nov 1, 9:21 am)
Re: New features in gitk, Paul Mackerras, (Fri Nov 2, 3:19 am)
Re: New features in gitk, Marco Costalba, (Fri Nov 2, 5:44 am)
Re: New features in gitk, Linus Torvalds, (Fri Nov 2, 8:03 am)
Re: New features in gitk, Linus Torvalds, (Fri Nov 2, 8:42 am)
Re: New features in gitk, Marco Costalba, (Fri Nov 2, 9:50 am)
Re: New features in gitk, Linus Torvalds, (Fri Nov 2, 11:16 am)
Re: New features in gitk, Johannes Schindelin, (Fri Nov 2, 11:17 am)
[PATCH 0/2] History replay support, Linus Torvalds, (Fri Nov 2, 1:31 pm)
[PATCH 1/2] Simplify topo-sort logic, Linus Torvalds, (Fri Nov 2, 1:32 pm)
Re: [PATCH 0/2] History replay support, Linus Torvalds, (Fri Nov 2, 6:40 pm)
Re: [PATCH 0/2] History replay support, Marco Costalba, (Sat Nov 3, 12:56 am)
Re: [PATCH 0/2] History replay support, Paul Mackerras, (Sat Nov 3, 5:32 pm)
[PATCH 3/2] Enhance --early-output format, Linus Torvalds, (Sun Nov 4, 1:12 pm)
Re: [PATCH 3/2] Enhance --early-output format, Junio C Hamano, (Mon Nov 5, 1:24 pm)
Re: [PATCH 3/2] Enhance --early-output format, Linus Torvalds, (Mon Nov 5, 1:47 pm)
Re: [PATCH 3/2] Enhance --early-output format, Linus Torvalds, (Mon Nov 5, 2:22 pm)
Re: [PATCH 3/2] Enhance --early-output format, Linus Torvalds, (Mon Nov 5, 2:35 pm)
[PATCH 4/2] Fix parent rewriting in --early-output, Linus Torvalds, (Mon Nov 12, 9:58 pm)
Re: [PATCH 4/2] Fix parent rewriting in --early-output, Junio C Hamano, (Mon Nov 12, 10:43 pm)
Re: [PATCH 4/2] Fix parent rewriting in --early-output, Linus Torvalds, (Mon Nov 12, 11:46 pm)
Re: [PATCH 4/2] Fix parent rewriting in --early-output, Linus Torvalds, (Tue Nov 13, 12:16 am)
Re: [PATCH 4/2] Fix parent rewriting in --early-output, Sven Verdoolaege, (Tue Nov 13, 12:53 am)
Re: [PATCH 4/2] Fix parent rewriting in --early-output, Shawn O. Pearce, (Tue Nov 13, 1:01 am)
Re: [PATCH 4/2] Fix parent rewriting in --early-output, Junio C Hamano, (Tue Nov 13, 1:24 am)
Re: [PATCH 4/2] Fix parent rewriting in --early-output, Junio C Hamano, (Tue Nov 13, 1:48 am)
Re: [PATCH 4/2] Fix parent rewriting in --early-output, Paul Mackerras, (Tue Nov 13, 2:59 am)
Re: [PATCH 4/2] Fix parent rewriting in --early-output, Marco Costalba, (Fri Nov 16, 12:30 am)