git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Fast access git-rev-list output: some OS knowledge required

From
Shawn Pearce <spearce@spearce.org>
Date
Dec 6, 2006, 19:51 UTC
Message-ID
<20061206195142.GE20320@spearce.org>
In-Reply-To
<20061206194258.GD20320@spearce.org>
Shawn Pearce <spearce@spearce.org> wrote:
> I think all you may need is:
> 
> 	#include "revision.h"
> 	...
You'll also need to call:
	setup_git_directory();
before any of the below; but that should be done once per process.
Show 5 quoted lines
> 	struct rev_info revs;
> 	init_revisions(&revs, prefix);
> 	revs.abbrev = 0;
> 	revs.commit_format = CMIT_FMT_UNSPECIFIED;
> 	argc = setup_revisions(argc, argv, &revs, NULL);

Although now that I think about it the library may not be enough of a library. Some data (e.g. commits) will stay in memory forever once loaded. Pack files won't be released once read; a pack recently made available while the application is running may not get noticed.

Perhaps there is some fast IPC API supported by Qt that you could use to run the revision listing outside of the main UI process, to eliminate the bottlenecks you are seeing and remove the problems noted above? One that doesn't involve reading from a pipe I mean...

Previous: Shawn PearceNext: Marco Costalba
Message 5 of 17 in “Fast access git-rev-list output: some OS knowledge required”
  1. Marco CostalbaDec 6, 2006
  2. Shawn PearceDec 6, 2006
  3. Marco CostalbaDec 6, 2006
  4. Shawn PearceDec 6, 2006
  5. Shawn PearceDec 6, 2006
  6. Marco CostalbaDec 6, 2006
  7. Shawn PearceDec 6, 2006
  8. Andreas EricssonDec 7, 2006
  9. Johannes SchindelinDec 7, 2006
  10. Andreas EricssonDec 7, 2006
  11. Johannes SchindelinDec 7, 2006
  12. Marco CostalbaDec 8, 2006
  13. Michael K. EdwardsDec 8, 2006
  14. Marco CostalbaDec 9, 2006
  15. Johannes SchindelinDec 6, 2006
  16. Linus TorvaldsDec 7, 2006
  17. Marco CostalbaDec 7, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.