English 中文(简体)
吉苏事前 h:获得更改的档案清单
原标题:Git pre-commit hook: getting list of changed files

我正在开发验证和lin化效用,以便与包括Gite 1在内的各种犯罪集团结合起来。

https://github.com/miohtama/vvvv

目前,每个项目的有效器和护栏都与整个项目代码基相对照。 然而,仅仅根据变换的档案来管理这些档案将更为理想。 为此,我需要了解我的Gite precommit hook(Almain)的变更档案清单。

https://github.com/miohtama/vvvv/blob/master/vvvv/hooks/git.py

B. 什么选择 我必须提取经修改的档案清单(如果是这种情况的话)?

最佳回答

如果你真的想要做“正确”的工作,预comm就是痛苦的bit,因为工作树中的东西不一定与必须做的事情相同:

$ echo morestuff >> file1; echo morestuff >> file2
$ git add file1 # but not file2
$ git commit -m  modified two files but check in just one 

您可使用<代码>git diff-index_cadated HEAD,获得一份“待核对的帽子”清单。 See also, e.g.,

问题回答

这不是直接的答案——但我是在寻找同样解决办法时,用正文 with。

在进行一些进一步搜查后,我认为,现在这是一个与lint-staged Library相隔的未决问题。 这只包含staged文档。

我在搜寻时遇到的问题是,我总是在寻找“预先准备”的lin,而不是“倾斜档案”。 因此,我在这里为像我这样来到这里寻求 Java本解决办法的人作这一回答。

希望这套纳米材料也能给富尔世界带来一些启发。





相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签