jargij / gource

Automatically exported from code.google.com/p/gource
0 stars 0 forks source link

Add option to toggle git log --cc for less touching #12

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
The default git log command does not include --cc.  Without --cc, many of
the easy merges show up and pollute the visualization, by making it look
like one user has touched files that they really have not.  With --cc,
these easy merges do not show up, and the visualization is less frenetic
and shows a truer picture of who touched what.

What is the expected output? What do you see instead?
I use Git in the classroom, and the course starts with each student working
in their own directory sandbox, but all against a common repo.  If Alice
spends all day working in /a/ and Bob spends all day working in /b/, as
they pull and push from and to each other the merges make it look like they
are touching each other's code, when they really aren't -- they're just
syncing up.

What version of the product are you using? On what operating system?
6ebd65..970fea, Mac Leopard

Please provide any additional information below.
I'm not a Git guru, so I'm sure someone can come up with a good reason why
this shouldn't be the default behavior.  But, it'd be nice if Gource had a
--less-touching or --hide-uninteresting option that translated into git log
--cc.

For example, without --cc the log looks like this:

    user:Alice
    1256671117
    user:Bob
    1256671002
    user:Charlie
    1256671115
    :000000 100644 0000000... e69de29... A  charlie/one.txt
    :000000 100644 0000000... e69de29... A  charlie/two.txt

With --cc, the git log looks like this: 

    user:Alice
    1256671117

    user:Bob
    1256671002

    user:Charlie
    1256671115
    :000000 100644 0000000... e69de29... A  charlie/one.txt
    :000000 100644 0000000... e69de29... A  charlie/two.txt

Those extra line breaks make all the difference.

The workaround is, of course:

    git log --pretty=format:user:%aN%n%ct --reverse --raw --encoding=UTF-8
--no-renames --cc | gource --log-format git -

Original issue reported on code.google.com by delive...@gmail.com on 3 Nov 2009 at 3:20

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Hi. I'm a bit confused by your example, I'm guessing you left something out by 
accident.

If I use --cc with git log on the Gource repo I see 3 additional changes marked 
with
an MM:

    ::100644 100644 100644 da250cd... bab26a3... 0c51408... MM    src/gource.cpp

    ...

    ::100644 100644 100644 d93d910... 5e688e1... 8011ad3... MM    src/gource.cpp
    ::100644 100644 100644 88850c3... a56fa21... e24c4c5... MM    src/main.cpp

Kind of makes me wonder if the behavior has been changed between git log 
versions.

Original comment by acaudw...@gmail.com on 4 Nov 2009 at 4:48

GoogleCodeExporter commented 8 years ago
Hmm.  I'm using Git v1.6.5, but I think we're seeing the same things.  In my 
diff of
the two methods on the Gource repo, I see:

@@ -493,6 +497,7 @@

 user:Andrew Caudwell
 1253763688
+
 user:Sebastian Hahn
 1253764253
 :100644 100644 9cec467... e6f0e7a... M README
@@ -552,6 +557,7 @@

 user:Andrew Caudwell
 1254215542
+
 user:Jeff King
 1254269900
 :100644 100644 8a9e365... 2a98799... M src/git.cpp

(There's more to the diff, but that's the relevant part.)

In both cases, the git log now has an extra line break between the two different
users.  This causes Gource to ignore the first user (who only merged the 
codelines
but didn't actually touch the files) and only show the second user as touching 
the
file (with the beam).

It's not so pronounced in the Gource repo, but my students are using the repo 8 
hours
per day or more, committing roughly every 30 minutes.  This leads to dozens of 
merges
per day, and the changes are far more obvious.  When the merges are counted, it 
looks
like students are all over the place, writing to each other's files.

I don't know that I want to post a git log to a public forum such as this, but 
I'd be
happy to email (a moderately anonymized) one to you so that you could see the 
difference.

Original comment by delive...@gmail.com on 4 Nov 2009 at 5:19

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I thought some more about this and realised I could fix this in the commit 
parser
rather than change the log command.

I've made the Git log parser use the LAST username and timestamp before the 
list of
files rather than the first.

Could you have a go with the updated archive and see if it looks right now?

http://gource.googlecode.com/files/gource-0.16-beta2.tar.gz

Cheers

Original comment by acaudw...@gmail.com on 6 Nov 2009 at 10:39

GoogleCodeExporter commented 8 years ago
Works like a champ, as near as I can tell.  Thanks!

Original comment by delive...@gmail.com on 6 Nov 2009 at 11:59