我如何知道 `git gc --auto` 是否做了什么?

2023-12-14

我在跑git gc --auto作为自动保存脚本的一部分。我想进行进一步的清理,如果git gc --auto已经做了一些事情,但我想避免麻烦,如果git gc --auto感觉不需要做某事。有没有办法检查返回值git gc --auto,或者事先检查是否有必要运行它?


2020 年 9 月更新:您不必只运行git gc --auto作为自动保存脚本的一部分。

老人 ”gc“ 现在可以被新的取代git maintenance run --auto.
它可以显示它正在做什么。

With Git 2.29 (Q4 2020), A "git gc"(man)'s big brother has been introduced to take care of more repository maintenance tasks, not limited to the object database cleaning.

See commit 25914c4, commit 4ddc79b, commit 916d062, commit 65d655b, commit d7514f6, commit 090511b, commit 663b2b1, commit 3103e98, commit a95ce12, commit 3ddaad0, commit 2057d75 (17 Sep 2020) by Derrick Stolee (derrickstolee).
(Merged by Junio C Hamano -- gitster -- in commit 48794ac, 25 Sep 2020)

maintenance:创建基本维护运行程序

Helped-by: Jonathan Nieder
Signed-off-by: Derrick Stolee

内置的“gc”是我们当前自动维护存储库的入口点。这一工具可以执行许多操作,例如:

  • 重新打包存储库,
  • 包装参考文献,以及
  • 重写提交图文件。

顾名思义,它执行“垃圾收集”,这意味着几个不同的事情,并且某些用户可能不希望使用此重写整个对象数据库的操作。

创建一个新的 'maintenance' 内置命令将成为更通用的命令。

首先,它只支持 'run' 子命令,但稍后将扩展以添加用于在后台安排维护的子命令。

目前,'maintenance'内置的是一个薄垫片'gc' 内置。
事实上,唯一的选择是“--auto' 切换,直接传递给 'gc' 内置。
当前的更改与这个简单的操作隔离,以防止在添加新内置函数的所有样板中丢失更有趣的逻辑。

Use existing builtin/gc.c file because we want to share code between the two builtins.
It is possible that we will have 'maintenance' replace the 'gc' builtin entirely at some point, leaving 'git gc(man)' as an alias for some specific arguments to 'git maintenance run'.

创建一个新的test_subcommand帮助器允许我们测试某个子命令是否运行。它需要存储GIT_TRACE2_EVENT登录到一个文件中。
否定模式可用,将在以后的测试中使用。

(最后一部分是确定新的方法git maintainance run --auto做某事)

git maintenance现在包含在其man page:

git 维护(1)

NAME

git-maintenance- 运行任务来优化 Git 存储库数据

SYNOPSIS

[verse]
'git maintenance' run [<options>]

描述

运行任务来优化 Git 存储库数据,加快其他 Git 命令的速度 并减少存储库的存储要求。

添加存储库数据的 Git 命令,例如git add or git fetch, 针对响应式用户体验进行了优化。这些命令不采取 是时候优化 Git 数据了,因为这种优化会随着整个系统的扩展而扩展 存储库的大小,而这些用户命令各自执行相对 小动作。

The git maintenance命令为如何优化提供了灵活性 Git 存储库。

子命令

run

运行一项或多项维护任务。

TASKS

gc

清理不必要的文件并优化本地存储库。 “GC” 代表“垃圾收集”,但此任务执行许多操作 较小的任务。对于大型存储库来说,此任务可能会很昂贵, 因为它将所有 Git 对象重新打包到一个包文件中。还可以 在某些情况下会造成破坏,因为它会删除陈旧的数据。看git gc有关 Git 中垃圾收集的更多详细信息。

OPTIONS

--auto

当与run子命令,运行维护任务 仅当满足某些阈值时。例如,gc任务 当松散对象的数量超过存储的数量时运行 在里面gc.auto配置设置,或者当包文件的数量 超过gc.autoPackLimit配置设置。


maintenance: 代替run_auto_gc()

Signed-off-by: Derrick Stolee

The run_auto_gc() method is used in several places to trigger a check for repo maintenance after some Git commands, such as 'git commit'(man) or 'git fetch'(man).

To allow for extra customization of this maintenance activity, replace the 'git gc --auto [--quiet](man)' call with one to 'git maintenance run --auto [--quiet](man)'.
As we extend the maintenance builtin with other steps, users will be able to select different maintenance activities.

Rename run_auto_gc() to run_auto_maintenance()更清楚地了解此调用中发生的情况,并公开当前差异中的所有调用者。重写方法以使用结构体child_process稍微简化调用。

Since 'git fetch'(man) already allows disabling the 'git gc --auto'(man) subprocess, add an equivalent option with a different name to be more descriptive of the new behavior: '--[no-]maintenance'.

fetch-options现在包含在其man page:

Run git maintenance run --auto最后执行自动 如果需要的话,存储库维护。 (--[no-]auto-gc是同义词。)
默认情况下启用此功能。

git clone现在包含在其man page:

它会自动调用git maintenance run --auto. (See git maintenance.)


另外,您的保存脚本将能够使git maintenance做的比git gc曾经可以,感谢tasks.

maintenance: 添加 --task 选项

Signed-off-by: Derrick Stolee

用户可能只想按特定顺序运行某些维护任务。

Add the --task=<task>选项,它允许用户指定要运行的任务的有序列表。但是,这些不能多次运行。

这是我们的数组的位置maintenance_task指针变得至关重要。我们可以根据任务顺序对指针数组进行排序,但我们不想移动结构数据本身以保留哈希图引用。我们使用 hashmap 将 --task= 参数匹配到任务结构数据中。

请记住,'enabled' 的成员maintenance_taskstruct 是未来的占位符 'maintenance.<task>.enabled' 配置选项。因此,我们使用 'enabled' 成员指定当用户未指定任何任务时运行哪些任务--task=<task>论据。
The 'enabled' 成员应该被忽略,如果--task=<task>出现。

git maintenance现在包含在其man page:

运行一项或多项维护任务。如果有一个或多个--task=<task>指定选项,然后这些任务在提供的中运行 命令。否则,只有gc任务已运行。

git maintenance现在包含在其man page:

--task=<task>

如果此选项被指定一次或多次,则仅运行 按指定顺序执行指定任务。请参阅“任务”部分 对于已接受的名单<task> values.

And:

maintenance:创建维护..启用配置

Signed-off-by: Derrick Stolee

Currently, a normal run of "git maintenance run"(man) will only run the 'gc' task, as it is the only one enabled.
This is mostly for backwards-compatible reasons since "git maintenance run --auto"(man) commands replaced previous "git gc --auto" commands after some Git processes.

用户可以通过调用“git maintenance run --task=<task>“ 直接地。

允许用户使用 config 自定义自动运行哪些步骤。这 'maintenance.<task>.enabled' 选项然后可以打开这些其他任务(或关闭 'gc' task).

git config现在包含在其man page:

maintenance.<task>.enabled

该布尔配置选项控制是否执行维护任务 有名字<task>当没有时运行--task选项指定为git maintenance run。如果出现以下情况,这些配置值将被忽略--task选项存在。
默认情况下,仅maintenance.gc.enabled是真的。

git maintenance现在包含在其man page:

运行一项或多项维护任务。如果有一个或多个--task选项 指定后,这些任务将按该顺序运行。否则, 任务由以下因素决定maintenance.<task>.enabled配置选项是正确的。
默认情况下,仅maintenance.gc.enabled是真的。

git maintenance现在也包括在其man page:

If no --task=<task>指定了参数,那么只有带有maintenance.<task>.enabled配置为true被考虑。


另一种方式来了解是否是新的git maintenance run目前正在做的事情就是检查锁(.git/maintenance.lock file):

maintenance:锁定对象目录

Signed-off-by: Derrick Stolee

Performing maintenance on a Git repository involves writing data to the .git directory, which is not safe to do with multiple writers attempting the same operation.
Ensure that only one 'git maintenance'(man) process is running at a time by holding a file-based lock.

简单来说就是存在.git/maintenance.lock文件将妨碍将来的维护。该锁永远不会被提交,因为它不代表有意义的数据。相反,它只是一个占位符。

If the lock file already exists, then no maintenance tasks are attempted. This will become very important later when we implement the 'prefetch' task, as this is our stop-gap from creating a recursive process loop between 'git fetch'(man) ' and 'git maintenance run --auto(man).


您还可以检查是否git gc/git maintenance will必须做任何事。

With Git 2.29 (Q4 2020), A "git gc"(man) 's big brother has been introduced to take care of more repository maintenance tasks, not limited to the object database cleaning.

See commit 25914c4, commit 4ddc79b, commit 916d062, commit 65d655b, commit d7514f6, commit 090511b, commit 663b2b1, commit 3103e98, commit a95ce12, commit 3ddaad0, commit 2057d75 (17 Sep 2020) by Derrick Stolee (derrickstolee).
(Merged by Junio C Hamano -- gitster -- in commit 48794ac, 25 Sep 2020)

maintenance: 使用指针来检查--auto

Signed-off-by: Derrick Stolee

The 'git maintenance run(man) ' command has an '--auto' option. This is used by other Git commands such as 'git commit(man) ' or 'git fetch(man) ' to check if maintenance should be run after adding data to the repository.

Previously, this --auto option was only used to add the argument to the 'git gc'(man) command as part of the 'gc' task.
We will be expanding the other tasks to perform a check to see if they should do work as part of the --auto flag, when they are enabled by config.

  • First, update the 'gc' task to perform the auto check inside the maintenance process.
    This prevents running an extra 'git gc --auto'(man) command when not needed.
    It also shows a model for other tasks.

  • 其次,使用 'auto_condition'函数指针作为我们是否启用维护任务的信号'--auto'.
    例如,我们不想在“--auto' 模式,这样函数指针将保留NULL.

We continue to pass the '--auto' option to the 'git gc'(man) command when necessary, because of the gc.autoDetach config option changes behavior.
Likely, we will want to absorb the daemonizing behavior implied by gc.autoDetach as a maintenance.autoDetach config option.


为了说明什么git maintenance会那么做git gc won't:

maintenance: 添加提交图任务

Signed-off-by: Derrick Stolee

The first new task in the 'git maintenance(man) ' builtin is the 'commit-graph' task.
This updates the commit-graph file incrementally with the command

git commit-graph write --reachable --split  

通过使用“编写增量提交图文件--split“我们可以选择尽量减少此次操作的干扰。

默认行为是合并图层,直到新的“顶部”图层小于下面图层大小的一半。这在大多数情况下提供快速写入,较长的写入遵循幂律分布。

最重要的是,并发 Git 进程只会在很短的时间内查看提交图链文件,因此当我们尝试替换该文件时,它们很可能不会持有该文件的句柄。 (这仅在 Windows 上重要。)

如果并发进程读取旧的提交图链文件,但我们的作业使某些.graph文件,然后这些进程将看到一条警告消息(但不会失败)。将来的更新可以避免这种情况--expire-time编写提交图时的参数。

git maintenance现在包含在其man page:

commit-graph

The commit-graph工作更新commit-graph增量文件, 然后验证写入的数据是否正确。

增量式 write 可以安全地与并发 Git 进程一起运行,因为它 不会过期.graph之前的文件commit-graph-chain文件。它们将被稍后基于运行的 关于过期延迟。

And:

maintenance:添加自动条件commit-graph task

Signed-off-by: Derrick Stolee

Instead of writing a new commit-graph in every 'git maintenance run --auto'(man) process (when maintenance.commit-graph.enabled is configured to be true), only write when there are "enough" commits not in a commit-graph file.

该计数由控制maintenance.commit-graph.auto配置选项。

要计算计数,请使用从每个 ref 开始的深度优先搜索,并使用SEEN flag.
如果此计数达到限制,则提前终止并开始任务。
否则,此操作将剥离每个引用并解析它指向的提交。如果这些都在commit-graph,那么这通常是一个非常快的操作。

拥有许多引用的用户可能会感到速度变慢,因此可以考虑将其限制更新为非常小。负值将强制该步骤每次都运行。

git config现在包含在其man page:

maintenance.commit-graph.auto

这个整数配置选项控制频率commit-graph任务 应该作为一部分运行git maintenance run --auto.

  • 如果为零,则commit-graph任务将不会运行--auto option.
  • 负值将强制任务每次都运行。
  • 否则,正值意味着该命令应在以下数量时运行: 不在提交图文件中的可到达提交至少是 的价值maintenance.commit-graph.auto.

默认值为 100。


With Git 2.30 (Q1 2021), the test-coverage enhancement of running commit-graph task "git maintenance"(man) as needed led to discovery and fix of a bug.

See commit d334107 (12 Oct 2020), and commit 8f80180 (08 Oct 2020) by Derrick Stolee (derrickstolee).
(Merged by Junio C Hamano -- gitster -- in commit 0be2d65, 02 Nov 2020)

maintenance:测试提交图自动条件

Signed-off-by: Derrick Stolee

自动条件为commit-graph维护任务遍历 refs 寻找不在commit-graph file.
这是添加在4ddc79b2 ("maintenance:为提交图任务添加自动条件”,2020-09-17,Git v2.29.0-rc0 --merge列于第 17 批)但未经测试。

此更改的最初目标是通过添加测试来证明该功能正常工作。然而,有一个相差一的错误导致了基本测试maintenance.commit-graph.auto=1在应该起作用的时候却失败了。

微妙之处在于,如果裁判提示不在commit-graph,那么我们就不会将其添加到总数中。在测试中,我们看到自上次提交图写入以来我们只添加了一次提交,因此自动条件会说没有什么可做的。

修复方法很简单:添加对commit-graph位置以查看尖端不在commit-graph在开始步行之前归档。由于这是在添加到 DFS 堆栈之前发生的,因此我们不需要清除(当前为空的)提交列表。

This does add some extra complexity for the test, because we also want to verify that the walk along the parents actually does some work. This means we need to add at least two commits in a row without writing the commit-graph. However, we also need to make sure no additional refs are pointing to the middle of this list or else the for_each_ref() in should_write_commit_graph() might visit these commits as tips instead of doing a DFS walk. Hence, the last two commits are added with "git commit"(man) instead of "test_commit".


With Git 2.30 (Q1 2021), "git maintenance(man) run/start/stop" needed to be run in a repository to hold the lockfile they use, but didn't make sure they are actually in a repository, which has been corrected.

See commit 0a1f2d0 (08 Dec 2020) by Josh Steadmon (steadmon).
See commit e72f7de (26 Nov 2020) by Rafael Silva (raffs).
(Merged by Junio C Hamano -- gitster -- in commit f2a75cb, 08 Dec 2020)

maintenance:修复没有存储库时的 SEGFAULT

Signed-off-by: Rafael Silva
Reviewed-by: Derrick Stolee

The "git maintenance run git"(man) and "git maintenance start/stop" commands holds a file-based lock at the .git/maintenance.lock and .git/schedule.lock respectively. These locks are used to ensure only one maintenance process is executed at the time as both operations involves writing data into the repository.

锁定文件的路径是使用构建的"the_repository->对象->odb->路径” that results in SEGFAULT when we have no repository available as `"`the_repository->objects->odb"被设定为NULL.

让我们教一下维护命令的使用RUN_SETUP选项将提供验证并在存储库外部运行时失败。因此修复了所有三个操作的 SEGFAULT 并使所有子命令的行为一致。

设置RUN_SETUP鉴于“注册”和“取消注册”也需要在存储库内执行,还为所有子命令提供相同的保护。

此外,让我们删除由“注册”和“取消注册”实现的本地验证,因为新选项不再需要此操作。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

我如何知道 `git gc --auto` 是否做了什么? 的相关文章

  • Git 中的“分支提示”是什么?

    我正在学习 Git 并阅读专业 Git 书籍 https git scm com book en v2 书中和 Stack Overflow 上有时会使用术语 分支提示 但我找不到它的含义 分支提示是分支上的最后一次提交或最近一次提交 基本
  • 合并之间的 git rebase 会导致完全不相关的文件发生冲突

    我有一个大型 Git 存储库 几个月前引入了一个错误 我想bisect它 首先引入一个过去的提交 存储库 然后重播合并 做rebase到新的 commit 如下图所示 据我了解 由于合并 Git 似乎无法正常工作 预期的 但我想更好地了解为
  • 如何在本地快速拉取拉取请求

    在合并拉取请求之前 我想在本地快速拉取请求并运行测试并测试一些内容 我还不想点击 gihub 合并拉取请求 我以为滑轮会有帮助http ejohn org blog pulley http ejohn org blog pulley 但我收
  • 如何查看 github 的 SSH 密钥?

    我最近收到一封来自 Github 的电子邮件 要求我检查我的 SSH 密钥 请检查您的钥匙并确保您 认出他们 如果您有任何疑问 请拒绝钥匙并 上传新密钥 如何在 ubuntu 11 10 上使用 git 检查我的密钥 您可以按照 GitHu
  • 如何使用 vim 作为“git show”编辑器?

    全部如所述如何使用 vim 作为 git log 编辑器 https stackoverflow com questions 16666009 how do i use vim as git log editor不适用于 git show
  • 如何在Windows上分离“Git bash”中启动的“git gui”?

    例如 我开始 git bash 我导航到某个目录 I start git gui 我关闭控制台窗口或按 Ctrl C Git gui 的窗口消失了 即使我用过git gui disown 即使当我按 Ctrl C 时它不在前台 如何正确分离
  • 如何解决 VS Code 中变基拉取的合并冲突?

    当我做一个git pull rebase 并且我的提交中存在合并冲突 我得到冲突差异视图 解决所有冲突并暂存文件 然后呢 我可以打开终端并运行git rebase continue但是 VS Code 中不应该有一个按钮来完成变基吗 只需使
  • 如何将 GIT 调用的输出获取到批处理脚本中的变量中?

    我有一个 git 命令来获取当前存储库的最新 SHA 如下所示 git log pretty format H n 1 我有一个 Windows 批处理脚本 我想按如下方式使用它 SET CURRENT SHA 但我不知道如何将从 git
  • 我在哪里? *(无分支)

    我已经熟悉了创建 合并和删除分支 我想知道我在哪里 这样我就不会将工作提交到错误的分支 我用git branch a看看我有哪些分支 我认为星号 显示我当前所在的分支 当我得到以下信息时 这意味着什么 no branch master or
  • Git post-receive - 如何检查推送的分支是否与主分支合并

    在我们的团队中 我们通常将所有任务推送到单独的分支中 然后发布经理审查这些分支并将它们合并到 主 分支中 有时团队成员忘记将他们的分支与主分支合并 在推送之前 所以我想做的是 在用户推送后输出一条消息 请与主分支合并 我想我需要检查一些内容
  • 从自己的 gitlab 服务器安装节点模块

    我想从我们的 gitlab 服务器安装节点模块 这是存储库的链接 http ABCD GITLAB myGroup myNodeModule git http ABCD GITLAB myGroup myNodeModule git 根据n
  • 自动同步两个 git 存储库

    是否可以保持同步两个 Github 存储库 远程 的特定文件夹 有两个 github 存储库 repoA 和 repoB 这两个存储库都有名为 ABC 的文件夹以及其他独特的文件夹 如果repoA的文件夹ABC中的任何文件有更新 我想自动更
  • 清理远程 Git 分支

    我已经将 SVN 存储库移至 Git 可能由于多次克隆 我现在只剩下一堆看起来像这样的分支 BranchA origin BranchA remotes BranchA remotes origin BranchA remotes orig
  • 如何让 Gitlab 运行程序在成功构建时将代码合并到分支中

    嗯 标题几乎是不言自明的 总之 如果构建成功 我希望将一个分支 即开发 合并到另一个分支 即生产 我尝试了 jakub kania 解决方案 但我总是得到id rsa invalid format 我认为 gitlab 秘密变量以某种方式被
  • git-svn 如何知道要提交到哪个分支?

    我的存储库是 SVN 我使用 git 进行所有开发 我们有一个标准布局 我用以下命令初始化了我的本地存储库git svn init s
  • 尝试配置 GIT 时 Eclipse 没有响应

    Windows 10 专业版 64 位SSD金士顿 i5 4690Eclipse 版本 全部工作空间 空问题 每次我尝试配置 TEAM gt GIT gt 配置或尝试导入 创建本地 远程 git 时 Eclipse 都会冻结 直到我强制用任
  • GIT 和 Ruby:如何从 ruby​​ 脚本内部取消设置 GIT_DIR 变量?

    我编写了一个非常简单的 部署 脚本作为我的post update挂钩到我的裸 git 存储库中 变量如下 live domain mydomain com staging domain stage mydomain com git repo
  • 使用 GitHub,在添加现有存储库时如何推送所有分支?

    我创建了一个新的 GitHub 存储库 我想将现有的存储库放在那里 我按照说明操作 cd existing git repo git remote add origin email protected cdn cgi l email pro
  • 为什么cherry-pick 告诉我所有行都已更改?

    Updated 考虑文件 abc 在提交 A 和 B 中都相同 begin 123 456 789 klm end 在A中 我们重构第一行123 gt AAA并在结果之上选择 B Git 告诉我们all lines in the file
  • 合并后 Git 分支和提交历史记录

    我正在开发一个项目 单独 对于我开发的每个功能 我都会创建一个新分支 处理该功能 然后将其合并到 master 中 所以通常我不会同时在两个不同的分支上工作 也不会在一个分支上工作时接触master 当我合并一个分支时 我看到 使用gitx

随机推荐

  • 使用清单在 LoadLibrary 中搜索 Windows 路径

    如果你打电话LoadLibrary没有路径 例如 LoadLibrary whatever dll Windows 通常会遵循其标准搜索算法 与查找 EXE 所用的算法相同 我的问题是这样的 假设应用程序清单指定了系统 DLL 的特定版本
  • Durandal.js 优化器不工作(空 main-built.js)

    我正在尝试让 Durandal js 优化器在我的测试项目上工作 但它似乎不会为 main built js 生成任何内容 我在 durandal amd 文件夹中的 node js 命令提示符下使用以下命令 optimizer exe v
  • MongoDB+Azure+Android:com.mongodb.WriteConcernException 错误:“不是主”代码:“10058”

    背景 您好 我正在 Azure 上运行 MongoDB 副本集 并已从 Android 应用程序中远程连接到它 我已经从所有实例中获得了很好的读取效果 更新 因为允许它们在主节点和辅助节点上读取 但是 写入数据库仍然会出现间歇性错误 并出现
  • 双向自我参照关联

    以 Ryan Bates 的 asciicast 为例 http asciicasts com episodes 163 self referential association 他以两个 User 关联结束 friends 逆朋友 鉴于用
  • 如何在 C# 中传递多个枚举值?

    有时 在阅读其他人的 C 代码时 我会看到一种方法在单个参数中接受多个枚举值 我一直以为它很整洁 但从未仔细研究过 好吧 现在我想我可能需要它 但不知道如何 设置方法签名以接受此方法 使用方法中的值 定义枚举 来实现这种事情 In my p
  • 在 android 中隐藏 Tablayout Bar

    我有一个活动toolbar Tablayout viewpager有碎片 像那样 I want to implement toolbar material search on all the fragments like that 但问题是
  • Android Studio 突然无法解析符号

    Android Studio 0 4 2 工作正常 今天我打开它 几乎所有内容都是红色的 并且自动完成功能已停止工作 我查看了导入 AS 似乎告诉我它找不到android support v4突然之间 为我提供了删除未使用的导入的选项 an
  • Java - 使用不带 lambda 表达式的谓词

    我有以下要求 员工 java public boolean isAdult Integer age if age gt 18 return true return false 谓词 java private Integer age Pred
  • 如何将 jQuery 插件功能限制为仅某些元素?

    我查看了 jQuery 插件网站 它教我如何编写基本插件 function fn maxHeight function var max 0 this each function max Math max max this height re
  • 合并多个精灵节点?

    例如 假设我有 2 个精灵节点 但也可以超过 2 个 如下所示 每个人都有自己独立的图像我想要的是将它们组合起来并用单个图像创建一个新的精灵节点 在工具模式下 like this 也许可以通过使用Image 毫无疑问涉及计算 或者也许使用一
  • 如何使用Python高效地在另一个字符串列表中搜索字符串列表?

    我有两个名称 字符串 列表 如下所示 executives Brian Olsavsky Some Guy Some Lady analysts Justin Post Some Dude Some Chick 我需要找到这些名称出现在如下
  • 当我使用 MKL 时,为什么 Tensorflow 会发出有关 AVX2 的警告?

    我正在使用具有 MKL 支持的 Tensorflow Anaconda 发行版 from tensorflow python framework import test util test util IsMklEnabled 这段代码打印T
  • 如何暂停和恢复 javascript 计时器 [重复]

    这个问题在这里已经有答案了 我有一个工作正常的计时器 但我需要能够暂停并在那之后恢复它 如果有人能帮助我 我将不胜感激
  • getUserMedia 在 Android Chrome 上冻结在第一帧

    我在桌面浏览器上有一个支持 getUserMedia Api 的工作代码 我可以在 div 中正确地看到网络摄像头的视频预览videoPreview 然而 当在 Android 设备上运行时 当我接受在 Chrome 浏览器中共享照片时 相
  • 在 JavaScript 中使用 JSON 将数组存储在 localStorage 中

    我已经参考了这个问题并为我工作 so q1 现在的问题是我使用 JSON stringify 和 JSON parse 将数组存储在 localStorage 中 但是 当我再次运行代码并尝试在 localStorage 上使用 JSON
  • JSF 2:未为错误页面呈现 Facelets 组合(模板)

    我在 Java EE 6 应用程序服务器 GlassFish v3 中使用 JSF 2 0 和 Facelets 我在 web xml 中配置了一个异常错误页面
  • Javascript Fullcalendar - 复制事件

    我在我的项目中使用 Fullcalendar http arshaw com fullcalendar 它通过 json 源获取事件 我想为用户提供将日历上的一个事件复制到另一天的选项 并且我想使用拖动来实现这一点 嗯 这是客户的要求 但拖
  • gmaps4rails 单标记自动缩放

    我正在尝试遵循答案here当地图上显示单个标记时缩小一点 默认情况下 我已经尝试了下面的代码 并生成了工作地图 但是更改 setZoom 没有效果 另外 我从 firebug 收到以下错误 下面的代码
  • 如何将 void* 转换为函数指针?

    我在 FreeRTOS 中使用 xTaskCreate 其第四个参数 void const 是传递给新线程调用的函数的参数 void connect to foo void const task params void on connect
  • 我如何知道 `git gc --auto` 是否做了什么?

    我在跑git gc auto作为自动保存脚本的一部分 我想进行进一步的清理 如果git gc auto已经做了一些事情 但我想避免麻烦 如果git gc auto感觉不需要做某事 有没有办法检查返回值git gc auto 或者事先检查是否