* [PATCH v3] gitk: Teach gitk to respect log.showroot
@ 2011-10-04 20:08 Marcus Karlsson
2011-10-08 6:47 ` Paul Mackerras
2012-03-18 22:53 ` Paul Mackerras
0 siblings, 2 replies; 5+ messages in thread
From: Marcus Karlsson @ 2011-10-04 20:08 UTC (permalink / raw)
To: paulus; +Cc: zbyszek, gitster, git
In early days, all projects managed by git (except for git itself) had the
product of a fairly mature development history in their first commit, and
it was deemed unnecessary clutter to show additions of these thousands of
paths as a patch.
"git log" learned to show the patch for the initial commit without requiring
--root command line option at 0f03ca9 (config option log.showroot to show
the diff of root commits, 2006-11-23).
Teach gitk to respect log.showroot.
Signed-off-by: Marcus Karlsson <mk@acc.umu.se>
---
Improved the commit message after suggestion from Zbigniew
Jedrzejewski-Szmek.
gitk-git/gitk | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/gitk-git/gitk b/gitk-git/gitk
index 4cde0c4..40ea73f 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -7402,7 +7402,7 @@ proc addtocflist {ids} {
}
proc diffcmd {ids flags} {
- global nullid nullid2
+ global log_showroot nullid nullid2
set i [lsearch -exact $ids $nullid]
set j [lsearch -exact $ids $nullid2]
@@ -7436,7 +7436,11 @@ proc diffcmd {ids flags} {
lappend cmd HEAD
}
} else {
- set cmd [concat | git diff-tree -r $flags $ids]
+ set cmd [concat | git diff-tree -r]
+ if {$log_showroot eq true} {
+ set cmd [concat $cmd --root]
+ }
+ set cmd [concat $cmd $flags $ids]
}
return $cmd
}
@@ -11403,6 +11407,11 @@ catch {
}
}
+set log_showroot true
+catch {
+ set log_showroot [exec git config --get log.showroot]
+}
+
if {[tk windowingsystem] eq "aqua"} {
set mainfont {{Lucida Grande} 9}
set textfont {Monaco 9}
--
1.7.7
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v3] gitk: Teach gitk to respect log.showroot
2011-10-04 20:08 [PATCH v3] gitk: Teach gitk to respect log.showroot Marcus Karlsson
@ 2011-10-08 6:47 ` Paul Mackerras
2011-10-12 14:36 ` Marcus Karlsson
2012-03-18 22:53 ` Paul Mackerras
1 sibling, 1 reply; 5+ messages in thread
From: Paul Mackerras @ 2011-10-08 6:47 UTC (permalink / raw)
To: Marcus Karlsson; +Cc: zbyszek, gitster, git
On Tue, Oct 04, 2011 at 10:08:13PM +0200, Marcus Karlsson wrote:
> Teach gitk to respect log.showroot.
Sounds reasonable, ...
> - set cmd [concat | git diff-tree -r $flags $ids]
> + set cmd [concat | git diff-tree -r]
> + if {$log_showroot eq true} {
> + set cmd [concat $cmd --root]
> + }
> + set cmd [concat $cmd $flags $ids]
but is there any reason not to do it like this?
if {$log_showroot} {
lappend flags --root
}
set cmd [concat | git diff-tree -r $flags $ids]
I.e., do you particularly want the --root before the other flags?
Paul.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3] gitk: Teach gitk to respect log.showroot
2011-10-08 6:47 ` Paul Mackerras
@ 2011-10-12 14:36 ` Marcus Karlsson
0 siblings, 0 replies; 5+ messages in thread
From: Marcus Karlsson @ 2011-10-12 14:36 UTC (permalink / raw)
To: Paul Mackerras; +Cc: zbyszek, gitster, git
On Sat, Oct 08, 2011 at 05:47:04PM +1100, Paul Mackerras wrote:
> On Tue, Oct 04, 2011 at 10:08:13PM +0200, Marcus Karlsson wrote:
> > Teach gitk to respect log.showroot.
>
> Sounds reasonable, ...
>
> > - set cmd [concat | git diff-tree -r $flags $ids]
> > + set cmd [concat | git diff-tree -r]
> > + if {$log_showroot eq true} {
> > + set cmd [concat $cmd --root]
> > + }
> > + set cmd [concat $cmd $flags $ids]
>
> but is there any reason not to do it like this?
>
> if {$log_showroot} {
> lappend flags --root
> }
> set cmd [concat | git diff-tree -r $flags $ids]
>
> I.e., do you particularly want the --root before the other flags?
>
> Paul.
Not really, that would work very well.
Marcus
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3] gitk: Teach gitk to respect log.showroot
2011-10-04 20:08 [PATCH v3] gitk: Teach gitk to respect log.showroot Marcus Karlsson
2011-10-08 6:47 ` Paul Mackerras
@ 2012-03-18 22:53 ` Paul Mackerras
2012-03-19 11:04 ` Zbigniew Jędrzejewski-Szmek
1 sibling, 1 reply; 5+ messages in thread
From: Paul Mackerras @ 2012-03-18 22:53 UTC (permalink / raw)
To: Marcus Karlsson; +Cc: zbyszek, gitster, git
On Tue, Oct 04, 2011 at 10:08:13PM +0200, Marcus Karlsson wrote:
> Teach gitk to respect log.showroot.
> +set log_showroot true
> +catch {
> + set log_showroot [exec git config --get log.showroot]
> +}
Since I mostly use gitk on the kernel, I'd prefer that log_showroot
defaults to false if it isn't specified in the git config file.
Defaulting to false would also be the smaller change in gitk
behaviour.
Paul.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3] gitk: Teach gitk to respect log.showroot
2012-03-18 22:53 ` Paul Mackerras
@ 2012-03-19 11:04 ` Zbigniew Jędrzejewski-Szmek
0 siblings, 0 replies; 5+ messages in thread
From: Zbigniew Jędrzejewski-Szmek @ 2012-03-19 11:04 UTC (permalink / raw)
To: Paul Mackerras; +Cc: Marcus Karlsson, gitster, git
On 03/18/2012 11:53 PM, Paul Mackerras wrote:
> On Tue, Oct 04, 2011 at 10:08:13PM +0200, Marcus Karlsson wrote:
>
>> Teach gitk to respect log.showroot.
>
>> +set log_showroot true
>> +catch {
>> + set log_showroot [exec git config --get log.showroot]
>> +}
>
> Since I mostly use gitk on the kernel, I'd prefer that log_showroot
> defaults to false if it isn't specified in the git config file.
> Defaulting to false would also be the smaller change in gitk
> behaviour.
I agree that in case of the kernel repo, log.showroot=false is more
useful. But this somewhat special use case should not decide the policy.
First of all, as an experienced git user you know how to set the config
option, if you dislike the default. This new default targets new users.
Secondly, this option only matters when you scroll all the way down and
click on first commit. Probably doesn't happen too often, since the time
required to read in the other ~300000 commit messages is pretty big too.
If you want to look at the root commit, it's probably because your
project started recently and your history is short. Thirdly, consistency
between git-log and gitk is important.
Zbyszek
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-03-19 11:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-04 20:08 [PATCH v3] gitk: Teach gitk to respect log.showroot Marcus Karlsson
2011-10-08 6:47 ` Paul Mackerras
2011-10-12 14:36 ` Marcus Karlsson
2012-03-18 22:53 ` Paul Mackerras
2012-03-19 11:04 ` Zbigniew Jędrzejewski-Szmek
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).