我想知道在 GUI ($git gui) 中單擊存盤庫/壓縮資料庫時執行的 git 命令究竟是什么?有人可以撰寫此選單選項中執行的內容嗎?

uj5u.com熱心網友回復:
我檢查了來源,這是它的作用:
${NS}::button $w.buttons.gc -text [mc "Compress Database"] \
34 -default normal \
35 -command "destroy $w;do_gc"
// < snip >
proc do_gc {} {
72 set w [console::new {gc} [mc "Compressing the object database"]]
73 console::chain $w {
74 {exec git pack-refs --prune}
75 {exec git reflog expire --all}
76 {exec git repack -a -d -l}
77 {exec git rerere gc}
所以有趣的部分(git 命令)是:
git pack-refs --prune
git reflog expire --all
git repack -a -d -l
git rerere gc
檔案在這里:
git pack-refs
git reflog
git repack
git rerere
uj5u.com熱心網友回復:
不知道是否有一種方法來跟蹤命令,因為它們運行,您可以嘗試激活之一git的跟蹤ENV變數啟動時git gui:
GIT_TRACE=1 git gui
但是,代碼實際上是可以訪問的:查看'repo.xml中的git-gui/git-gui.sh檔案git。
- 搜索
Compress database指向該檔案的線索, - 搜索
do_gc到該功能:
proc do_gc {} {
set w [console::new {gc} [mc "Compressing the object database"]]
console::chain $w {
{exec git pack-refs --prune}
{exec git reflog expire --all}
{exec git repack -a -d -l}
{exec git rerere gc}
}
}
(注:鏈接到2021-12-19分支master狀態的代碼)
uj5u.com熱心網友回復:
strace -qqv -f -e execve -e signal=\!all git gui
將向您展示確切的內容git gui及其所有子項 exec,一點點清理(在 vim 中:set nowrap|g/execve(/.,/ = 0$/j)讓我看著
[jthill@gadabout tmp.eEjBFrhhXH]$ strace -qqvfeexecve -e signal='!all' git gui
execve("/home/jthill/bin/git", ["git", "gui"], ["SHELL=/bin/bash", "SESSION_MANAGER=local/gadabout:@"..., "WINDOWID=50331678", "COLORTERM=truecolor", "XDG_CONFIG_DIRS=/home/jthill/.co"..., "LESS=FRX", "XDG_SESSION_PATH=/org/freedeskto"...,
[pid 278871] execve("/home/jthill/libexec/git-core/git-gui", ["/home/jthill/libexec/git-core/gi"...], ["CFLAGS=-march=native -pipe -Os ", "COLORTERM=truecolor", "CXXFLAGS=-march=native -pipe -Os"..., "DBUS_SESSION_BUS_ADDRESS=unix:pa"...,
[pid 278871] execve("/usr/bin/wish", ["wish", "/home/jthill/libexec/git-core/gi"..., "--"], ["SHELL=/bin/bash", "SESSION_MANAGER=local/gadabout:@"..., "WINDOWID=50331678", "COLORTERM=truecolor", "XDG_CONFIG_DIRS=/home/jthill/.co"..., "LESS
[pid 278872] execve("/home/jthill/libexec/git-core/git", ["/home/jthill/libexec/git-core/gi"..., "--version"], ["SHELL=/bin/bash", "SESSION_MANAGER=local/gadabout:@"..., "WINDOWID=50331678", "COLORTERM=truecolor", "XDG_CONFIG_DIRS=/home/jt
[pid 278873] execve("/home/jthill/libexec/git-core/git", ["/home/jthill/libexec/git-core/gi"..., "--exec-path"], ["SHELL=/bin/bash", "SESSION_MANAGER=local/gadabout:@"..., "WINDOWID=50331678", "COLORTERM=truecolor", "XDG_CONFIG_DIRS=/home/
[pid 278874] execve("/home/jthill/libexec/git-core/git-rev-parse", ["/home/jthill/libexec/git-core/gi"..., "--git-dir"], ["SHELL=/bin/bash", "SESSION_MANAGER=local/gadabout:@"..., "WINDOWID=50331678", "COLORTERM=truecolor", "XDG_CONFIG_DIR
[pid 278875] execve("/home/jthill/libexec/git-core/git-rev-parse", ["/home/jthill/libexec/git-core/gi"..., "--show-prefix"], ["SHELL=/bin/bash", "SESSION_MANAGER=local/gadabout:@"..., "WINDOWID=50331678", "COLORTERM=truecolor", "XDG_CONFIG
[pid 278876] execve("/home/jthill/libexec/git-core/git-config", ["/home/jthill/libexec/git-core/gi"..., "--null", "--list"], ["SHELL=/bin/bash", "SESSION_MANAGER=local/gadabout:@"..., "WINDOWID=50331678", "COLORTERM=truecolor", "XDG_CONFIG
[pid 278877] execve("/home/jthill/libexec/git-core/git-rev-parse", ["/home/jthill/libexec/git-core/gi"..., "--show-toplevel"], ["SHELL=/bin/bash", "SESSION_MANAGER=local/gadabout:@"..., "WINDOWID=50331678", "COLORTERM=truecolor", "XDG_CONF
[pid 278878] execve("/home/jthill/libexec/git-core/git-rev-parse", ["/home/jthill/libexec/git-core/gi"..., "--is-bare-repository"], ["SHELL=/bin/bash", "SESSION_MANAGER=local/gadabout:@"..., "WINDOWID=50331678", "COLORTERM=truecolor", "XDG
[pid 278879] execve("/home/jthill/libexec/git-core/git", ["/home/jthill/libexec/git-core/gi"..., "--html-path"], ["SHELL=/bin/bash", "SESSION_MANAGER=local/gadabout:@"..., "WINDOWID=50331678", "COLORTERM=truecolor", "XDG_CONFIG_DIRS=/home/
[pid 278880] execve("/home/jthill/libexec/git-core/aspell", ["aspell", "--mode=none", "--encoding=utf-8", "pipe"], ["SHELL=/bin/bash", "SESSION_MANAGER=local/gadabout:@"..., "WINDOWID=50331678", "COLORTERM=truecolor", "XDG_CONFIG_DIRS=/hom
[pid 278882] execve("/home/jthill/libexec/git-core/git-rev-parse", ["/home/jthill/libexec/git-core/gi"..., "--verify", "HEAD"], ["SHELL=/bin/bash", "SESSION_MANAGER=local/gadabout:@"..., "WINDOWID=50331678", "COLORTERM=truecolor", "XDG_CON
[pid 278883] execve("/home/jthill/libexec/git-core/git-update-index", ["/home/jthill/libexec/git-core/gi"..., "-q", "--unmerged", "--ignore-missing", "--refresh"], ["SHELL=/bin/bash", "SESSION_MANAGER=local/gadabout:@"..., "WINDOWID=503316
[pid 278892] execve("/home/jthill/libexec/git-core/git-diff-index", ["/home/jthill/libexec/git-core/gi"..., "--cached", "--ignore-submodules=dirty", "-z", "da4cafc2a0046d629716cac96875e1aa"...], ["SHELL=/bin/bash", "SESSION_MANAGER=local/g
[pid 278893] execve("/home/jthill/libexec/git-core/git-diff-files", ["/home/jthill/libexec/git-core/gi"..., "-z"], ["SHELL=/bin/bash", "SESSION_MANAGER=local/gadabout:@"..., "WINDOWID=50331678", "COLORTERM=truecolor", "XDG_CONFIG_DIRS=/hom
[pid 278894] execve("/home/jthill/libexec/git-core/git-ls-files", ["/home/jthill/libexec/git-core/gi"..., "--others", "-z", "--exclude-standard"], ["SHELL=/bin/bash", "SESSION_MANAGER=local/gadabout:@"..., "WINDOWID=50331678", "COLORTERM=t
[pid 278905] execve("/home/jthill/libexec/git-core/git-pack-refs", ["/home/jthill/libexec/git-core/gi"..., "--prune"], ["SHELL=/bin/bash", "SESSION_MANAGER=local/gadabout:@"..., "WINDOWID=50331678", "COLORTERM=truecolor", "XDG_CONFIG_DIRS=
[pid 278906] execve("/home/jthill/libexec/git-core/git-reflog", ["/home/jthill/libexec/git-core/gi"..., "expire", "--all"], ["SHELL=/bin/bash", "SESSION_MANAGER=local/gadabout:@"..., "WINDOWID=50331678", "COLORTERM=truecolor", "XDG_CONFIG_
[pid 278914] execve("/home/jthill/libexec/git-core/git-rerere", ["/home/jthill/libexec/git-core/gi"..., "gc"], ["SHELL=/bin/bash", "SESSION_MANAGER=local/gadabout:@"..., "WINDOWID=50331678", "COLORTERM=truecolor", "XDG_CONFIG_DIRS=/home/jt
[pid 278920] execve("/home/jthill/libexec/git-core/git-config", ["/home/jthill/libexec/git-core/gi"..., "gui.wmstate", "normal"], ["SHELL=/bin/bash", "SESSION_MANAGER=local/gadabout:@"..., "WINDOWID=50331678", "COLORTERM=truecolor", "XDG_C
[pid 278921] execve("/home/jthill/libexec/git-core/git-config", ["/home/jthill/libexec/git-core/gi"..., "gui.geometry", "923x419 997 602 191 190"], ["SHELL=/bin/bash", "SESSION_MANAGER=local/gadabout:@"..., "WINDOWID=50331678", "COLORTERM=
[jthill@gadabout tmp.eEjBFrhhXH]$
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/387328.html
