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

Re: [PATCH] Limited git-gui to displaying 5000 new files

From
Shawn O. Pearce <spearce@spearce.org>
Date
Aug 10, 2009, 15:38 UTC
Message-ID
<20090810153859.GT1033@spearce.org>
In-Reply-To
<4A4A77A6.1020905@lawrence.edu>
Dan Zwell <dzwell@gmail.com> wrote:
Show 6 quoted lines
> When there is a large number of new or modified files,
> "display_all_files" takes a long time, and git-gui appears to
> hang. Limit the display to 5000 files, by default. This number
> is configurable as gui.maxfilesdisplayed.
>
> Show a warning if the list of files is truncated.
Show 7 quoted lines
> @@ -1713,7 +1717,18 @@ proc display_all_files {} {
> 	set file_lists($ui_index) [list]
> 	set file_lists($ui_workdir) [list]
>
> -	foreach path [lsort [array names file_states]] {
> +	set to_display [lsort [array names file_states]]
> +	set display_limit $default_config(gui.maxfilesdisplayed)

This should use [get_config gui.maxfilesdisplayed] so that the user can actually set this property in a configuration file and have git-gui honor it. Reading from $default_config means you are only looking at the hardcoded value you set in git-gui.sh.

> +	if {[llength $to_display] > $display_limit} {
> +		if {![info exists files_warning] || !$files_warning} {

Wouldn't it be easier to just set files_warning to 0 at the start of the script, so that you don't need to do this info exists test?

> +			set warning "Displaying only $display_limit of "
> +			append warning "[llength $to_display] files."
> +			info_popup [mc $warning]
This needs to be in the translated strings.
-- 
Shawn.
Previous: Dan ZwellNext: Alex Riesen
Message 2 of 12 in “Limited git-gui to displaying 5000 new files”
  1. Limited git-gui to displaying 5000 new filesDan Zwell, Jun 30, 2009
  2. Shawn O. PearceAug 10, 2009
  3. Alex RiesenAug 10, 2009
  4. Shawn O. PearceAug 10, 2009
  5. Dan ZwellAug 10, 2009
  6. Dan ZwellAug 11, 2009
  7. Shawn O. PearceAug 11, 2009
  8. Dan ZwellAug 11, 2009
  9. Shawn O. PearceAug 12, 2009
  10. git-gui: Update russian translationAlex Riesen, Aug 12, 2009
  11. Shawn O. PearceAug 12, 2009
  12. Dan ZwellAug 12, 2009

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.