threads / discuss / 11623

Print Precedes/Follows in git log

Subject: Print Precedes/Follows in git log

## tl;dr

2 messages between Jan 14, 2008 and Jan 15, 2008.

replies: 1people: 2as markdown or json

Jan Engelhardt· Jan 14, 2008, 23:34 UTC · lore
Hi,

gitk has a nice feature in that, when a commit is selected, it prints in the log window something like:

(id 1beeffe43311f64df8dd0ab08ff6b1858c58363f)
Author: Tony Jones <tonyj@suse.de>  2007-08-20 22:46:20
Committer: Mark M. Hoffman <mhoffman@lightlink.com>  2007-10-10 04:56:30
Parent: 8afb10490b18e916e33707baa7d1cfc615d545ea (hwmon: (f71882fg) trivial whitespace cleanup)
Branches: ...
Follows: v2.6.23
Precedes: v2.6.24-rc1

And it would be really nice if `git log` would also show the Precedes/Follows lines so one can identify much more easily in big logs like those of the Linux kernel what the next release to have a given patch is.

thanks, Jan

Marco Costalba· Jan 15, 2008, 06:38 UTC · re: Jan Engelhardt · lore

Re: Print Precedes/Follows in git log

On Jan 15, 2008 12:34 AM, Jan Engelhardt <jengelh@computergmbh.de> wrote:
Show 7 quoted lines
>
> And it would be really nice if `git log` would also show the
> Precedes/Follows lines so one can identify much more easily in
> big logs like those of the Linux kernel what the next release to
> have a given patch is.
>
>

You need two complete revisions walk for this, one from the newest to oldset to compute the 'precedes' and one from the oldest to newest to compute the 'follows', so I would say it's more suitable used together with --topo-order option of git log that already does a walk, at least the slowdown is hidden in this case.

Anyhow being able to compute precedes/following info in timely fashion and with low memory consumption is quite not trivial code, I have implemented for qgit long time ago and I remember gave a kook at the gitk code for reference also if at the end my implementation it's a bit different (less memory used but slightly more complicated).

Just to give an idea of timing, on my new and awesome ;-) laptop loading full Linux tree it takes 3316ms, then calculating precedes/follows info (indexing the tree) it takes 233ms.

Perhaps the slowest part is to load refs info, you need this to know what sha a tag/branch has and is a prerequisite to indexing, also if refs are compacted it takes almost 1 second on my PC because there is heavy disk activity in any case.

Marco

← back to recent threads