all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Tip: git commit-graph
@ 2023-10-11 10:51 Gerd Möllmann
  2023-10-11 16:17 ` Fu Yuan
  2023-10-11 17:12 ` Yuri Khan
  0 siblings, 2 replies; 6+ messages in thread
From: Gerd Möllmann @ 2023-10-11 10:51 UTC (permalink / raw)
  To: emacs-devel

A tip for people with slow machines,

https://devblogs.microsoft.com/devops/updates-to-the-git-commit-graph-feature/

This speeds up topological sorting of git commits, which is, for
instance, used in git log --graph, which in turn is default in Magit.

This is quite noticeable for me with Emacs' git repo (2,3 GHz Quad-Core
Intel Core i7, 16G RAM, SSD, so I thought it might be worth sharing :-).



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

* Re: Tip: git commit-graph
  2023-10-11 10:51 Tip: git commit-graph Gerd Möllmann
@ 2023-10-11 16:17 ` Fu Yuan
  2023-10-11 17:12 ` Yuri Khan
  1 sibling, 0 replies; 6+ messages in thread
From: Fu Yuan @ 2023-10-11 16:17 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: emacs-devel


> A tip for people with slow machines,
> 
> https://devblogs.microsoft.com/devops/updates-to-the-git-commit-graph-feature/
> 
> This speeds up topological sorting of git commits, which is, for
> instance, used in git log --graph, which in turn is default in Magit.
> 
> This is quite noticeable for me with Emacs' git repo (2,3 GHz Quad-Core
> Intel Core i7, 16G RAM, SSD, so I thought it might be worth sharing :-).
> 

This is great! Thanks you! I turned graph off in magit to speed up rendering. Now I can turn it back up again.

Yuan


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

* Re: Tip: git commit-graph
  2023-10-11 10:51 Tip: git commit-graph Gerd Möllmann
  2023-10-11 16:17 ` Fu Yuan
@ 2023-10-11 17:12 ` Yuri Khan
  2023-10-11 17:25   ` Gerd Möllmann
  1 sibling, 1 reply; 6+ messages in thread
From: Yuri Khan @ 2023-10-11 17:12 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: emacs-devel

On Wed, 11 Oct 2023 at 19:04, Gerd Möllmann <gerd.moellmann@gmail.com> wrote:

> A tip for people with slow machines,
>
> https://devblogs.microsoft.com/devops/updates-to-the-git-commit-graph-feature/
>
> This speeds up topological sorting of git commits, which is, for
> instance, used in git log --graph, which in turn is default in Magit.

This seems to have been turned on by default 4 years ago and present
in two latest Ubuntu LTS releases (20.04 and 22.04) and two latest
Debian stables (bullseye and bookworm), so… which categories of Git
users would not already have it by now?



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

* Re: Tip: git commit-graph
  2023-10-11 17:12 ` Yuri Khan
@ 2023-10-11 17:25   ` Gerd Möllmann
  2023-10-11 17:53     ` Yuri Khan
  0 siblings, 1 reply; 6+ messages in thread
From: Gerd Möllmann @ 2023-10-11 17:25 UTC (permalink / raw)
  To: Yuri Khan; +Cc: emacs-devel

Yuri Khan <yuri.v.khan@gmail.com> writes:

> On Wed, 11 Oct 2023 at 19:04, Gerd Möllmann <gerd.moellmann@gmail.com> wrote:
>
>> A tip for people with slow machines,
>>
>> https://devblogs.microsoft.com/devops/updates-to-the-git-commit-graph-feature/
>>
>> This speeds up topological sorting of git commits, which is, for
>> instance, used in git log --graph, which in turn is default in Magit.
>
> This seems to have been turned on by default 4 years ago and present
> in two latest Ubuntu LTS releases (20.04 and 22.04) and two latest
> Debian stables (bullseye and bookworm), so… which categories of Git
> users would not already have it by now?

I'm not sure what you mean by activated.

Do you mean that on these systems, .git/objects/info/callgraphs is
always generated?  I'm no macOS 14.0, BTW, and I'm pretty sure that it
wasn't generated, because of the speed difference I observe.



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

* Re: Tip: git commit-graph
  2023-10-11 17:25   ` Gerd Möllmann
@ 2023-10-11 17:53     ` Yuri Khan
  2023-10-11 18:30       ` Gerd Möllmann
  0 siblings, 1 reply; 6+ messages in thread
From: Yuri Khan @ 2023-10-11 17:53 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: emacs-devel

On Thu, 12 Oct 2023 at 00:25, Gerd Möllmann <gerd.moellmann@gmail.com> wrote:

> >> A tip for people with slow machines,
> >>
> >> https://devblogs.microsoft.com/devops/updates-to-the-git-commit-graph-feature/
> >>
> >> This speeds up topological sorting of git commits, which is, for
> >> instance, used in git log --graph, which in turn is default in Magit.
> >
> > This seems to have been turned on by default 4 years ago and present
> > in two latest Ubuntu LTS releases (20.04 and 22.04) and two latest
> > Debian stables (bullseye and bookworm), so… which categories of Git
> > users would not already have it by now?
>
> I'm not sure what you mean by activated.
>
> Do you mean that on these systems, .git/objects/info/callgraphs is
> always generated?  I'm no macOS 14.0, BTW, and I'm pretty sure that it
> wasn't generated, because of the speed difference I observe.

Hm. The article says

> In the recently released Git version 2.24.0, the commit-graph is enabled by default!

but what it actually seems to mean is that 2.24 changes the defaults
for two configuration variables to ‘true’:

* ‘core.commitGraph’ which instructs Git to *use* the file if present; and
* ‘gc.writeCommitGraph’ which instructs it to *create or update* the
file on every invocation of ‘git gc’.

So this answers my question: Users who have not run ‘git gc’ since
2019, or ‘git commit-graph write’ ever, will not already have a
serialized commit graph.



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

* Re: Tip: git commit-graph
  2023-10-11 17:53     ` Yuri Khan
@ 2023-10-11 18:30       ` Gerd Möllmann
  0 siblings, 0 replies; 6+ messages in thread
From: Gerd Möllmann @ 2023-10-11 18:30 UTC (permalink / raw)
  To: Yuri Khan; +Cc: emacs-devel

Yuri Khan <yuri.v.khan@gmail.com> writes:

>> In the recently released Git version 2.24.0, the commit-graph is enabled by default!
>
> but what it actually seems to mean is that 2.24 changes the defaults
> for two configuration variables to ‘true’:
>
> * ‘core.commitGraph’ which instructs Git to *use* the file if present; and
> * ‘gc.writeCommitGraph’ which instructs it to *create or update* the
> file on every invocation of ‘git gc’.

In addition to that I've added

  git config --global fetch.writeCommitGraph true

I think that's also from the article, not sure anymore.  And the write
I've done with

  git commit-graph write --reachable --changed-paths

because somewhere else it was suggested that that helps with the log of
single files.

> So this answers my question: Users who have not run ‘git gc’ since
> 2019, or ‘git commit-graph write’ ever, will not already have a
> serialized commit graph.

:-)



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

end of thread, other threads:[~2023-10-11 18:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-11 10:51 Tip: git commit-graph Gerd Möllmann
2023-10-11 16:17 ` Fu Yuan
2023-10-11 17:12 ` Yuri Khan
2023-10-11 17:25   ` Gerd Möllmann
2023-10-11 17:53     ` Yuri Khan
2023-10-11 18:30       ` Gerd Möllmann

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.