threads / patch / 51967

patchgitk: Addressing error running on MacOS with large repos.

Subject: [PATCH 0/1] gitk: Addressing error running on MacOS with large repos.

## tl;dr

2 messages between Oct 3, 2019 and Oct 3, 2019. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Arash via GitGitGadget· Oct 3, 2019, 20:49 UTC · lore

gitk: no need to specify all refs, since git log --all is the same as list is all the refs/commit ids. Also Mac OS has a limit on size of the list of params for a command line

Arash Bannazadeh-Mahani (1):
  gitk: Addressing error running on MacOS with large repos.
 gitk-git/gitk | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
base-commit: bc12974a897308fd3254cf0cc90319078fe45eea
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-375%2Faxbannaz%2Fuse.all-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-375/axbannaz/use.all-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/375
-- 
gitgitgadget
Arash Bannazadeh-Mahani via GitGitGadget· Oct 3, 2019, 20:49 UTC · re: Arash via GitGitGadget · lore

[PATCH 1/1] gitk: Addressing error running on MacOS with large repos.

From: Arash Bannazadeh-Mahani <axbannaz@gmail.com>

The change is stemmed from a problem on the MacOS where, if --all is passed to gitk it should show all the refs/commits graphically. However, on really large git repos, in my instance a git repo with over 52,000 commits, gitk will report an error, "Error executing git log: couldn't execute "git": argument list too long". Mac OS has a limit of which my large repo exceeds. This works fine on Linux, however, not sure about Windows.

Looking at gitk script, the decision to have all commit-ids on the command line comes from return value of parseviewargs() function which uses the value of "allknown" to return. If it is '1' then --all is translated to a string of all the commit-ids in the repo, otherwise --all is passed as-is to `git log` cli, which according to git-log man page it is the same as listing all the commit-ids.

So, this change is to prevent --all option from being expanded into list of all refs on the command line.

Signed-off-by: Arash Bannazadeh-Mahani <axbannaz@gmail.com>
---
 gitk-git/gitk | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Show changes to gitk-git/gitk +6 −1
diff --git a/gitk-git/gitk b/gitk-git/gitk
index abe4805ade..96634d9d33 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -250,8 +250,13 @@ proc parseviewargs {n arglist} {
 		set nextisval 1
 		lappend glflags $arg
 	    }
-	    "--not" - "--all" {
+	    "--not" {
 		lappend revargs $arg
+	    }
+		"--all" {
+		# we recognize this argument;
+		# no expansion needed, use it with 'git log' as-is
+		set allknown 0
 	    }
 	    "--merge" {
 		set vmergeonly($n) 1
-- 
gitgitgadget

← back to recent threads