我如何知道 `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 Bash 克隆 git 存储库

    在尝试使用克隆存储库时git clone 它显示以下错误 致命 无法访问 https github com microsoft c9 python getting started git https github com microsoft
  • 仅使用 Git grep 的文件名

    我只想查看文本中包含特定单词的不同文件 current directory git grep word 显示文件中具有匹配单词的每一行 所以我尝试了这个 current directory git grep word files with
  • 如何在不在存储库中的情况下执行 Git 命令?

    有没有一种方法可以在不位于存储库的情况下对存储库执行 Git 命令 例如这样的事情 git home repo log 请不要告诉我cd到它 我正在通过一个exec call Use C作为 git 的第一个参数 git C home re
  • 部分共享git仓库

    我是 git 新手 我想知道是否支持以下场景 如果支持的话如何支持 即用于设置和更新的 git 命令 可以从三个不同的地方获取存储库 本地 镜像 和 github mirror 完全镜像 local github 镜像 local 但 受版
  • git merge 冲突的不同场景

    我试图了解 git 合并后可能发生 git 冲突的情况以及如何避免它们 我创建了一个 git 存储库并向其中添加了一个文本文件 我已将 1 添加到文本文件中并将其提交给 master 我已经从 master 创建了一个新分支 分支 2 并将
  • 有没有一个简单的命令可以将分支转换为标签?

    我即将完成将 哑快照 转换为 git 的繁琐过程 这个过程进展得非常顺利 感谢这个重命名过程 https stackoverflow com questions 6628539 how to tell git that its the sa
  • 删除 Git 存储库,但保留所有文件

    在我使用 Linux 的过程中的某个时刻 我决定将我的主目录中的所有内容都放入源代码管理中是个好主意 我不是在问这是否是一个好主意 我是在问如何撤销它 删除存储库的原因是我最近安装了 Oh My Zsh 而且我非常喜欢它 问题是我的主目录有
  • 具有单个子模块的多个存储库

    我已经找了一段时间但没有找到答案 也许我不知道该看什么 我们有一个主库 它本身就是一个存储库 我们称之为 Lib 它包含我们的大部分模块和子模块 我们还假设它的大小为 2GB 现在我们有很多项目 例如 ProjA ProjB ProjC 每
  • 我应该把 .gitignore 放在哪里才能影响所有项目?

    我应该在哪里放置一个 gitignore文件以便我的所有项目都使用这些设置 我尝试了各种文件夹 只有将其放入项目文件夹中才能使其正常工作 但是设置 当然 仅应用于该项目 而不是我的其他项目 git 包含一个 全局 配置选项 可以告诉它在启动
  • 尝试克隆一个 git 存储库,但它卡在克隆到中

    我使用的是 Windows 10版本 10 0 19042 内部版本 19042 GIT Ver 2 32当尝试使用 git bash 执行以下命令时git clone depth 1 b carla https github com Ca
  • 有没有办法导入/导出容器绑定脚本

    我有一个插件 它使用 appscripts gs 以及 html js 和 css 文件 目前我们所做的是我们有一个参考 Google 文档 其中有一个脚本项目包含所有这些源代码 但是除了手动复制和粘贴之外 没有办法在 GIT 中保留源代码
  • Gitolite git 克隆错误

    我正在尝试在我的服务器 Macos 服务器 上设置 gitolite 我按照此处找到的安装文档中的说明进行操作 http sitaramc github com gitolite doc 1 INSTALL html http sitara
  • Git checkout 不会丢弃我的更改

    我在 Windows XP 上使用 git 1 7 1 和 cygwin 这个问题可以通过例子得到最好的说明 git status On branch master Changed but not updated use git add
  • 如何更改 GitHub 上的文件模式?

    git add test file git commit m first commit create mode 100644 test file git push git update index add chmod x test file
  • 有没有一种干净的方法来处理两个以相同内容开头的原始 git 存储库?

    假设我有两个根据相同的初始内容创建的存储库 例如 如果我使用 git 来管理 etc apache2 中的 apache 配置文件 然后我运行git init分别在机器 A 和机器 B 上 此后 我对 machine b 进行了一些配置更改
  • 使用 git 子树时如何添加特定文件夹?

    我正在开发一个复杂的 Ionic 项目 我正在开发的许多组件和提供程序都是通用的 可以在我公司正在进行的其他项目中使用 这在软件开发中很常见 这是我提出的 Git 工作流程 该图显示了分支 my company library repo c
  • PHP Github Pull 脚本错误“权限被拒绝(公钥)”

    我已经设置了一个 PHP 脚本来执行 GitHub 拉取 这包含在我的 Github 文件夹中 home mysite public html github github pull php 我的服务器已经有 SSH 公钥 就像我执行git
  • 在git的远程存储库上创建私有分支

    我想在我们公司的 git 上构建特定的流程 开发人员在他的本地计算机上创建一个分支并在那里提交一些文件 dev 将此分支推送到远程仓库 其他开发者无法访问该分支 经过几轮推动开发人员决定发布他的更改 将他的私人分支合并到公共分支 推动该公共
  • 如何在 Visual Studio 2013 中使用 Git 的外部 diff 工具?

    我找到了这个帖子 http architects dzone com articles how configure diff and merge这解释了如何让 Visual Studio 2013 在比较 Git 中的文件时使用内置 dif
  • 推送更改到 Git 不起作用

    每次我想要提交命令 git push heroku master 时 系统都会要求我在 PowerShell 中输入凭据 当我输入 heroku 凭据 默认情况下连接到 git 时 我收到错误消息 但是 当我输入我的主目录中的 netrc

随机推荐

  • 使用清单在 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 或者事先检查是否